JIRA端口和Apache反向代理

我试图build立一个Apache的反向代理和与JIRA绑定的Tomcat实例。 我已经按照在JIRA维基上的指示一个T.这个网站在http://ourdomain:8080/jira就好了,所以我知道Tomcat的server.xml文件已经被正确设置了说明。

但是,我无法获得Apache反向代理的工作原因,尽pipe我阅读了大量阅读。

我在Ubuntu上运行Apache2.2,当然是启用了mod_proxy和mod_proxy_http。 default网站工作正常; 我的网站configuration只是一个修改版本。 这是我在/etc/apache2/sites-enabled/jirajira虚拟主机configuration:

 <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName ourdomain.com DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> # JIRA Proxy Configuration <Proxy *> Order deny,allow Allow from all </Proxy> ProxyRequests Off ProxyPreserveHost On ProxyPass /jira http://ourdomain.com:8080/jira ProxyPassReverse /jira http://ourdomain.com:8080/jira </VirtualHost> 

当我在浏览器中点击该网站时,出现以下(标准)文本,其中包含404 Not Found

在此服务器上找不到请求的URL / jira


在ourdomain.com端口80上的Apache / 2.2.22(Ubuntu)服务器

同时, apachectl -S的输出是:

 VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:80 is a NameVirtualHost default server ourdomain.com.com (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost ourdomain.com (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost ourdomain.com (/etc/apache2/sites-enabled/jira:1) 

所以我可以通过ourcomain.com:8080/jira访问该网站,但不能访问ourdomain.com/jira

可能最后一行指出了这个问题 – 它应该在port 8080上监听,因此我应该改变上面的虚拟主机条目吗?

显然我有什么错,但我没有看到它; 我的configuration看起来与JIRA wiki上的指示精确匹配。 一些帮助将不胜感激。 我在这里还经过了其他几个答案,而且也没有运气。

您在/etc/apache2/sites-enabled/000-default有一个ServerName ourdomain.com/etc/apache2/sites-enabled/jira有一个ServerName ourdomain.com000-default优先,因为它是按字母顺序排列的; 你的jiraconfiguration没有被使用。

更改ServerName ourdomain.com 000-default文件中的ServerName ourdomain.com行,或者如果您不使用它,那么只需a2dissite default

我有我们的JIRA以几乎相同的方式build立,虽然代理通过一个安全的网站。

我可以在我的configuration和你的之间唯一的区别是,我离开了现有的/ etc / apache2 / sites-enabled / 000-default:

 <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost> 

但是后来又添加了一个新的文件/etc/apache2/site- enabled / jira-mod_proxy其中包含了

 <Proxy *> Order deny,allow Allow from all </Proxy> SSLProxyEngine on ProxyRequests Off ProxyPreserveHost On ProxyPass /jira https://localhost:8443/jira ProxyPassReverse /jira https://localhost:8443/jira 

如果您忽略我用于SSL的8443端口,那么我可以看到的唯一区别是

  1. 使用本地主机,而不是一个FQDN,但这应该不重要,因为你可以访问您的网站在http://ourdomain:8080/jira所以tomcat显然是听你的真实IP地址

  2. <VirtualHost>元素之外具有<Proxy>configuration。

所以也许代理configuration需要超出虚拟主机设置?