環境搭建-Apache的安裝(Linux)

命令查看是否已經安裝了apache服務器httpdlinux

rpm -qa | grep httpdapache

查看httpd服務是否啓動vim

ps -ef | grep httpd服務器

卸載httpd服務tcp

yum remove httpdspa

安裝httpd服務3d

yum install httpd -ycode

查看是否安裝成功blog

yum list installed | grep httpdip

 查看配置文件

啓動httpd服務

service httpd start

主機沒法訪問apache解決方法

多是Linux內置防火牆的限制,須要將tcp端口配置爲容許任何ip訪問

iptables -I INPUT -p TCP --dport 80 -j ACCEPT

這種方法是臨時生效的,須要設置/etc/selinux/config中SELINUX的值

vim /etc/selinux/config

註釋掉#SELINUX=enforcing,增長SELINUX=disabled

保存退出,並更改用戶運行級別

chkconfig --level 3 iptables off

chkconfig --level 5 iptables off

 輸入ip加端口號就能訪問到apache默認頁面

 

輸入ip加端口號就能訪問到apache默認頁面

相關文章
相關標籤/搜索