欢迎。我阅读了很多像我这样类似问题的帖子,但最后没有任何帮助。
我正在尝试为我在本地工作的网站设置虚拟主机。
接下来,我将此行添加到/etc/httpd/conf/httpd.conf
Include conf/httpd-vhosts.conf
现在配置/etc/httpd/conf/httpd-vhosts.conf如下:
NameVirtualHost *
<VirtualHost *:80>
DocumentRoot /home/pfl/sites/bonnielassie
ServerName bonnie.lo
<Directory /home/pfl/sites/bonnielassie>
AllowOverride none
Order allow,deny
allow from all
</Directory>
CustomLog /var/log/bonnie.lo combined
ErrorLog /var/log/bonnie.lo.log
</VirtualHost>
继续编辑/ etc / hosts文件:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 bonnie.lo
权限我这样设置:
chown -R apache:apache /home/pfl
chmod -R 755 /home/pfl
chown -R /var/www
chmod -R 755 /var/www
如果我检查日志文件/var/log/bonnie.lo.log,它会告诉我:
AH01630: client denied by server configuration: /home/pfl/sites/bonnielassie/bonnie.lo
如果我尝试使用webbrowser打开网站,它会告诉我:
禁 您无权访问此服务器上的/bonnie.lo。
如果我运行sestatus,它会回复:
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 30
答案 0 :(得分:0)
<Directory "/home/pfl/sites/bonnielassie">
restorecon -Frv /home/pfl/sites
setsebool -P httpd_can_network_connect 1