Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 阿帕奇唐';t加载所有虚拟主机_Apache_Ubuntu_Ubuntu 14.04_Virtualhost_Restart - Fatal编程技术网

Apache 阿帕奇唐';t加载所有虚拟主机

Apache 阿帕奇唐';t加载所有虚拟主机,apache,ubuntu,ubuntu-14.04,virtualhost,restart,Apache,Ubuntu,Ubuntu 14.04,Virtualhost,Restart,我对ubuntu服务器上的apache和virutalhosts有问题。 我的机器上安装的软件是: Ubuntu 14.04.3 LTS Apache 2.4.7 virtualhost在/etc/apache2/sites available/目录中配置,我有4个文件: 000-default.conf default-ssl.conf 我制作了以下文件: site-one.example.com.conf site-two.example.com.conf 唯一的区别是子域和域的

我对ubuntu服务器上的apache和virutalhosts有问题。 我的机器上安装的软件是:

  • Ubuntu 14.04.3 LTS
  • Apache 2.4.7
virtualhost在/etc/apache2/sites available/目录中配置,我有4个文件:

  • 000-default.conf
  • default-ssl.conf
我制作了以下文件:

  • site-one.example.com.conf
  • site-two.example.com.conf
唯一的区别是子域和域的名称,因此,两个文件的配置为:

site-one.example.com.conf:

<VirtualHost *:9292>
    ServerName site-one.example.com:9292
    ServerAlias www.site-one.example.com:9292
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/prod/
    alias /a /var/www/prod/a
    alias /a-test /var/www/test/a
    alias /f /var/www/prod/f
    alias /p /var/www/prod/p
    alias /p-test /var/www/test/p
    alias /t /var/www/prod/t
    alias /w /var/www/prod/www/w
    alias /t-test /var/www/test/t/  

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

ServerName site one.example.com:9292
ServerAlias www.site-one.example.com:9292
服务器管理员webmaster@localhost
DocumentRoot/var/www/prod/
别名/a/var/www/prod/a
别名/a-test/var/www/test/a
别名/f/var/www/prod/f
别名/p/var/www/prod/p
别名/p-test/var/www/test/p
别名/t/var/www/prod/t
别名/w/var/www/prod/www/w
别名/t-test/var/www/test/t/
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
site-two.example.com.conf

<VirtualHost *:9292>
    ServerName site-two.example.com:9292
    ServerAlias www.site-two.example.com:9292
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/prod/
    alias /s /var/www/prod/www
    alias /s-test /var/www/test/www/

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

ServerName站点2.example.com:9292
ServerAlias www.site-two.example.com:9292
服务器管理员webmaster@localhost
DocumentRoot/var/www/prod/
别名/s/var/www/prod/www
别名/s-test/var/www/test/www/
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
问题是,当我尝试加载url“site one.example.com/a”时,服务器没有找到文件,但“site two.example.com/s”的url工作正常,我一直在尝试重新启动Apache(sudo service apache2 restart或reload或stop/start),但当我加载该url时,site-one.example.com工作正常,而另一个停止工作,并说“在此服务器上找不到请求的URL/a。”


?如何找到有关virutalhost的日志文件?

我发现了问题,服务器首先读取了000-default.conf文件的配置,因此我对所有行都进行了注释,重新启动了apache,工作正常


但是,我想知道,为什么有时候apache会使用一个*.conf文件或其他文件?

我发现了问题,服务器首先读取了000-default.conf文件的配置,所以我对所有行进行了注释,重新启动了apache,工作正常

然而,我想知道,为什么有时候apache会使用一个*.conf文件或其他文件