1) 下载软件
2) 安装MySQL
3) 编译安装Apache
4) 编译安装PHP
5) 安装Zend Optimizer
6) 整合Apache与PHP
搜索:
将其改为:
搜索:
在下面添加一行:
保存退出后重启Apache
| class='codetop'>CODE: class='codemain'># cd /usr/local/src # wget http://download.discuz.net/env/httpd-2.0.58.tar.bz2 # wget http://download.discuz.net/env/mysql-standard-5.0.22-linux-i686.tar.gz # wget http://download.discuz.net/env/php-5.1.4.tar.bz2 # wget http://download.discuz.net/env/ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz |
2) 安装MySQL
| class='codetop'>CODE: class='codemain'># tar xzvf mysql-standard-5.0.22-linux-i686.tar.gz # useradd mysql # mv mysql-standard-5.0.22-linux-i686 /usr/local/mysql # cd /usr/local/mysql # scripts/mysql_install_db --user=mysql # chown -R root . # chown -R mysql data # chgrp -R mysql . # mv data /var/lib/mysql # ln -s /var/lib/mysql ./data # cp support-files/my-large.cnf /etc/my.cnf # bin/mysqld_safe --user=mysql & # bin/mysqladmin -u root password newpassword_for_root # bin/mysqladmin -u root -p shutdown # cp support-files/mysql.server /etc/init.d/mysqld # chkconfig --add mysqld # /etc/rc.d/init.d/mysqld start |
3) 编译安装Apache
| class='codetop'>CODE: class='codemain'># cd /usr/local/src # tar xjvf httpd-2.0.58.tar.bz2 # cd httpd-2.0.58 # ./configure --prefix=/usr/local/apache2 --mandir=/usr/ share/man --enable-module=so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-gzip --enable-cache --enable-file-cache --enable-mem-cache --enable-disk-cache # make # make install |
4) 编译安装PHP
| class='codetop'>CODE: class='codemain'># cd /usr/local/src # tar xjvf php-5.1.4.tar.bz2 # cd php-5.1.4 # ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/ apache2/bin/apxs --with-zlib --with-bz2 --with-tiff-dir --with-libxml-dir=/usr/local/libxml2 --with-gd=/usr/local/ gd2 --with-freetype-dir --with-jpeg-dir --with-png-dir --with-ttf --enable-mbstring --with-mysql=/usr/local/mysql --with-config-file-path=/etc --disable-ipv6 --enable-gd- native-ttf # make # make install # cp php.ini-dist /etc/php.ini |
5) 安装Zend Optimizer
| class='codetop'>CODE: class='codemain'># cd /usr/local/src # tar xzvf ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz # ./ZendOptimizer-3.0.1-linux-glibc21-i386/install.sh |
6) 整合Apache与PHP
| class='codetop'>CODE: class='codemain'># vi /usr/local/apache2/conf/httpd.conf |
搜索:
| class='codetop'>CODE: class='codemain'>DirectoryIndex index.html index.html.var |
将其改为:
| class='codetop'>CODE: class='codemain'>DirectoryIndex index.html index.htm index.php |
搜索:
| class='codetop'>CODE: class='codemain'>AddType application/x-gzip .gz .tgz |
在下面添加一行:
| class='codetop'>CODE: class='codemain'>AddType application/x-httpd-php .php |
保存退出后重启Apache
| class='codetop'>CODE: class='codemain'># /usr/local/apache2/bin/apachectl restart |

添加到雅虎收藏