阿帕奇升级到Ubuntu 13.10后不使用的DocumentRoot(使用默认的页面,上面写着"!它的工作原理") [英] Apache doesn't use DocumentRoot after upgrading to Ubuntu 13.10 (Uses default page that says "It works!")

查看:135
本文介绍了阿帕奇升级到Ubuntu 13.10后不使用的DocumentRoot(使用默认的页面,上面写着"!它的工作原理")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有不同的虚拟主机为我的网站开发工作,其中包括
CNM。在

 站点可用/ CNM

我的文件说得很干脆:

 <虚拟主机*:80>
    服务器名CNM
    的DocumentRoot的/ var / WWW / CNM /的public_html
< /虚拟主机>

我升级到Ubuntu 13.10,当我指出我的浏览器CNM /,我看到了
在默认的文件中表示,似乎/var/www/index.html文件

 站点可用/ 000-default.conf

它说(除其他事项外):

 <虚拟主机*:80>
    的DocumentRoot的/ var / WWW

什么我需要做的就是Apache的阅读我CNM的文档根目录,当我浏览到CNM /?

注:


  1. 我已经尝试过重新命名我的网站可用/ CNM文件到网站可用/ cnm.conf和 a2ensite CNM 使其和服务的Apache2重装。这是一件好事,但它改变不了什么。


  2. 我已经试图改变<虚拟主机*:80> <虚拟主机cnm.localhost> <虚拟主机CNM> 。那什么也没做。



解决方案

我找到了答案,我的问题。我需要删除的文件在/ etc / apache2的/网站启用。


  1. 删除在/ etc / apache2的/文件的网站启用-

  2. 重命名的配置文件在/ etc / apache2的/网站,提供给有以.conf结尾

  3. 对于网站,提供的每个文件,运行须藤a2ensite的mysite

  4. 运行须藤服务的Apache2重装

I have various virtual hosts for my web development work, including cnm. The

sites-available/cnm

my file says very simply:

<VirtualHost *:80>
    ServerName cnm
    DocumentRoot /var/www/cnm/public_html
</VirtualHost>

I upgraded to Ubuntu 13.10, and when I point my browser to cnm/, I see the /var/www/index.html file that seems to be indicated in the default file

sites-available/000-default.conf

which says (among other things):

<VirtualHost *:80>
    DocumentRoot /var/www

What do I need to do to get Apache to read my cnm document root when I browse to cnm/ ?

NOTES:

  1. I already tried renaming my sites-available/cnm file to sites-available/cnm.conf and enabling it with a2ensite cnm and service apache2 reload. That is a good thing, but it changes nothing.

  2. I already tried changing <VirtualHost *:80> to <VirtualHost cnm.localhost> or to <VirtualHost cnm>. That did nothing.

解决方案

I found the answer to my issue. I needed to delete the files in /etc/apache2/sites-enabled.

  1. Delete files in /etc/apache2/sites-enabled
  2. Rename config files in /etc/apache2/sites-available to have a .conf ending
  3. For each file in sites-available, run sudo a2ensite mysite.
  4. Run sudo service apache2 reload

这篇关于阿帕奇升级到Ubuntu 13.10后不使用的DocumentRoot(使用默认的页面,上面写着&QUOT;!它的工作原理&QUOT;)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