admin 发表于 2012-6-4 14:31:02

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

Linux slackware 12.37
Kernel 3.1.1
環境php-5.3.8
         apache-2.2.22

---installmemcache --
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
[*]#AddModulemod_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-(+)-(+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3&%1
[*]RewriteCond %{QUERY_STRING} ^(.*)$
[*]RewriteRule ^(.*)/forum-(\w+)-(+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&%1
[*]RewriteCond %{QUERY_STRING} ^(.*)$
[*]RewriteRule ^(.*)/thread-(+)-(+)-(+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1
[*]RewriteCond %{QUERY_STRING} ^(.*)$
[*]RewriteRule ^(.*)/group-(+)-(+)\.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-(+)-(+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3&%1
[*]RewriteCond %{QUERY_STRING} ^(.*)$
[*]RewriteRule ^(.*)/(fid|tid)-(+)\.html$ $1/index.php?action=$2&value=$3&%1
[*]RewriteCond %{QUERY_STRING} ^(.*)$
[*] RewriteRule ^(.*)/(+*)-(+)\.html$ $1/plugin.php?id=$2:$3&%1
[*]</IfModule>

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

页: [1]
查看完整版本: Discuz 2.5 静态化-成功了-变快了-差很大