您的位置:首页 > 运维架构 > Apache

Apache+php+MySQL安装 Step By Step

2008-04-09 23:54 246 查看
1.  安装之前你需要下载如下软件包a)         Apache2website:http://www.apache.orgDownload URL:http://apache.justdn.org/httpd/httpd-2.0.55.tar.gzb)        PHP5website:http://www.php.netdownload URL: http://cn.php.net/get/php-5.1.1.tar.gz/from/this/mirrorc)        MySQL 4.1Website: http://www.mysql.orgdownload: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 ClientWebsite: http://www.freebsd.org/portsDownload:ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-stable/All/mysql-client-4.1.15.tbze)         Zlib 1.2.3Website: http://www.zlib.netDownload url: http://www.zlib.net/zlib-1.2.3.tar.gzf)         GD Library 2.033Website: http://www.boutell.com/gdDownload 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 install5.  安装gd-2.0.33# tar xzfv gd-2.0.33.tar.gz# cd gd-2.0.33# ./configure# make# make install6.  安装 MySQL 4.1 Client由于前边安装MySQL Server时用了编译好的文件,所以这里需要安装一下 MySQL Client。为了方便直接安装了MySQL 4.1 Client的package# pkg_add mysql-client-4.1.14.tbz7.  安装 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 installl         在 apache 的配置文件httpd.conf中加入 AddType application/x-httpd-php .phpl         新建文件 test.php,内容如下: ,测试apache是否可以解析php 8.  优化Apache修改apache的配置文件httpd.confStartServers         3MaxClients          2000MinSpareThreads     50MaxSpareThreads     200ThreadsPerChild     100MaxRequestsPerChild 0ThreadLimit 200ServerLimit 25 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: