1.防火牆 FirewallD (外部)
# systemctl stop firewalld.service
# systemctl disable firewalld.service
# firewall-cmd --permanent --add-service=http
success
# firewall-cmd --reload
success
# vi /etc/sysconfig/selinux
#SELINUX=enforcing
SELINUX=disable //關閉SELinux,存檔後重新開機設定值才生效
...
# sestatus
SELinux status: enabled
...
-----------------------------------------------------安裝
# yum install -y httpd httpd-tools
# rpm -qa | grep httpd
httpd-tools-2.4.6-45.el7.centos.4.x86_64
httpd-2.4.6-45.el7.centos.4.x86_64
# systemctl start httpd
# systemctl enable httpd
# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since 五 2017-04-28 13:55:50 CST; 1min 24s ago
--------------------------------------------虛擬目錄
# mkdir /home/test
# vi /home/test/index.html
this is visual DIR
...
# vi /etc/httpd/conf/httpd.conf
...
Alias /test "/home/test"
<Directory "/home/test">
Require all granted
</Directory>
# systemctl restart httpd
# ls -Z /home/test
-rw-r--r--. root root unconfined_u:object_r:httpd_sys_content_t:s0 index.html
# sestatus
SELinux status: enabled
...
沒有留言:
張貼留言