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.
Sentora is still beta.
This won't work unless you use custom vhost entries. as ports apply to all domains.
M B
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
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?
(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.
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/
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
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?
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/