Subdomain to Port redirect

泄露秘密 提交于 2019-12-11 09:54:48

问题


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


回答1:


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




回答2:


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?




回答3:


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



来源:https://stackoverflow.com/questions/22879819/subdomain-to-port-redirect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!