This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

How do I mask an unconventional subdomain port
#1
How do I mask an unconventional subdomain port
I am running Sentora as my primary control pane. I have several subdomains I will be running as well and each of them have their own apache instance they run and request port 80. I can manipulate the ports on those applications to use alternate ports but want the subdomains to remain as the .com and not .com:8080 or .com:8081.

I can edit the apache module in sentora to add the port forward but if I try to mask the port redirect with a <proxy> directive it kills my vhost file and apache wont load it.

Can you give some advise on the proper way to mask port forwarding in Sentora so My subdomain test.mysite.com:8080 is loaded as test.mysite.com.
Reply
Thanks given by:
#2
RE: How do I mask an unconventional subdomain port
Sentora is still beta.

This won't work unless you use custom vhost entries. as ports apply to all domains.

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

200$ free to start your VPS 60 days credit
Reply
Thanks given by:
#3
RE: How do I mask an unconventional subdomain port
Can you give an example on what the custom vhost would look like for instance a subdomain that is test.mysite.com:8080 to resolve to test.mydomain.com
Reply
Thanks given by:
#4
RE: How do I mask an unconventional subdomain port
Something like this?
http://stackoverflow.com/questions/18599...sk-the-url
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#5
RE: How do I mask an unconventional subdomain port
Yeah basically my application is running on :8080 I have the subdomain configured in sentora and want to use it to point to the application. Do I need to do a port forward and then proxypass or just run the application on 8080 and enter the proxy pass in the vhost?
Reply
Thanks given by:
#6
RE: How do I mask an unconventional subdomain port
(11-26-2014, 03:59 AM)elitemobb Wrote: Yeah basically my application is running on :8080 I have the subdomain configured in sentora and want to use it to point to the application. Do I need to do a port forward and then proxypass or just run the application on 8080 and enter the proxy pass in the vhost?

You will need to portforward 8080 to your server also.
Also, you will need to add to httpd.conf: LISTEN 8080 after LISTEN 80
Then I think it would look something like this as a custom vhost for the subdomain:

Code:
</VirtualHost>
<VirtualHost *:80>
 ServerName sub.domain.com

 ProxyRequests off
 ProxyPass / http://sub.domain.com:8080/
 ProxyPassReverse / http://sub.domain.com:8080/
 Oc4jMount / HTML_DV_8080
 Oc4jMount /* HTML_DV_8080

Although that topic is not solved. Will look for another example.
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#7
RE: How do I mask an unconventional subdomain port
Here is another I found which actually was solved and up-voted:
http://serverfault.com/questions/195611/...ame-server
Code:
</VirtualHost>
<VirtualHost *>
   ServerAdmin me@mydomain.com
   ServerName sub.mydomain.com
   ProxyPreserveHost On

   # setup the proxy
   <Proxy *>
       Order allow,deny
       Allow from all
   </Proxy>
   ProxyPass / http://sub.domain.com:8080/
   ProxyPassReverse / http://sub.domain.com:8080/
It may also work this way under the subdomain's custom vhost entry:

Code:
   ProxyPreserveHost On

   # setup the proxy
   <Proxy *>
       Order allow,deny
       Allow from all
   </Proxy>
   ProxyPass / http://sub.domain.com:8080/
   ProxyPassReverse / http://sub.domain.com:8080/
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#8
RE: How do I mask an unconventional subdomain port
The above example is unsecure.

Open vhost config under /etc/zpanel/config/apache/

Copy any with port :80 ( avoid the one for the panel ) & then change the port & add in the main apache config.

You need to add suhosin so your website remain secure.

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

200$ free to start your VPS 60 days credit
Reply
Thanks given by:
#9
RE: How do I mask an unconventional subdomain port
Ok when I add
Code:
ProxyPreserveHost On

  # setup the proxy
  <Proxy *>
      Order allow,deny
      Allow from all
  </Proxy>
  ProxyPass / http://sub.domain.com:8080/
  ProxyPassReverse / http://sub.domain.com:8080/
in the subdomain custom vhost nothing happens. If I go to the subdomain it just loads the sentora default index page like I just created the domain instead of redirecting to :8080 and preserving the url.

@ Me.B - Your suggestion was to copy the httpd.conf entries with port 80 and put them in the apache config and change the port. The apache config is empty, if I put the vhost config in there do I need to add the header information as well or will that be read from the sentora httpd.conf?
Reply
Thanks given by:
#10
RE: How do I mask an unconventional subdomain port
If I try to restart apache with the custom vhost configured like above I get a syntax error saying it doesnt recognize ProxyPreserveHost

Code:
service apache2 restart
Syntax error on line 95 of /etc/sentora/configs/apache/httpd-vhosts.conf:
Invalid command 'ProxyPreserveHost', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
  ...fail!
and thats with this subdomain custom vhost configuration

Code:
Domain Enabled x
Suhosin Enabled x
OpenBase Enabled x
Port Override: 8080
Forward Port 80 to Overriden Port:    X
Custom Entry:
ProxyPreserveHost On

  # setup the proxy
  <Proxy *>
      Order allow,deny
      Allow from all
  </Proxy>
  ProxyPass / http://sub.domain.com:8080/
  ProxyPassReverse / http://sub.domain.com:8080/
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
Subdomain gbrain2008 3 7 ,438 03-08-2021, 05:34 PM
Last Post: ccr1969
Subdomain Not working PLZ HELP rajeevrrs 4 20 ,449 03-14-2020, 08:47 AM
Last Post: TGates
Sentora Subdomain Installl sathish2009 2 7 ,725 04-03-2017, 11:50 AM
Last Post: sathish2009

Forum Jump:


Users browsing this thread: 1 Guest(s)