傻瓜安装法
开始
1. 自建目录/root/chinaunix中,放入4个文件:
apache_1.3.17.tar.gz、php-4.0.6.tar.gz、mysql-3.22.40.tar.gz、install
2. #cd /root/chinaunix; chmod 755 install; ./install
安装结束
脚本install的内容如下
tar zxvf apache_1.3.17.tar.gz
tar zxvf php-4.0.6.tar.gz
tar zxvf mysql-3.22.40.tar.gz
mv apache_1.3.17 apache
mv php-4.0.6 php
mv mysql-3.22.40 mysql
# compile and install mysql
cd mysql
./configure --prefix=/usr/local/mysql
make
make install
scripts/mysql_install_db
echo "/usr/local/mysql/bin/safe_mysqld &" >> /etc/init.d/rc.local
/usr/local/mysql/bin/safe_mysqld &
# preconfigure apache
cd ../apache
./configure --prefix=/usr/local/apache
# compile and install php
cd ../php
./configure --with-mysql=/usr/local/mysql --with-apache=../apache --enable-track-vars
make
make install
# cp lib file
cp -f libs/libphp4.a ../apache/src/modules/php4/libphp4.a
# compile and install apache
cd ../apache
./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/libphp4.a
make
make install
# cp php ini file
cd ../php
cp php.ini-dist /usr/local/lib/php.ini
# modify /usr/local/apache/conf/httpd.conf
sed -e 's+^ClearModuleList.*+LoadModule php4_module libexec/libphp4.so
&
AddModule mod_php4.c+'
-e 's+AddType application/x-tar .tgz.*+&
AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-phpx .phpx+'
httpd.conf | tr '&' '
' > httpd.bak
mv -f httpd.bak httpd.conf
# start apache
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
cd /etc/rc3.d/
ln -s ../init.d/httpd S70httpd
/usr/local/apache/bin/apachectl start
# clear the environment
cd /root
rm -rf chinaunix
echo "Installation Succeed!"
# end of install