Apche + MySQL + PHP Consolidated installation script

Source: Internet
Author: User
Tags ini mysql

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



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.