Author Topic: panel to subdomein  (Read 591 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
panel to subdomein
« on: December 09, 2017, 11:08:20 PM »
how can I link the control panel to a subdomain.
Example panel.websitename.nl

Offline
*
Re: panel to subdomein
« Reply #1 on: December 11, 2017, 09:30:32 AM »
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:
Code: [Select]
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:
Code: [Select]
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:
Code: [Select]
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).