前辈和我说,刚开始一个个服务慢慢安装,以后要写自动安装脚步,不断学习!

仿他人改了一个脚本,按照自己的习惯,呵呵

#!/bin/bash

#version:2011-9-16

#create by roc

#dis: this is used to auto install lamp.

#rocbg

lamp_down=/usr/local/src/tarbag

lamp_tar=/usr/local/src/software

lamp_log=/tmp/lamp_install.log

echo "####################`date` #################" >> $lamp_log

ip=`ifconfig eth0 | grep Bcast | awk -F ":" '{print $2}' | cut -d " " -f 1`

echo ip:$ip >> $lamp_log

if [ ! -d /usr/local/src/tarbag ];then

mkdir /usr/local/src/tarbag

fi

#download lamp packet

wget http://labs.renren.com/apache-mirror//httpd/httpd-2.2.21.tar.gz -P $lamp_down

wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.6.tar.gz -P $lamp_down

wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz  -P $lamp_down

wget http://ijg.org/files/jpegsrc.v8c.tar.gz -P $lamp_down

wget http://sourceforge.net/projects/libpng/files/libpng15/1.5.4/libpng-1.5.4.tar.gz/download -P $lamp_down

wget http://blog.s135.com/soft/linux/nginx_php/mysql/mysql-5.5.3-m3.tar.gz -P $lamp_down

wget http://cn2.php.net/distributions/php-5.3.8.tar.bz2 -P $lamp_down

if [ ! -d /usr/local/src/software ];then

mkdir /usr/local/src/software

fi

#uncompress file

cd   $lamp_down

