【问题标题】:Set virtual directory as root in apache在apache中将虚拟目录设置为root
【发布时间】:2012-08-04 03:29:22
【问题描述】:
在我的 linux 服务器中,我的 apache 服务器的 www 根目录是 /var/www/html,我在上述路径中有一个名为 blog 的文件夹。我必须通过指定http://myDomain/blog/ 来访问博客文件夹中的网站。我的问题是我希望能够通过在浏览器中指定http://myDomain 来访问该网站(无需将博客文件夹的内容移动到 www 根目录)。是否可以在配置文件中设置任何参数以实现上述目标。
谢谢。
【问题讨论】:
标签:
linux
wordpress
apache
【解决方案1】:
编辑 /etc/httpd/conf/httpd.conf 文件并搜索 DocumentRoot 并更改为
/var/www/html
到
/var/www/html/blog
【解决方案2】:
在您的 Apache httpd.conf 文件中,只需将 DocumentRoot 设置为 /var/www/html/blog。