linux LNMP自动安装脚本
#!/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自动安装脚本的更多相关文章
- 树莓派进阶之路 (035) - 基于linux的zsh安装脚本
基于linux的zsh安装脚本: Ubuntu版本: #!/bin/sh cd #安装zsh sudo apt-get install zsh #查看zsh cat /etc/shells #更改zs ...
- python3自动安装脚本,python3.x与python2.x共存
1.前言: python3过程中,通过搜索一些文章参考安装过程发现比较麻烦,而且还出现一些不可预期的报错.python3环境需要升级openssl,所以为了部署到其他环境更方便,写自动安装脚本方式,且 ...
- mysql 自动备份和nginx自动安装脚本
一.自动备份Mysql脚本: 如下脚本为mysql自动备份脚本,仅供参考,可以根据实际情况修改. #!/bin/sh #auto backup mysql #wugk #Define PATH定义变量 ...
- linux kickstart 自动安装
最近很多业务系统都是linux lnmp平台安装,反复的安装让人觉得很苦恼,仔细钻研了下kickstart .这里环境是red hat linux 5.8 32位,系统盘中的软件包里包含有kickst ...
- Windows ftp脚本和RSCD agent自动安装脚本
Windows ftp脚本 和bladelogic RSCD Agent自动安装脚本 比较简单的命令是msiexec /I "C:\RSCD85-SP1-WIN64.msi" /Q ...
- python第三方库自动安装脚本
#python第三方库自动安装脚本,需要在cmd中运行此脚本#BatchInstall.pyimport oslibs = {"numpy","matplotlib&qu ...
- LAMP自动安装脚本
#!/bin/bash # 功能描述:LAMP自动安装脚本 # 初始化 if [ "$(cat /etc/system-release | awk '{print $(NF-1)}' | a ...
- LNMP 一键安装脚本
这个脚本是使用shell编写,为了快速在生产环境上部署lnmp/lamp/lnmpa(Linux.Nginx/Tengine/OpenResty.MySQL/MariaDB/Percona.PHP), ...
- 自动安装脚本-------------基于LVMP搭建Nagios 监控
Mysql初始化参数(mysql-5.6.31) /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local ...
随机推荐
- MyBatis深入理解一
Mybatis 本是apache的一个开源项目iBatis, 2010年这个项目由apache software foundation 迁移到了google code,并且改名为MyBatis .iB ...
- 基于visual Studio2013解决面试题之0710求方优化
题目
- TCP/IP协议的编写《转载》
基于HHARM9-EDU的TCP/IP(UDP)协议的实现 原文网址:http://blog.csdn.net/lhj0503/article/details/3323788 摘 要:嵌入式技术的发展 ...
- 实现StatusBar的Flat风格
效果见右图,OfficeXP里就是这样的风格,其实实现很简单,不必专门在网上找别人控件. 把StatusBar的SimplePanel设为False,点击Panels添加StatusPanel,把所有 ...
- InitInheritedComponent的执行过程
这{$R *.dfm}是一个编译指令,它只是用来告诉IDE,在编译的时候,把 *.dfm文件编到 exe文件资源里面,它本身没有编译进Exe里面. 因为TCustomForm是继承而来,所以调用TRe ...
- sqlserver存储过程学习笔记(一)基础知识篇(全)
说出来有点丢人,做sqlserver应用系统近一年,竟然没有使用过存储过程,现在就好好的梳理一下对应知识,慢慢让其加入到我的项目中去吧. 存储过程的优点:1.运行效率高,提供了在服务器端快速执行sql ...
- cocos2d-x游戏开发系列教程-搭建cocos2d-x的windows开发环境
1.在上一篇中我们成功运行了HelloCpp和TestCpp工程,我们到目录cocos2d-x-2.2.1\Debug.win32下 查看生成的文件,在我电脑上绝对路径是H:\source\cocos ...
- NET Platform Standard
NET Platform Standard 相关博文:ASP.NET 5 Target framework dnx451 and dnxcore50 .NET Platform Standard:ht ...
- Qml 写的弹出层控件(13篇博客)
QML弹出窗口组件,灯箱效果.动画效果,可拖拽 核心思路:一个mask层,一个最顶层,都用rectangle,禁止事件穿透 使用 Popup { id: popup width: 200; heigh ...
- form表单多值提交
$.ajax({ cache: true, type: "POST", url:ajaxCallUrl, data:$('#yourformid').serialize(),// ...