» 网友学堂 » LINUX教程 » Apache+PHP+MySQL+Zend LINux环境安装
Apache+PHP+MySQL+Zend LINux环境安装
作者:暖月 发表时间:2007-5-24 12:24 阅读:2362次 在百度搜索相关内容

1) 下载软件


以下是代码:
# 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


以下是代码:
# 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


以下是代码:
# 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


以下是代码:
# 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


以下是代码:
# 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

以下是代码:
# vi /usr/local/apache2/conf/httpd.conf



搜索:


以下是代码:
DirectoryIndex index.html index.html.var



将其改为:

以下是代码:
DirectoryIndex index.html index.htm index.php



搜索:

以下是代码:
AddType application/x-gzip .gz .tgz



在下面添加一行:


以下是代码:
AddType application/x-httpd-php .php



保存退出后重启Apache

以下是代码:

# /usr/local/apache2/bin/apachectl restart

#1 ljjk5 发表评论于:2007-5-24 12:45
smartapache一键搞定,推荐phpwind amp