[英]Apache Web Server Virtual host not Working
I am trying to view logs directory on ui for Apache Web server. 我正在尝试在ui上查看Apache Web服务器的日志目录。
So i am trying to establish a new virtual host in httpd-vhosts.conf file and trying to give the document root to the logs folder. 因此,我试图在httpd-vhosts.conf文件中建立一个新的虚拟主机,并尝试将文档根目录提供给logs文件夹。
<VirtualHost *:8083>
ServerAdmin tecmint@example.com
DocumentRoot C:/Program Files/Apache Software Foundation/Apache2.2/logs
ServerName localhost
ErrorLog logs/example.com-error_log
CustomLog logs/example.com-access_log common
</VirtualHost>
Also i have given NameVirtualHost *:8083 and in httpd.conf i have Listen 8083. After restarting the server when i hit localhost:8083 it gives 404. 我也给了NameVirtualHost *:8083,在httpd.conf中我得到了Listen8083。当我按localhost:8083重启服务器后,它给出了404。
Can u please help me i figuring it out. 你能帮我解决这个问题吗?
Thanks 谢谢
Make sure you have added directory block for your docroot and you have at least read permission on it. 确保您已为docroot添加目录块,并且至少对其具有读取权限。
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/logs/">
Require all granted
Options +Indexes
</Directory>
Try with following VirtualHost configuration : 尝试以下VirtualHost配置:
<VirtualHost *:8083>
ServerAdmin tecmint@example.com
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/logs/"
ServerName localhost:8083
<Directory />
Require all granted
Options +Indexes
</Directory>
ErrorLog logs/example.com-error_log
CustomLog logs/example.com-access_log common
</VirtualHost>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.