Apache HTTP Server和虚拟主机

时间:2013-10-15 09:05:25

标签: apache amazon-ec2 jenkins apache2 sonarqube

我在Amazon EC2上安装了ubuntu服务器,我安装了jenkins和sonar

我使用apt-get和sonar通过从他们的网站下载相关包来安装jenkins

当这些服务启动时,我可以通过网址http://ec2-1-2-3-4:8080和声纳http://ec2-1-2-3-4:9000找到jenkins

使用Apache HTTP Server,是否可以使用以下网址将其设置为导航到jenkins和sonar?

http://ec2-1-2-3-4/jenkins
http://ec2-1-2-3-4/sonar

1 个答案:

答案 0 :(得分:1)

是的,但是你必须使用mod_proxy。我为我的Jira安装做了同样的事情。这是Vhost。

ServerName  jira.chidgey.me
  ProxyPreserveHost On

  <Proxy *>
    Order allow,deny
    Allow from all
  </Proxy>

  ProxyPass / http://jira.chidgey.me:8080/
  ProxyPassReverse / http://jira.chidgey.me:8080/

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html
  DocumentRoot /var/www/vhosts/jira.chidgey.me/httpdocs