简单LAMP安装脚本

#!/bin/bash
#LAMP install script
#Create by wellpan
#安装软件放在/usr/local/src目录下,针对系统全新安装情况下

#time sys
yum install ntp -y
ntpdate 210.72.145.44
hwclock -w
yum install -y gcc gcc-c++ make autoconf libtool-ltdl-devel gd-devel freetype-devel libxml2-devel libjpeg-devel libpng-devel openssl-devel curl-devel patch libmcrypt-devel libmhash-devel ncurses-devel
IN_SRC=/usr/local/src
IN_LOG=${IN_SRC}/lmap_install.log
IN_DIR=/usr/local

#install
echo "installing mysql...."
useradd -d /dev/null -s /sbin/nologin mysql >&2 > /dev/null
cd $IN_SRC
tar -zxvf mysql-5.1.53.tar.gz  >> $IN_LOG 2>&1
cd mysql-5.1.53/
./configure --prefix=$IN_DIR/mysql --with-extra-charsets=all --enable-thread-safe-client >>$IN_LOG 2>&1
make    >> $IN_LOG 2>&1
make install    >> $IN_LOG 2>&1
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
cd $IN_DIR/mysql
$IN_DIR/mysql/bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql var
chgrp -R mysql .
echo "$IN_DIR/mysql/lib/mysql" >> /etc/ld.so.conf
ldconfig
echo "export PATH=$PATH:$IN_DIR/mysql/bin" >> /etc/profile
source /etc/profile
/etc/init.d/mysqld start
$IN_DIR/mysql/bin/mysqladmin -u root password "123456"

echo "installing httpd...."
cd $IN_SRC
tar zxvf httpd-2.2.17.tar.gz >> $IN_LOG 2>&1
cd httpd-2.2.17/
./configure --prefix=$IN_DIR/apache2 --with-included-apr --enable-so --enable-deflate=shared  --enable-expires=shared --enable-rewrite=shared --enable-static-support >> $IN_LOG 2>&1
make    >> $IN_LOG 2>&1
make install    >> $IN_LOG 2>&1
$IN_DIR/apache2/bin/apachectl start

echo "installing php...."
cd $IN_SRC
tar zxvf php-5.2.16.tar.gz >> $IN_LOG 2>&1
cd php-5.2.16/
./configure --prefix=$IN_DIR/php --with-apxs2=$IN_DIR/apache2/bin/apxs --with-mysql=$IN_DIR/mysql  --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash >> $IN_LOG 2>&1
make    >> $IN_LOG 2>&1
make install    >> $IN_LOG 2>&1
cp php.ini-production  $IN_DIR/php/lib/php.ini
echo "AddType application/x-httpd-php .php" >> $IN_DIR/apache2/conf/httpd.conf
$IN_DIR/apache2/bin/apachectl restart

 

 

相关链接:

http://faq.comsenz.com/usersguide/discuz

http://www.wdlinux.cn/linux_lanmp

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值