码迷,mamicode.com
首页 > 其他好文 > 详细

测试环境LAMP用YUM快速部署。

时间:2015-12-25 06:36:48      阅读:256      评论:0      收藏:0      [点我收藏+]

标签:lamp

#!/bin/bash

#

#测试环境LAMP用YUM快速部署。

##注释##

#LAMP配置文件路径:

#1、/etc/httpd/conf/httpd.conf

#2、/etc/my.cnf

#3、/etc/php.ini

#php网站目录:/var/www/html/


#1、安装LAMP依赖环境

yum -y install gcc gcc-c++ make authconf automake libtool libevent libevent-devel ncurse nucrse-devel gd gd-deevel freetype freetype-devel fontconfig fontconfig-devel libjpeg libjpeg-devel zlib zlib-devel pcre pcre-devel libmcrypt mhash


#2、安装httpd

yum -y install httpd httpd-devel

sed -i ‘276a ServerName localhost:80‘ /etc/httpd/conf/httpd.conf

/etc/init.d/httpd start

chkconfig httpd on


#3、安装mysql

yum -y install mysql mysql-server mysql-devel

/etc/init.d/mysqld start

chkconfig mysqld on

/usr/bin/mysqladmin -uroot password ‘kundylee‘


#4、安装php

yum -y install php*

sed -i ‘402c DirectoryIndex index.html index.html.var index.php‘ /etc/httpd/conf/httpd.conf

/etc/init.d/httpd restart


#5、创建测试php页面

cat >/var/www/html/info.php <<EOF

<?php

phpinfo();

?>

EOF


#6、关闭防火墙

service iptables stop


#7、测试info.php页面

#http://ip/info.php


本文出自 “kundylee” 博客,请务必保留此出处http://kundylee.blog.51cto.com/6605245/1728012

测试环境LAMP用YUM快速部署。

标签:lamp

原文地址:http://kundylee.blog.51cto.com/6605245/1728012

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!