【问题标题】:i have a trouble with apache for ubuntu 14.04我对 ubuntu 14.04 的 apache 有问题
【发布时间】:2014-10-08 00:31:51
【问题描述】:

我已经安装了 apache ubuntu 14.04,所有已经安装在 vps(虚拟专用服务器)下。我的问题是,当我输入我的网址 (www.exemple.com) 网站时,我发现服务器显示var / www 中而不是 home / www 中的索引页面,所以如果有人可以帮助我,请随意我已经是初学者了

【问题讨论】:

    标签: apache ubuntu vps


    【解决方案1】:

    这是正常的,也是意料之中的。

    如果你想改变它,你需要编辑你的 apache 配置文件。大概位于/etc/apache2/apache2.conf

    这是一次很好的学习经历。以上将帮助您开始查找需要更改的文件,您可以从那里搜索其余的文件(您也可以在配置文件中搜索 /var/wwww 以查看它指向那里)。

    【讨论】:

      【解决方案2】:

      '/var/WWW' 是 apache 的默认 DocumentRoot。可以通过以下步骤修改此设置。

      1. 修改“httpd.conf”文件。

        您可以在 /usr/local/httpd/conf/httpd.conf 找到“httpd.conf”。

      在 httpd.conf 中,找到 DocumentRoot 的描述行。那条线看起来

      DocumentRoot ”/var/WWW”
      

      注释掉原来的描述,增加 DocumentRoot 的新描述和 DocumentRoot 的设置信息。以下是该部分的示例。

      #DocumentRoot ”/var/WWW”  # Comment out old description.
      DocumentRoot ”/home/WWW”  # new path of DocumentRoot. (added)
      <Directory “/home/WWW”>   # setup for DocumentRoot directory
        Options None
        AllowOverride None
        Order allow,deny
        Allow from all
      </Directory>
      
      1. 重启 apache 程序。

      通过访问您的站点,您可能会在“/home/WWW/”中看到索引页。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-06-21
        • 2015-04-23
        • 2015-05-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多