New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

panel to subdomein

Started by jkhosting, December 09, 2017, 11:08:20 PM

Previous topic - Next topic

jkhosting

how can I link the control panel to a subdomain.
Example panel.websitename.nl

SimeonF

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).