for i in $lamp_down/*.tar.gz

do

tar -xzvf $i -C $lamp_tar

done

for i in $lamp_down/*.tar.bz2

do

tar -xjvf $i -C $lamp_tar

done

#Apache install

echo "Apache install start!" >>$lamp_log

cd $lamp_tar/httpd-2.2.21/

./configure --prefix=/usr/local/apache2 --enable-so  \

--enable-rewrite --enable-vhost-alias --enable-http \

--enable-static-htpasswd

sleep 10

make && make install

sleep 8

ln  -s /usr/local/apache2/bin/apachectl /bin/apachectl

#modity ServerName DirectoryIndex options

sed -i '292c\ServerName $ip:80' /usr/local/apache2/conf/httpd.conf

sed -i '394c\DirectoryIndex index.php index.html index.html.var' /usr/local/apache2/conf/httpd.conf

#test apache configure

/bin/apachectl -t >> $lamp_log

echo "`date` Apache is Installed"  >> $lamp_log

#sed -i '6c\SELINUX=disabled' /etc/selinux/config

/bin/apachectl start && echo "`date` Apache is started Good!" >> $lamp_log

echo "`date` Please modify httpd.conf ServerName Option" >> $lamp_log

#Freetype Install

echo "`date` Freetype install start" >> $lamp_log

cd $lamp_tar/freetype-2.4.6/

./configure --prefix=/usr/local/freetype

make && make install

sleep 5

echo "`date` Freetype is  installed" >> $lamp_log

sleep 10

#JPEG install

echo "`date` jpeg install start" >> $lamp_log

cd $lamp_tar/jpeg-8

./configure --prefix=/usr/local/jpeg7

make && make install

echo "`date` jpeg is installed" >> $lamp_log

sleep 8

#libpng Install

echo "`date` libpng  install start" >> $lamp_log

cd $lamp_tar/libpng-1.5.4

./configure --prefix=/usr/local/libpng

make && make install

echo "`date`libpng is installed" >> $lamp_log

sleep 10

#gd install

echo "`date`gd start install"

cd $lamp_tar/gd-2.0.33

./configure --prefix=/usr/local/gd \

--with-png=/usr/local/libpng --with-freetype=/usr/local/freetype \

--with-jpeg=/usr/local/jpeg7

#modify gd_png.c

sed -i '/png.h/d' gd_png.c

sed -i '15c\#include "/usr/local/libpng/include/png.h" ' gd_png.c

make && make install

echo "`date` gd is installed" >> $lamp_log

#Mysql Install

useradd mysql  && echo "`date` user mysql added" >> $lamp_log

cd $lamp_tar/mysql-5.5.3-m3

./configure

--prefix=/usr/local/mysql  --datadir=/mydata --with-charset=utf8

--with-extra-charsets=complex --enable-thread-safe-client

--with-big-tables --with-ssl --with-embedded-server

--enable-local-infile --enable-assembler --with-plugins=innobase

--with-plugins=partition

make && make install

echo "`date` mysql is installed " >> $lamp_log

#about configure file

cp $lamp_tar/mysql-5.5.3-m3

cp support-files/my-large.cnf /etc/my.cnf

chown -R mysql.mysql /usr/local/mysql

#pre databases

/usr/local/mysql/bin/mysql_install_db --user=mysql

#service file

cp $lamp_tar/mysql-5.5.3-m3/support-files/mysql.server /etc/init.d/mysql

chmod 755 /etc/init.d/mysql

#start mysql

/etc/init.d/mysql start  && echo "`date` mysql service is ready" >> $lamp_log

#PHP install

echo "`date` php-5.3.8 start install " >> $lamp_log

cd $lamp_tar/php-5.3.8

./configure

--prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs

--with-jpeg-dir=/usr/local/jpeg7/ --with-gd=/usr/local/gd/

--with-png-dir=/usr/local/libpng/

--with-freetype-dir=/usr/local/freetype/ --enable-mbregex

--with-mysql=/usr/local/mysql/ --with-pdo-mysql=/usr/local/mysql/

make && make install

#copy file and write to log

cp $lamp_tar/php-5.3.8/php.ini-recommended /usr/local/php5/lib/php.ini && \

echo "`date` php.ini file is copyed to /usr/local/php5/lib/" >> $lamp_log

echo "application/x-httpd-php  php" >> /usr/local/apache2/conf/mime.types

#edit test.php

touch $htdocs/test.php

cat >> $htdocs/test.php << CHENG

phpinfo();

?>

echo "Go to http://$ip/test.php" >> $lamp_log

echo "Mysql port 3306 and socket_file is  /tmp/mysql.socket" >> $lamp_log

echo " user=root  paswd=null" >> $lamp_log

echo "##########end################" >> $lamp_log

cat /usr/local/apache2/build/config.nice >> $lamp_log

/usr/local/php/bin/php -i |grep configure >> $lamp_log

cat /usr/local/mysql/bin/mysqlbug|grep configure >> $lamp_log

阅读(4793) | 评论(0) | 转发(5) |

lamp配置python_LAMP自动化安装脚本相关推荐

  1. LAMPLNMP自动化安装脚本

    LAMP&LNMP自动化安装脚本 =================================== 一.脚本的环境介绍 二.脚本的介绍 三.脚本的功能介绍 =============== ...

  2. 手把手教学Linux下oracle11g自动化安装脚本编写

    手把手教学Linux下oracle11g自动化安装脚本编写 产品:Oracle 版本:11.2.0.4 环境:Centos7 文章目录 手把手教学Linux下oracle11g自动化安装脚本编写 0. ...

  3. ubuntu mysql自动补全_mysql自动化安装脚本(ubuntu and centos64)

    Ubuntu Mysql自动化安装脚本 #/bin/bash function hasDpkg { r=`dpkg -l | grep "$1"` if [ -n "$r ...

  4. Hadoop自动化安装脚本

    参考资料和说明 参考资料: hadoop-2.3.0详细安装过程 码云GIT: hadoop-2.4.0家族自动化安装脚本 >>> 获取邀请码 版本信息: hadoop-2.4.0- ...

  5. 配置suse自动化安装

    配置suse自动化安装 作者:尹正杰   版权声明:原创作品,谢绝转载!否则将追究法律责任.       前言:不知道你习惯用那款虚拟器,我用的是VMware Workstation,别问我为什么,因 ...

  6. MySQL自动化安装脚本-python版

    MySQL 自动化安装脚本 脚本介绍 用python写的一个自动化安装mysql单机实例的脚本 适用于mysql5.7版本 MySQL安装包路径: /usr/local/mysql #需要把mysql ...

  7. lamp配置python_LAMP搭建笔记

    LAMP简介 LAMP指的Linux(操作系统).ApacheHTTP 服务器,MySQL(有时也指MariaDB,数据库软件) 和PHP(有时也是指Perl或Python) 的第一个字母.LAMP便 ...

  8. ansible配置zabbix自动化安装和配置

    安装 推荐yum安装 RHEL(CentOS)5版本: rpm -Uvh http://mirror.pnl.gov/epel/5/i386/epel-release-5-4.noarch.rpm R ...

  9. EPICS -- base的自动化安装脚本

    工作中需要经常安装EPICS base(下载地址:EPICS Base Downloads), 反复安装是一个重复劳动的过程.以下脚本是实现了EPICS base自动安装 ,适用基于Redhat的Li ...

最新文章

  1. 3721.com重见天日
  2. TCP的3次握手和4次挥手过程
  3. python linux log,linux,python 常用的处理log的命令
  4. Java 处理表格,也很轻松
  5. 10 条真心有趣的 Linux 命令
  6. linux怎么查看数据库性能,正确评估SQL数据库性能,你必须知道的原理和方法!...
  7. .NET截取指定长度汉字超出部分以...代替
  8. eclipse新建maven报错
  9. centos安装桌面和远程连接
  10. Eclipse中Errors occurred during the build最简单的解决方法
  11. php执行另一个页面,从另一个PHP脚本执行PHP脚本
  12. linux 5.5 外接usb2.0硬盘,RHEL5 使用pam_usb
  13. svnant-不可映射字符编码
  14. 深度学习与硬件GPU,软件框架关系及相关概念解析
  15. 你知道哪些苹果自家应用采用 Swift 语言编写吗?
  16. dnf连不上服务器删什么文件,DNF:4.9更新“无法上游戏”,删1个文件才可登录,策划不争气!...
  17. bcprov-jdk15on 简介、中文文档、中英对照文档 下载
  18. [转]ZBrush3官方中文教程 一
  19. 2015.05.05,外语,读书笔记-《Word Power Made Easy》 15 “如何谈论事情进展” SESSION 42...
  20. 超级计算机的性能指标

热门文章

  1. C++——虚函数(Virtual Member Functions) 【functions语意学】
  2. 独家揭秘!阿里大规模数据中心的性能分析
  3. k8s的imagePullSecrets如何生成及使用
  4. BIOS英文报错详解;你虽会做系统,但你会看BIOS英文报错吗,仅供大家参考学习。...
  5. MyEclipse内安装与使用SVN
  6. Powershell管理系列(二十八)PowerShell操作之修改AD账号密码
  7. mybatis-spring从1.1升级到1.2所带来的dao层级的编写问题
  8. sql 多行转成一行
  9. 打造一个TB级微服务日志监控平台
  10. 有大佬通过研发这款Chrome插件的使用教程,赚了上百万! 网友:互联网的钱太好赚了~...