【发布时间】:2015-05-27 14:53:58
【问题描述】:
我在 ubuntu 上设置 apache 服务器时遇到问题。
我需要让主域加载一个网站,但一个子域加载一个 tomcat 服务器。 为了实现这一点,我按照这里的说明进行操作:https://sites.google.com/a/ci2s.com.ar/wiki/technics/how-to-run-apache-httpd-and-tomcat-on-port-80-using-mod-proxy
这不起作用,主域和子域都指向同一个文件夹。
我在这里的几个答案中发现我应该包含NameVirtualHost *:80
但是,当我重新启动 apache 服务器时,我收到以下警告:
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/ginl.hodzelmanstechnology.nl.conf:1
谁能帮我解决这个问题?
一些有助于排除故障的输出:
ls /etc/apache2/sites-enabled/
ginl.hodzelmanstechnology.nl.conf kantoor.ginl.hodzelmanstechnology.nl.conf
cat /etc/apache2/sites-available/kantoor.ginl.hodzelmanstechnology.nl.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin 1353691hodzelmans@zuyd.nl
ServerName kantoor.ginl.hodzelmanstechnology.nl/
DocumentRoot /var/www/kantoor.ginl.hodzelmanstechnology.nl/
ErrorLog /var/log/apache2/kantoor.ginl.hodzelmanstechnology.nl-error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/kantoor.ginl.hodzelmanstechnology.nl-access.log combined
ServerSignature Off
# lets indicate the proxy what path do we want
# to forward to tomcat
ProxyPass / http://localhost:8080/
<Directory /var/www/kantoor.ginl.hodzelmanstechnology.nl/>
Options FollowSymLinks
AllowOverride All
Options -MultiViews
</Directory>
</VirtualHost>
cat /etc/apache2/sites-available/ginl.hodzelmanstechnology.nl.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin 1353691hodzelmans@zuyd.nl
ServerName http://ginl.hodzelmanstechnology.nl/
DocumentRoot /var/www/ginl.hodzelmanstechnology.nl/
ErrorLog /var/log/apache2/ginl.hodzelmanstechnology.nl-error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/ginl.hodzelmanstechnology.nl-access.log combined
ServerSignature Off
<Directory /var/www/ginl.hodzelmanstechnology.nl/>
Options FollowSymLinks
AllowOverride All
Options -MultiViews
</Directory>
</VirtualHost>
apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built: Mar 10 2015 13:05:59
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty
【问题讨论】:
-
-
斯特凡,这行得通。如果您可以将其作为答案,我可以将其标记为已接受的答案(从而将其标记为已解决)。
标签: apache tomcat virtualhost mod-proxy