18.191.174.159--[美国-俄亥俄州都柏林Amazon数据中心]-开启辅助访问 切换到窄版

萬法歸宗-郭岳璋的家

 找回密码
 立即註冊
查看: 7103|回复: 0

Discuz 2.5 静态化-成功了-变快了-差很大

[复制链接]
admin 该用户已被删除
发表于 2012-6-4 14:31:02 | 显示全部楼层 |阅读模式
Linux slackware 12.37
Kernel 3.1.1
環境  php-5.3.8
         apache-2.2.22

---install  memcache --
wget http://memcached.googlecode.com/files/memcached-1.4.13.tar.gz
wget http://pecl.php.net/get/memcache-2.2.6.tgz  ##stable
wget http://pecl.php.net/get/memcache-3.0.6.tgz  ##beta
wget https://github.com/downloads/lib ... .0.19-stable.tar.gz
wget http://download.tangent.org/libmemcached-1.0.8.tar.gz

A.install Apache 2.2.22 + PHP 5.3.8
## apache2 ###
cd /usr/src/httpd*
./configure --prefix=/usr/local/apache2 --enable-module=so  --enable-so \
--enable-cache --enable-file-cache --enable-mem-cache --enable-disk-cache --enable-static-support \
--enable-rewrite=shared --with-apxs2=/usr/local/apache2/bin/apxs
make clean; make; make install

###--- PHP 5.3.8 ---###
./configure --prefix=/usr/local/php --enable-pdo=shared  --with-curl=shared \
--enable-sockets=shared --enable-soap=shared --enable-xml=shared --with-xsl=shared --enable-zip=shared \
--enable-pcntl  --with-mysql \
--enable-calendar --without-sqlite3 -without-pdo-sqlite --without-sqlite --with-apxs2=/usr/local/apache2/bin/apxs \
--with-libxml-dir=/usr/local/lib --with-zlib  --enable-gd-native-ttf \
--with-freetype-dir --with-jpeg-dir \
--with-pgsql=/usr/local/pgsql --with-imap=/usr/src/imap-2004  \
--with-mssql=/usr/local/freetds  --enable-ftp  --enable-xml  \
--with-gd --with-pcre-regex \
--with-freetype-dir=/usr/include/freetype2 \
--with-config-file-path=/ \
--with-iconv-dir=/usr/local/lib \
--with-png-dir=/usr/local/libpng --enable-mbstring  --with-openssl=shared
make clean; make ZEND_EXTRA_LIBS='-liconv' ; make install;

B.--memcache- 化
cd /usr/src
tar -zxvf /lin_app/memcache/libevent-2.0.19-stable.tar.gz
cd libevent*
./configure
make;make install
rm /usr/lib/libevent-2.0.so.5
  ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5

cd /usr/src
rm -r memcached
tar -zxvf /lin_app/memcache/memcached-1.4.13*
cd memcached*
./configure --prefix=/usr/local/memcached
make ;make install

cd /usr/local/memcached/bin
./memcached -d -m 50 -p 11211 -u root

cd /usr/src
   rm -r memcache-3.0*
tar -zxvf /lin_app/memcache/memcache-3.0*
   cd memcache-3.0*
  /usr/local/php/bin/phpize
  ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir
  make
make install

cd /usr/src
rm -r eaccelerator-0.9.*
unzip /lin_app/memcache/eaccelerator-0.9.6.1.zip

cd eaccelerator-0.9.*
/usr/local/php/bin/phpize
./configure -enable-eaccelerator=shared -with-php-config=/usr/local/php/bin/php-config
make
make install
mkdir /tmp/eaccelerator
chmod 777 /tmp/eaccelerator




環境  php-5.3.8
         apache-2.2.22
C. --修改-  apache2  --- httpd.conf
  •   LoadModule rewrite_module       modules/mod_rewrite.so
  • #AddModule  mod_rewrite.c
  • <IfModule mod_rewrite.c>
  • RewriteEngine On
  • RewriteCond %{QUERY_STRING} ^(.*)$
  • RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topicid=$2&%1
  • RewriteCond %{QUERY_STRING} ^(.*)$
  • RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3&%1
  • RewriteCond %{QUERY_STRING} ^(.*)$
  • RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&%1
  • RewriteCond %{QUERY_STRING} ^(.*)$
  • RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1
  • RewriteCond %{QUERY_STRING} ^(.*)$
  • RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3&%1
  • RewriteCond %{QUERY_STRING} ^(.*)$
  • RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3&%1
  • RewriteCond %{QUERY_STRING} ^(.*)$
  • RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3&%1
  • RewriteCond %{QUERY_STRING} ^(.*)$
  • RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3&%1
  • RewriteCond %{QUERY_STRING} ^(.*)$
  • RewriteRule ^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ $1/plugin.php?id=$2:$3&%1
  • </IfModule>

D. Discuz 2.5 后台-全局-SEO-修改 靜態化
就ok!
   

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即註冊

本版积分规则

小黑屋|手機版|Archiver|masterkuo.com

GMT+8, 2024-9-20 07:39 , Processed in 0.032580 second(s), 16 queries , MemCache On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表