Control Web Panel
WebPanel => CentOS Configuration => Topic started by: jkhosting on December 09, 2017, 11:08:20 PM
-
how can I link the control panel to a subdomain.
Example panel.websitename.nl
-
There are two different ways, each with their flaw:
1. Use ProxyPass in vhosts.conf / vhosts-ssl.conf
Create your Subdomain, edit the vhosts.conf & vhosts-ssl.conf and insert Proxy Rules into the VirtualHost part.
Working Example:
ProxyRequests off
ProxyPass /well-known !
ProxyPass / http://<domain>:2083/ disablereuse=on
ProxyPassReverse / http://<domain>:2083/
ProxyPreserveHost On
For the SSL part you also need some thing like this:
SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
Flaw: Each time you rebuild the conf files, your changes get deleted.
#############################################################
2. Use RewriteRule in .htaccess
Create your Subdomain and use a specific folder for it (eg. /homes/user/proxies/cwp)
Put a .htaccess into that Folder containing the RewriteRules.
Working Example:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/\.well\-known/
RewriteRule (.*) http://localhost:2082/$1 [P,L]
Flaw: You cannot Use a SSL Backend (I could not use port 2083 in the RewriteRule).