#!/bin/bash
soft_dir="/home/soft"
config_dir="/home/config"
httpd="httpd-2.0.52"
mysql="mysql-5.1.56"
php="php-5.2.17"
phpmyadmin="phpMyAdmin-2.9.0.2"
zend="ZendOptimizer-3.2.6-linux-glibc21-i386"
echo -n "check packages,please wait ...... "
cat > list << "EOF" &&
httpd-2.0.52.tar.gz
mysql-5.1.56.tar.gz
freetds-0.64.tar.gz
freetype-2.1.10.tar.gz
gd-2.0.33.tar.gz
jpegsrc.v6b.tar.gz
libmcrypt-2.5.7.tar.gz
libpng-1.2.16.tar.gz
libxml2-2.6.27.tar.gz
php-5.2.17.tar.gz
phpMyAdmin292.tar.gz
ZendOptimizer-3.2.6-linux-glibc21-i386.tar.gz
zlib-1.2.3.tar.gz
EOF
for i in `cat list`
do
if [ -s $soft_dir/$i ]; then
echo "$i [found]"
else
echo "Error: $i not found!!!"
fi
done
echo "auto install apache"
groupadd apache
useradd -g apache -d /usr/local/apache -s /sbin/nologin apache
cd ${soft_dir}
tar zxvf ${httpd}.tar.gz
cd ${httpd}
./configure --prefix=/usr/local/apache --datadir=/www --enable-mods=shared=all --enable-module=so --disable-info --enable-shared=max --enable-rule=SHARED_CORE
make && make install
sed -i "s/nobody/apache/g" /usr/local/apache/conf/httpd.conf
sed -i "s/#-1/apache/g" /usr/local/apache/conf/httpd.conf
chown -R apache.apache /usr/local/apache
sed -e "/4/a #chkconfig: 2345 10 90" -i /usr/local/apache/bin/apachectl
sed -e "/5/a #description: Activates/Deactivates Apache Web Server " -i /usr/local/apache/bin/apachectl
cd /etc/rc.d/init.d/
cp /usr/local/apache/bin/apachectl httpd
chmod 755 httpd
chkconfig --add httpd
chkconfig --level 35 httpd on
service httpd start
echo "auto install mysql"
groupadd mysql
useradd -g mysql -d /mysql -s /sbin/nologin mysql
mkdir -p /mysql/tmp
chown -R mysql.mysql /mysql
chown -R mysql.mysql /data
chmod -R 777 /mysql/
chmod -R 777 /data/
cd ${soft_dir}
tar zxvf ${mysql}.tar.gz
cd $mysql
./configure --prefix=/mysql --localstatedir=/data --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-mysqld-user=mysql --enable-assembler --with-extra-charsets=all --with-unix-socket-path=/mysql/tmp/mysql.sock
make && make install
cp support-files/my-huge.cnf /etc/my.cnf
scripts/mysql_install_db --user=mysql
chown -R mysql.mysql /mysql
chown -R mysql.mysql /data
chmod -R 777 /mysql
chmod -R 777 /data
cd /mysql/
share/mysql/mysql.server start
bin/mysqladmin -u root password "bcmedia"
cd /etc/rc.d/init.d/
cp /home/soft/mysql-5.1.56/support-files/mysql.server mysqld
chmod 755 mysqld
chkconfig --add mysqld
chkconfig --level 35 mysqld on
service mysqld start
ln -s /mysql/bin/mysql /sbin/mysql
echo "auto install gd libary"
mkdir -p /usr/local/jpeg6
mkdir -p /usr/local/jpeg6/bin
mkdir -p /usr/local/jpeg6/lib
mkdir -p /usr/local/jpeg6/include
mkdir -p /usr/local/jpeg6/man
mkdir -p /usr/local/jpeg6/man/man1
cd ${soft_dir}
tar zxvf libxml2-2.6.27.tar.gz
cd libxml2-2.6.27
./configure --prefix=/usr/local/libxml2
make && make install
cd ${soft_dir}
tar zxvf zlib-1.2.3.tar.gz
./configure --prefix=/usr/local/zlib
make && make install
cd ${soft_dir}
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b/
./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
make && make install
cd ${soft_dir}
tar zxvf libpng-1.2.16.tar.gz
cd libpng-1.2.16
./configure
make && make install
mkdir -p /usr/local/freetype
cd ${soft_dir}
tar zxvf freetype-2.1.10.tar.gz
cd freetype-2.1.10
./configure --prefix=/usr/local/freetype
make && make install
cd ${soft_dir}
tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg6/ --with-png --with-zlib --with-freetype=/usr/local/freetype/
make && make install
cd ${soft_dir}
tar zxvf freetds-0.64.tar.gz
cd freetds-0.64
./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --enable-msdblib --enable-dbmfix --with-gnu-ld
make && make install
echo "auto install php"
cd ${soft_dir}
tar zxvf ${php}.tar.gz
cd ${php}
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --enable-sockets --with-mysql=/mysql --with-mssql=/usr/local/freetds --with-gd=/usr/local/gd --with-jpeg-dir=/usr/local/jpeg6 --with-freetype-dir=/usr/local/freetype --with-zlib --with-png --enable-gd-native-ttf --enable-magic-quotes --with-iconv --with-mbstring --enable-track-vars --enable-force-cgi-redirect --enable-calendar --with-gettext --with-gdbm --with-ttf --with-extra-charsets_complex --with-msdblib --enable-module=dso --with-versioning --enable-libxml --enable-so
make && make install
cp php.ini-dist /usr/local/php/lib/php.ini
echo "/mysql/lib /usr/local/php/modules/freetds/lib" >> /etc/ld.so.conf
ldconfig
cd ${config_dir}
yes | cp httpd.conf /usr/local/apache/conf/httpd.conf
yes | cp php.ini /usr/local/php/lib/php.ini
echo "install phpmyadmin"
mkdir -p /www/htdocs/phpmyadmin
cd /www/htdocs
rm -rf *
cd ${soft_dir}
tar zxvf phpMyAdmin292.tar.gz
cd ${phpmyadmin}
cp -rf * /www/htdocs/phpmyadmin
cd ${config_dir}
yes | cp config.default.php /www/htdocs/phpmyadmin/libraries/config.default.php
yes | cp select_lang.lib.php /www/htdocs/phpmyadmin/libraries/select_lang.lib.php
/etc/init.d/httpd restart
echo "auto install Zend"
cd /home/soft
tar zxvf ${zend}.tar.gz
cd ${zend}
./install.sh

