1

我对安装在 /var/www/html 中的 Openproject、Apache 和其他应用程序有疑问。

当我尝试连接到 /var/www/html 甚至 index.html 中的任何应用程序时,它不起作用,因为看起来 Openproject conf 文件正在将流量“重定向”到另一个文件夹(我猜是 openproject 文件夹)。

这是我的 Openproject.conf

Include /etc/openproject/addons/apache2/includes/server/*.conf

<VirtualHost *:80>
  ServerName tools.mydomain.com
  DocumentRoot /opt/openproject/public

  ProxyRequests off

  Include /etc/openproject/addons/apache2/includes/vhost/*.conf

  # Can't use Location block since it would overshadow all the other proxypass directives on CentOS
  ProxyPass /openproject/ http://127.0.0.1:6000/openproject/ retry=0
  ProxyPassReverse /openproject/ http://127.0.0.1:6000/openproject/
</VirtualHost>

这是我的 000-default.conf 的内容:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

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

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

当我将 openproject.conf 中的 ServerName 更改为 tools.mydomain.com 以外的任何其他内容时,我可以访问 /var/www/html 中的应用程序,但我无法弄清楚这是如何工作的......我不明白apache的工作方式是这样的..

谢谢你的帮助。

4

4 回答 4

1

这是旧线程,但我遇到了同样的问题,截至我安装 OpenProject 时,所有其他 VHOST 都停止工作。如果我禁用 OP,那么其余的都可以正常工作。
我通过将 OP ServerName 更改为 op-dev 并将端口从 *:80 更改为 *:81 来修复它,其中一个重要的地方也应该这样做是在文件中:

/etc/openproject/addons/apache2/includes/server/20_repoman_svn_vhost.conf

在这里您还应该更改:
"VirtualHost 127.0.0.1:80" 为"VirtualHost *:80"并且
ServerName 可以保持localhost

现在,所有 VHOST 都可以正常工作。

于 2019-01-08T16:13:19.227 回答
0

小心使用端口 80,因为对于大多数应用程序来说这很常见。首先,尝试重新加载 apache。

sudo service apache2 reload

接下来,如果这给出错误,请查看输出。

sudo journalctl -xe

如果一切正常,请注册网站

sudo a2ensite openproject

再次重新加载 apache 并将以下行添加到 /etc/hosts 文件中

127.0.1.1 tools.mydomain.com

然后,尝试进入http://tools.mydomain.com:[port]

于 2016-10-24T19:12:10.190 回答
0

您需要做的就是修复该字符串:

 DocumentRoot /opt/openproject/public

指向你的根 /var/www/html/

于 2019-07-19T18:14:24.447 回答
-1

我遇到过同样的问题。如果没有虚拟主机配置的 ServerName 与客户端请求标头匹配,则将提供 apache2 配置中的第一个虚拟主机。这是默认虚拟主机,因为文件名以 000 开头。如果 openproject 的虚拟主机配置中的 ServerName 与客户端请求标头匹配,则将不再提供默认虚拟主机。

于 2019-07-17T16:31:06.127 回答