Subdomain to Port redirect

2019-08-10 02:41发布

I created a AWS instance to hold my jenkins and archiva services 5 days ago. I already have my own domain, and created DNS Subdomain jenkins.mydomain.com and archiva.mydomain.com entries to redirect to my AWS instance.

But, I wanna use something like that:
jenkins.mydomain.com instead of jenkins.mydomain.com:8080
archiva.mydomain.com instead of archiva.mydomain.com:8081

Someone can help me?

I already instaled a apache2 service too.

Editing... to make more clear because i don't figure out anything...

I have my own domain: mydomain.com
I created a CNAME entry dev.mydomain.com on DNS server that point to somename.no-ip.info
I created a AWS instance and installed no-ip update client. So I have sure that somename.no-ip.info is pointing to this machine

On this machine I have 2 services: Jenkins on port 9090 and Archiva on port 9091.

I'm able to access these using somename.no-ip.info:9090 and somename.no-ip.info:9091

I'm also able to access it from dev.mydomain.com:9090 and dev.mydomain.com:9091

What I want, if it's possible, is access from jenkins.mydomain.com and archiva.mydomain.com

3条回答
等我变得足够好
2楼-- · 2019-08-10 03:08

adding a reverse proxy in apache will fix this problem , something along the lines of wiki.apache.org/httpd/TomcatReverseProxy

查看更多
何必那么认真
3楼-- · 2019-08-10 03:29

This reply is late and I'm sure you have figured it out by now. I see your NameVirtualHost with an 'r' tagged at the end of your .com, which I am sure is a typo and thus creating your problem.

HTH

查看更多
小情绪 Triste *
4楼-- · 2019-08-10 03:32

It's working now.

I make CNAME entries for jenkins.mydomain.com and archiva.mydomain.com both pointing to somename.no-ip.info.

On my /etc/httpd/conf/httpd.conf i setted:

NameVirtualHost jenkins.mydomain.com:80 
<VirtualHost jenkins.mydomain.com:80>
    ServerAdmin admin@mydomain.com.br
    ServerName jenkins.mydomain.com
    ProxyPreserveHost On
    ProxyPass / http://localhost:9090/
    ProxyPassReverse / http://localhost:9090/ 
</VirtualHost>

NameVirtualHost archiva.mydomain.comr:80 
<VirtualHost archiva.mydomain.com:80>
    ServerAdmin admin@mydomain.com
    ServerName archiva.mydomain.com
    ProxyPreserveHost On
    ProxyPass / http://localhost:9091/
    ProxyPassReverse / http://localhost:9091/ 
</VirtualHost>

But now I'm getting this warning: [warn] NameVirtualHost archiva.mydomain.com:80 has no VirtualHosts

Someone knows how to fix it?

查看更多
登录 后发表回答