#!/bin/bash echo "1.please input the mysql's path where will installed [default:/web/mysql]" read sqlread if [ "$sqlread" != "" ];then sql=$sqlread else sql="/web/mysql" fi echo "2.please input the httpd's path where will installed [default:/web/httpd]" read httpdread if [ "$httpdread" != "" ];then httpd=$httpdread else httpd="/web/httpd" fi echo "3.please input the php's path where will installed [default:/web/php]" read phpread if [ "$phpread" != "" ];then php=$phpread else php="/web/php" fi mkdir -p $sql mkdir -p $httpd mkdir -p $php useradd mysql tar zxvf `ls | grep mysql | grep tar` cd `ls -d */ | grep mysql` ./configure --prefix=$sql --enable-thread-safe-client --with-extra-charsets=gbk && make && make install cp ./support-files/my-medium.cnf /etc/my.cnf ${sql}/bin/mysql_install_db --user=mysql cd .. tar zxvf `ls | grep http | grep tar` cd `ls -d */ | grep http` ./configure --prefix=$httpd --enable-so --enable-rewrite && make && make install cd .. tar zxvf `ls | grep php | grep tar` cd `ls -d */ | grep php` ./configure --prefix=$php --with-mysql=$sql --with-apxs2=${httpd}/bin/apxs --with-config-file-path=/usr/local/lib/ && make && make install cp -f `ls | grep php.ini | head -1` /usr/local/lib/php.ini cd .. ln -s ${sql}/bin/* /usr/bin/ ln -s ${httpd}/bin/* /usr/bin/ ln -s ${php}/bin/* /usr/bin/ echo "${httpd}/bin/apachectl start" >> /etc/rc.d/rc.local echo "${sql}/bin/mysqld_safe --user=mysql &" >> /etc/rc.d/rc.local echo "AddType application/x-httpd-php .php" >> ${httpd}/conf/httpd.conf //shell/1297