centos 安装LAMP

来源:互联网 发布:中国品牌最贵的域名 编辑:程序博客网 时间:2024/06/01 07:45

1,执行命令

yum -y install httpd mysql mysql-server php php-mysql postgresql postgresql-server php-postgresql php-pgsql php-devel

2,启动apache服务并查看时候启动成功

命令如下:(切记用root用户启动服务)

启动:/etc/rc.d/init.d/httpd start

如果报错:

Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName

修改配置文件:

修改/etc/httpd/conf/httpd.conf 配置,去掉ServerName 前的#(或者手动添加ServerName localhost:80)然后重启httpd服务

检测启动结果:ps aux | grep httpd



现在直接在浏览器键入http://localhost  或 http://本机IP  ,应该会看到Apache的测试页面

这里需要注意iptables的设置哦。




如果打不开测试画面,很可能是防火墙导致的,关闭防火墙即可

/etc/init.d/iptables stop



原创粉丝点击