lamp环境搭建

Lamp安装:(linux+apache+mysql+php)

1、 rpm –qa|grep apache/mysql/php  过滤系统中是否存在Apache/mysql/php

2、 yum install httpd                (Linux系统Apache叫httpd,ubantu系统叫Apache2)

yum install mysql-server     (安装服务端可以包括客户端,安装客户端不包括服务端)

yum install php

3、rpm –ql httpd|more      查看安装软件地址

4、根据查看的安装软件地址,得知Apache配置文件路径

 

Vim  /etc/httpd/conf/httpd.conf    查看网站根目录地址/var/www/html

5、cd /var/www/html

Vim test.html

6、ifconfig  查看外网IP

7、浏览器中访问 http://0.0.0.1(例如是您查看的外网IP)/test.html  能访问就表示没有问题,如浏览器中打不开,许查看防火墙iptables是否已开启,无开启就需关闭掉,如还不行,getenforce查看selinux的状态是不是premissive宽松状态,如不是,setenforce 0,之后再尝试在浏览器中进行连接

 

8、cd /var/www/html

Vim test.php

9、ifconfig  查看外网IP

10、浏览器中访问 http://0.0.0.1(例如是您查看的外网IP)/test.php   能访问就表示没有问题,如浏览器中打不开,许查看防火墙iptables是否已开启,无开启就需关闭掉,如还不行,getenforce查看selinux的状态是不是premissive宽松状态,如不是,setenforce 0,之后再尝试在浏览器中进行连接

 

 

posted @ 2018-03-11 16:17  爱不懂事可馨  阅读(98)  评论(0编辑  收藏  举报