#!/bin/bash

#在docker centos:6安装lamp脚本

#renphp  20160706

#一安装更改yum源

yum install -y wget

yum install -y epel-release.noarch

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

yum clean all

yum makecache

yum update -y

#二安装httpd

yum install httpd -y

sed -i 's/#ServerName www.example.com:80/ServerName www.example.com:80/' /etc/httpd/conf/httpd.conf

chkconfig --level 3 httpd on

/etc/init.d/httpd start

#三安装mysql

yum install mysql mysql-server -y

chkconfig --level 3 mysqld on

cp /usr/share/mysql/my-medium.cnf /etc/my.cnf

/etc/init.d/mysqld start

/usr/bin/mysqladmin -u root password 'root'

mysql -uroot -proot -e "delete from mysql.user where user='' or password='';"

mysql -uroot -proot -e "drop database test;"

history -c

/etc/init.d/mysqld restart

#四安装php

yum install -y php php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath mhash-devel libmcrypt

#五配置LAMP

sed -i "s/erverTokens OS/erverTokens Prod/g" /etc/httpd/conf/httpd.conf

sed -i "s/ServerSignature On/ServerSignature Off/g" /etc/httpd/conf/httpd.conf

sed -i "s/Options Indexes FollowSymLinks/Options Includes ExecCGI FollowSymLinks/g" /etc/httpd/conf/httpd.conf

sed -i "s/DirectoryIndex index.html index.html.var/DirectoryIndex index.php index.html index.htm/g" /etc/httpd/conf/httpd.conf

sed -i "s/KeepAlive Off/KeepAlive On/g" /etc/httpd/conf/httpd.conf

sed -i "s/MaxKeepAliveRequests 100/MaxKeepAliveRequests 1000/g" /etc/httpd/conf/httpd.conf

rm -f /etc/httpd/conf.d/welcome.conf /var/www/error/noindex.html

sed -i "s/;date.timezone =/date.timezone = PRC/" /etc/php.ini

sed -i "s/expose_php = On/expose_php = Off/" /etc/php.ini

sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php.ini

sed -i "s/disable_functions =/disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space,posix_ctermid,posix_get_last_error,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname/" /etc/php.ini

echo -e "<?php\nphpinfo();" > /var/www/html/index.php

/etc/init.d/mysqld restart

/etc/init.d/httpd restart

#原文链接:http://my.oschina.net/phpecshop/blog/701728

转载于:https://my.oschina.net/phpecshop/blog/707473

在docker centos 6.8安装lamp脚本相关推荐

  1. CentOS 6.X安装LAMP最高版本环境

    #------------CentOS 6.X安装LAMP最高版本环境------------------ #! /bin/sh#安装Apache yum install httpd -y #1.关闭 ...

  2. Centos Denyhosts 一键安装配置脚本

    Centos Denyhosts 一键安装配置脚本 一键安装denyhosts脚本并配置为常用配置.放置Linux服务器被暴力破解 由于不能上传tar文件.所以改为zip压缩. 将附件的zip压缩包解 ...

  3. centos 7 YUM 安装LAMP 环境

    centos 7 YUM 安装LAMP 环境 两种安装方式: 使用163yum源,或阿里的yum源,或者搭建本地yum源 由于centos 7自带的yum 源是国外的,国内无法访问, 搭建使用 163 ...

  4. Linux安装lamp脚本,CentOS LAMP一键安装脚本

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

  5. Centos 7编译安装 LAMP 环境

    前言 LAMP 是指一组通常一起使用来运行动态网站或者服务器的自由软件名称首字母缩写 L:Linux 操作系统 A:Apache(httpd) 网页服务 M:MySQL(mariadb) 数据库服务 ...

  6. centos下一键安装lamp环境,快捷,方便

    http://www.centos.bz/lamp/ 适用环境: 系统支持:CentOS-5 (32bit/64bit).CentOS-6 (32bit/64bit) 内存要求:≥256M 安装了什么 ...

  7. centos 6.5 安装 lamp 后mysql不能启动_CentOS 6.5 系统 LAMP(Apache+MySQL+PHP)安装步骤

    先来解释一下,什么是 LAMP.正如标题所言,LAMP 实际上就是 Linux.Apache.MySQL.PHP 四个名称的缩写,当然最后一个 "P" 还有其他说法是 Perl 或 ...

  8. 一键安装LAMP脚本

    一键安装LAMP架构 #!/bin/bash #auto install LAMP #by 2017-10-11 #auto lijunmin#Httpd define path variable(定 ...

  9. centos 6.5 安装 lamp 后mysql不能启动_CentOS 6.5系统安装配置LAMP(Apache+PHP5+MySQL)服务器环境...

    CentOS6.5系统安装配置LAMP(Apache+PHP5+MySQL)服务器环境 准备篇: 1.配置防火墙,开启80端口.3306端口 vi /etc/sysconfig/iptables -A ...

最新文章

  1. 《 自动化测试最佳实践:来自全球的经典自动化测试案例解析》一一2.4 开发内部测试工具...
  2. 在python中等号前面与后面分别是什么意思-Python中冒号等于(:=)是什么意思?...
  3. 不带参数的SQL语句执行方法
  4. VIM配置(不用这么麻烦了,文章尾部附带他人写得脚本安装)
  5. GridSearchCV和RandomizedSearchCV(以SVM为例)
  6. mysql key value 引擎_mysql集成的key-value引擎-个人翻译
  7. 深入理解C# 3.x的新特性(2):Extension Method[下篇]
  8. OpenVDB:梦工厂的有效存储和处理离散在三维网格上的稀疏体积数据C++库
  9. MATLAB中 histogram 和 imhist 的区别
  10. twitteR Unauthorized
  11. 项目实战 - 使用Fiddler抓取bilibili安卓客户端口数据并分析(http、https)
  12. 中科大少年班,阿里云首席科学家闵万里离职,发内部信告别!
  13. 随身WIFI刷机记录 UF1003
  14. liunx下设置自动完成任务(每周六晚一点整,系统自动把/home目录文件下到所有文件做一个备份,备份到/var/backups/home.tar.gz))
  15. [MAC各类右键菜单修改]Automator WorkFlow: 扩展右键菜单
  16. 深度学习矩阵乘法的终极奥义einsum,结合多个计算框架上的使用
  17. 【木棍问题——回溯与分支限界算法(使用C语言解决)】
  18. 什么才是最好的语言?
  19. ReactNative实现地图导航
  20. 使用scrapy做爬虫遇到的一些坑:网站常用的反爬虫策略,如何机智的躲过反爬虫Crawled (403)

热门文章

  1. oracle 查询变换器,甲骨文转换器在线转换 v1.0 官方版​
  2. Android:闹钟提醒结合通知(alarm+notification)
  3. CSS3 新年动画贺卡 电子贺卡动画效果-html5特效
  4. 开店须知!2015年淘宝搜索重点优化
  5. 【数据收集】名义变量、序级变量、区间变量、比率变量的理解及例子
  6. matlab——逻辑运算符——与、或、非
  7. 上新了!九州云发布新一代混合云管理平台
  8. Angular2+PrimeNG+Form表单
  9. 滚动到后,如何使div停留在屏幕顶部?
  10. Python | 根据指定文件生成词云图