端口到子域

我已经使用apt-get安装了Hudson,并且可以在example.com:8080上findHudson服务器。

example.com我使用标准端口*:80和一些虚拟主机设置这种方式:

 # /etc/apache2/sites-enabled/subdomain.example.com <Virtualhost *:80> ServerName subdomain.example.com ... </Virtualhost> 

这里是关于Hudson过程的信息:

 /usr/bin/daemon --name=hudson --inherit --env=HUDSON_HOME=/var/lib/hudson --output=/var/log/hudson/hudson.log --pidfile=/var/run/hudson/hudson.pid -- /usr/bin/java -jar /usr/share/hudson/hudson.war --webroot=/var/run/hudson/war 987 ? Sl 1:08 /usr/bin/java -jar /usr/share/hudson/hudson.war --webroot=/var/run/hudson/war 

我应该如何转发:

  http:// example.com:8080 

至:

  http:// hudson.example.com 

您需要先在Apache2中启用mod_proxy。 所以以root身份运行这些命令,或sudo:

 a2enmod proxy a2enmod proxy_http 

您将需要重新启动Apache:

 /etc/init.d/apache2 restart 

您的HUDSON虚拟主机文件:

 <VirtualHost *:80> ServerName hudson.example.com ProxyPass / http://localhost:8080/hudson ProxyPassReverse / http://localhost:8080/hudson ProxyRequests Off # Local reverse proxy authorization override # Most unix distribution deny proxy by default # (ie /etc/apache2/mods-enabled/proxy.conf in Ubuntu) <Proxy http://localhost:8080/hudson*> Order deny,allow Allow from all </Proxy> </VirtualHost> 

重新启动Apache再次提交新的虚拟主机:

 /etc/init.d/apache2 restart 
  • 在Apache: LINK下运行Hudson Documention
  • 运行ProxyPass子域的Apache2.2 doc: LINK