我在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
答案 0 :(得分:1)
您需要在配置文件的“VirtualHost”元素中定义子域,以便服务器可以区分不同的主机:
<VirtualHost kantoor.ginl.hodzelmanstechnology.nl:80>
...
</VirtualHost>