linux LNMP自动安装脚本的更多相关文章

  1. 树莓派进阶之路 (035) - 基于linux的zsh安装脚本

    基于linux的zsh安装脚本: Ubuntu版本: #!/bin/sh cd #安装zsh sudo apt-get install zsh #查看zsh cat /etc/shells #更改zs ...

  2. python3自动安装脚本,python3.x与python2.x共存

    1.前言: python3过程中,通过搜索一些文章参考安装过程发现比较麻烦,而且还出现一些不可预期的报错.python3环境需要升级openssl,所以为了部署到其他环境更方便,写自动安装脚本方式,且 ...

  3. mysql 自动备份和nginx自动安装脚本

    一.自动备份Mysql脚本: 如下脚本为mysql自动备份脚本,仅供参考,可以根据实际情况修改. #!/bin/sh #auto backup mysql #wugk #Define PATH定义变量 ...

  4. linux kickstart 自动安装

    最近很多业务系统都是linux lnmp平台安装,反复的安装让人觉得很苦恼,仔细钻研了下kickstart .这里环境是red hat linux 5.8 32位,系统盘中的软件包里包含有kickst ...

  5. Windows ftp脚本和RSCD agent自动安装脚本

    Windows ftp脚本 和bladelogic RSCD Agent自动安装脚本 比较简单的命令是msiexec /I "C:\RSCD85-SP1-WIN64.msi" /Q ...

  6. python第三方库自动安装脚本

    #python第三方库自动安装脚本,需要在cmd中运行此脚本#BatchInstall.pyimport oslibs = {"numpy","matplotlib&qu ...

  7. LAMP自动安装脚本

    #!/bin/bash # 功能描述:LAMP自动安装脚本 # 初始化 if [ "$(cat /etc/system-release | awk '{print $(NF-1)}' | a ...

  8. LNMP 一键安装脚本

    这个脚本是使用shell编写,为了快速在生产环境上部署lnmp/lamp/lnmpa(Linux.Nginx/Tengine/OpenResty.MySQL/MariaDB/Percona.PHP), ...

  9. 自动安装脚本-------------基于LVMP搭建Nagios 监控

    Mysql初始化参数(mysql-5.6.31) /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local ...

随机推荐

  1. Qt之日志输出文件

    在Qt开发过程当中经常使用qDebug等一些输出来调试程序,但是到了正式发布的时候,都会被注释或者删除,采用日志输出来代替.     做过项目的童鞋可能都使用过日志功能,以便有异常错误能够快速跟踪.定 ...

  2. 菜鸟级springmvc+spring+mybatis整合开发用户登录功能(上)

    由于本人愚钝,整合ssm框架真是费劲了全身的力气,所以打算写下这篇文章,一来是对整个过程进行一个回顾,二来是方便有像我一样的笨鸟看过这篇文章后对其有所帮助,如果本文中有不对的地方,也请大神们指教. 一 ...

  3. [cocos2d-x]HelloWorldDemo

    实现一个demo,具备以下功能: 1.让几个字分别位于中间和四个角落. 2.中间的字体改变,并且带有闪烁功能. 3.单点触摸和多点触摸,并且能够实现滑动效果,滑动的话必须使用带有bool返回值的单点触 ...

  4. 循环json数据的列

    var len = json.length;  for (var i = 0; i < len; i++)  {   for (obj in json[i])   {    var obj2 = ...

  5. boost.asio系列——socket编程

    asio的主要用途还是用于socket编程,本文就以一个tcp的daytimer服务为例简单的演示一下如何实现同步和异步的tcp socket编程. 客户端 客户端的代码如下: #include &l ...

  6. 4.Swift教程翻译系列——Swift基本运算符

    英文版PDF下载地址http://download.csdn.net/detail/tsingheng/7480427 运算符是指一个特殊的符号,能够用来查看.更改值或者相加.比方说加法运算符+能够讲 ...

  7. UVa11183 Teen Girl Squad, 最小树形图,朱刘算法

    Teen Girl Squad  Input: Standard Input Output: Standard Output You are part of a group of n teenage ...

  8. AS3开发必须掌握的内容

    1.事件机制 2.显示列表 3.垃圾回收 4.常用方法 5.网络通信 6.位图动画 7.渲染机制 8.API结构 9.沙箱机制 10.资源管理 11.内存管理 12.性能优化 13.资源选择 14.安 ...

  9. EditTex属性

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tool ...

  10. linux下 文件IO 相关

    linux下操作文件或设备,需要一个文件描述符 file descriptor,fd 来引用.fd是一个非负整数,实际上是一个索引值,指向文件的记录表,对文件的操作都需要fd.默认的几个:标准输入流 ...