This script can be done without human intervention to complete the L.A.M.P integration work.
This script applies to the apache2.0.5x,php4.0.x and compiled (binary version) mysql4.0.2x of the consolidated source package approach.
Note that the above three packages are best downloaded from their respective official sites, and it is best not to change the filename after downloading!
How to use:
=====
1, will download the good 3 packages and this installs the script (install_lamp.sh) to place in
/home/nanu under. Place at random, but note that 3 packages and this installation script must be placed in the same directory!
2./configure parts of Apache and PHP are replaced with your compilation parameters as needed;
3, the implementation of install_lamp.sh;
4, after the installation is complete, the MySQL root password is saved by default in/usr/local/mysql/passwd.root, in case of forgetting.
Scripting code:
=====
Code:[copy to Clipboard]#!/bin/bash
# mysql4.0.x Start
/bin/tar XZVF mysql*4.0.*.tar.gz
/bin/rm-f mysql*4.0.*.tar.gz
/usr/sbin/useradd MySQL
/BIN/MV mysql*4.0*/usr/local/mysql
/usr/local/mysql/scripts/mysql_install_db--user=mysql
/bin/chown-r root/usr/local/mysql/.
/bin/chown-r Mysql/usr/local/mysql/data
/bin/chgrp-r mysql/usr/local/mysql/.
/bin/cp/usr/local/mysql/support-files/my-large.cnf/etc/my.cnf
/usr/local/mysql/bin/mysqld_safe--user=mysql &
echo "Please Set Your MySQL root Password:"
Read password
/usr/local/mysql/bin/mysqladmin-u Root Password $password
/bin/touch/usr/local/mysql/passwd.root
Echo $password >; /usr/local/mysql/passwd.root
/usr/local/mysql/bin/mysqladmin-u Root--password= $password shutdown
/bin/cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld
/sbin/chkconfig--add mysqld
/etc/rc.d/init.d/mysqld start
# mysql4.0.x End
# apache2.0.x Start
/bin/tar XZVF httpd-2.0.*.tar.gz
CD httpd-2.0.*
./configure--prefix=/usr/local/apache--mandir=/usr/share/man--enable-mods-shared=all--enable-so
Make
Make install
echo "AddType application/x-httpd-php. php" >;>; /usr/local/apache/conf/httpd.conf
Sed-i ' s/' directoryindex index.html index.html.var '/' DirectoryIndex index.htm index.html ' index.php ' index.html.var '/g ' /usr/local/apache/conf/httpd.conf
/usr/local/apache/bin/apachectl-k start
# apache2.0.x End
# php4.0.x Start
/bin/tar XZVF php-*.tar.gz
CD php-*
./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache/bin/apxs--mandir=/usr/share/man--with-mysql=/ Usr/local/mysql--with-config-file-path=/usr/local/php/etc
Make
Make install
/BIN/CP Php.ini-recommended/etc/php.ini
Sed-i ' s/' register_globals = Off '/' register_globals = On '/g '/etc/php.ini
/usr/local/apache/bin/apachectl-k restart
# php4.0.x End