Apache+php+MySQL安装 Step By Step

来源:互联网 发布:全景生成系统源码 编辑:程序博客网 时间:2024/05/18 02:02
1.  安装之前你需要下载如下软件包
a)         Apache2
website:http://www.apache.org
Download URL:http://apache.justdn.org/httpd/httpd-2.0.55.tar.gz
b)        PHP5
website:http://www.php.net
download URL: http://cn.php.net/get/php-5.1.1.tar.gz/from/this/mirror
c)        MySQL 4.1
Website: http://www.mysql.org
download:http://dev.mysql.com/get/Downloads/MySQL-4.1/mysql-max-4.1.15-unknown-freebsd5.3-i386.tar.gz/from/http://mirror.vmmatrix.net/mysql/
d)        MySQL 4.1 Client
Website: http://www.freebsd.org/ports
Download:ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-stable/All/mysql-client-4.1.15.tbz
e)         Zlib 1.2.3
Website: http://www.zlib.net
Download url: http://www.zlib.net/zlib-1.2.3.tar.gz
f)         GD Library 2.033
Website: http://www.boutell.com/gd
Download URL:http://www.boutell.com/gd/http/gd-2.0.33.tar.gz
 
2.  安装Mysql4.1
# tar xzfv mysql-max-4.1.15-unknown-freebsd5.3-i386.tar.gz
# cd mysql-max-4.1.15-unknown-freebsd5.3-i386
# pw groupadd mysql
# pw adduser mysql -g mysql
# mv mysql-max-4.1.15-unknown-freebsd5.3-i386/ /usr/local/mysql-max-4.1.15
# cd /usr/local
# ln -s mysql-max-4.1.15 mysql
# chown -R mysql:mysql mysql-max-4.1.15
# mysql/bin/mysqld_safe &
# /usr/local/mysql/bin/mysqladmin -u root password xxxxxx
# /usr/local/mysql/bin/mysqladmin -u root -p shutdown
# cd /usr/local/mysql/support-files
# cp my-large.cnf /etc/my.cnf
# /usr/local/mysql/bin/mysqld_safe &
3.  安装Apache2
 
       # tar xzfv httpd-2.0.55.tar.gz
# cd httpd-2.0.55
# ./configure --prefix=/usr/local/apache2.0.55 /
       --enable-so --enable-rewrite /
       --enable-mime-magic /
       --enable-vhost-alias /
       --enable-deflate /
       --enable-expires /
       --with-mpm=worker
# make
# make install
# cd /usr/local
# ln -s apache2.0.55 apache
# cd apache
# bin/apachectl start
 
4.  安装Zlib 1.2.3
# tar xzfv zlib-1.2.3.tar.gz
# cd zlib-1.2.3
# ./configure --shared
# make
# make install
5.  安装gd-2.0.33
# tar xzfv gd-2.0.33.tar.gz
# cd gd-2.0.33
# ./configure
# make
# make install
6.  安装 MySQL 4.1 Client
由于前边安装MySQL Server时用了编译好的文件,所以这里需要安装一下 MySQL Client。为了方便直接安装了MySQL 4.1 Client的package
# pkg_add mysql-client-4.1.14.tbz
7.  安装 PHP5
#tar xzfv php-5.1.1.tar.gz
#cd php-5.1.1
#./configure --with-apxs2=/usr/local/apache/bin/apxs /
--enable-track-vars --with-zlib --with-gd /
--with-sockets --enable-sockets /
--disable-debug --with-tiff-dir=/usr/local/lib --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib /
--with-zlib-dir=/usr/local/lib --with-mysql --with-xml /
--enable-shmop /
--prefix=/usr/local/php5 /
--enable-mbstring /
--enable-sysvsem --enable-sysvshm --enable-sysvmsg /
--enable-soap
#make
#make install
l         在 apache 的配置文件httpd.conf中加入 AddType application/x-httpd-php .php
l         新建文件 test.php,内容如下: ,测试apache是否可以解析php
 
8.  优化Apache
修改apache的配置文件httpd.conf
StartServers         3
MaxClients          2000
MinSpareThreads     50
MaxSpareThreads     200
ThreadsPerChild     100
MaxRequestsPerChild 0
ThreadLimit 200
ServerLimit 25
 



原创粉丝点击