Maybe this is useful:
https://hosting.fqdn.tld:443 is 301 redirected to http://customerX.tld:80
http://hosting.fqdn.tld:80 is 301 redirected to http://sub.customerY.tld:80
vhost configs for PanelRedirect seems present at the right place
- # ls -ahl /etc/imscp/apache/working | grep PanelRedirect-rw-r--r-- 1 root root 371 Apr 8 22:49 PanelRedirect.conf-rw-r--r-- 1 root root 511 Apr 8 22:49 PanelRedirect_ssl.conf
/etc/imscp/apache/working/PanelRedirect_ssl.conf
- # BEGIN Plugin::PanelRedirect<VirtualHost xx.xxx.xx.xxx:443> ServerName hosting.fqdn.tld ServerAdmin admin@fqdn.tld ErrorLog /var/log/apache2/hosting.fqdn.tld/error.log SSLProxyEngine On ProxyPass / https://hosting.fqdn.tld:4443/ ProxyPassReverse / https://hosting.fqdn.tld:4443/ SSLEngine On SSLCertificateFile /etc/imscp/hosting.fqdn.tld.pem SSLCertificateChainFile /etc/imscp/hosting.fqdn.tld.pem</VirtualHost># END Plugin::PanelRedirect
/etc/imscp/apache/working/PanelRedirect.conf
- # BEGIN Plugin::PanelRedirect<VirtualHost xx.xxx.xx.xxx:80> ServerName hosting.fqdn.tld ServerAdmin admin@fqdn.tld ErrorLog /var/log/apache2/hosting.fqdn.tld/error.log # SECTION VHOST_PREFIX != http:// BEGIN. Redirect / https://hosting.fqdn.tld/ # SECTION VHOST_PREFIX != http:// END.</VirtualHost># END Plugin::PanelRedirect
But it seems this configurations are being overwritten by customer vhost ...
- # apache2ctl -SVirtualHost configuration:xx.xxx.xx.xxx:443 customerX.tld (/etc/apache2/sites-enabled/customer1-domain.tld.conf:1)xx.xxx.xx.xxx:80 is a NameVirtualHost default server sub.customerY.tld (/etc/apache2/sites-enabled/sub.customerY.tld.conf:1)....ServerRoot: "/etc/apache2"Main DocumentRoot: "/var/www"Main ErrorLog: "/var/log/apache2/error.log"Mutex rewrite-map: using_defaultsMutex ssl-stapling: using_defaultsMutex proxy: using_defaultsMutex ssl-cache: using_defaultsMutex default: dir="/var/lock/apache2" mechanism=fcntlMutex mpm-accept: using_defaultsMutex watchdog-callback: using_defaultsPidFile: "/var/run/apache2/apache2.pid"Define: DUMP_VHOSTSDefine: DUMP_RUN_CFGUser: name="www-data" id=33Group: name="www-data" id=33
customer1-domain.tld.conf
- <VirtualHost xx.xxx.xx.xxx:443> ServerAdmin webmaster@customerX.tld ServerName customerX.tld ServerAlias www.customerX.tld vu2003.hosting.fqdn.tld LogLevel error ErrorLog /var/log/apache2/customerX.tld/error.log DocumentRoot /var/www/virtual/customerX.tld/htdocs Alias /errors /var/www/virtual/customerX.tld/errors/ # SECTION suexec BEGIN. SuexecUserGroup vu2003 vu2003 # SECTION suexec END. # SECTION php_enabled BEGIN. # SECTION php_fpm BEGIN. <IfVersion < 2.4.9> Alias /php5-fcgi /var/lib/apache2/fastcgi/php5-fcgi-customerX.tld-ssl FastCGIExternalServer /var/lib/apache2/fastcgi/php5-fcgi-customerX.tld-ssl \ -socket /var/run/php5-fpm-customerX.tld.socket \ -idle-timeout 900 \ -pass-header Authorization </IfVersion> <IfVersion >= 2.4.9> SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1 <Proxy "unix:/var/run/php5-fpm-customerX.tld.socket|fcgi://php5-fpm"> ProxySet disablereuse=off </Proxy> <FilesMatch "\.php5?$"> SetHandler proxy:fcgi://php5-fpm </FilesMatch> </IfVersion> # SECTION php_fpm END. # SECTION php_enabled END. <Directory /var/www/virtual/customerX.tld> Options +SymLinksIfOwnerMatch Require all granted </Directory> <Directory /var/www/virtual/customerX.tld/htdocs> # SECTION php_enabled BEGIN. AllowOverride All # SECTION php_enabled END. </Directory> # SECTION cgi_support BEGIN. ScriptAlias /cgi-bin/ /var/www/virtual/customerX.tld/cgi-bin/ <Directory /var/www/virtual/customerX.tld/cgi-bin> AllowOverride AuthConfig Indexes Limit </Directory> # SECTION cgi_support END. # SECTION addons BEGIN. # SECTION addons END. SSLEngine On SSLCertificateFile /var/www/imscp/gui/data/certs/customerX.tld.pem SSLCertificateChainFile /var/www/imscp/gui/data/certs/customerX.tld.pem Include /etc/apache2/imscp/customerX.tld.conf</VirtualHost>
/etc/apache2/sites-enabled/sub.customerY.tld.conf
- <VirtualHost xx.xxx.xx.xxx:80>
- ServerAdmin webmaster@sub.customerY.tld
- ServerName sub.customerY.tld
- ServerAlias www.sub.customerY.tld vu2005sub19.hosting.fqdn.tld
- DocumentRoot /var/www/virtual/customerY.tld/sub/htdocs
- LogLevel error
- ErrorLog /var/log/apache2/sub.customerY.tld/error.log
- Alias /errors /var/www/virtual/customerY.tld/errors/
- # SECTION suexec BEGIN.
- SuexecUserGroup vu2005 vu2005
- # SECTION suexec END.
- # SECTION php_enabled BEGIN.
- # SECTION php_fpm BEGIN.
- <IfVersion < 2.4.9>
- Alias /php5-fcgi /var/lib/apache2/fastcgi/php5-fcgi-sub.customerY.tld
- FastCGIExternalServer /var/lib/apache2/fastcgi/php5-fcgi-sub.customerY.tld \
- -socket /var/run/php5-fpm-customerY.tld.socket \
- -idle-timeout 900 \
- -pass-header Authorization
- </IfVersion>
- <IfVersion >= 2.4.9>
- SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
- <Proxy "unix:/var/run/php5-fpm-customerY.tld.socket|fcgi://php5-fpm">
- ProxySet disablereuse=off
- </Proxy>
- <FilesMatch "\.php5?$">
- SetHandler proxy:fcgi://php5-fpm
- </FilesMatch>
- </IfVersion>
- # SECTION php_fpm END.
- # SECTION php_enabled END.
- <Directory /var/www/virtual/customerY.tld>
- Options +SymLinksIfOwnerMatch
- Require all granted
- </Directory>
- <Directory /var/www/virtual/customerY.tld/sub/htdocs>
- # SECTION php_enabled BEGIN.
- AllowOverride All
- # SECTION php_enabled END.
- </Directory>
- # SECTION cgi_support BEGIN.
- ScriptAlias /cgi-bin/ /var/www/virtual/customerY.tld/sub/cgi-bin/
- <Directory /var/www/virtual/customerY.tld/sub/cgi-bin>
- AllowOverride AuthConfig Indexes Limit Options=Indexes
- </Directory>
- # SECTION cgi_support END.
- # SECTION addons BEGIN.
- # SECTION addons END.
- Include /etc/apache2/imscp/sub.customerY.tld.conf
- </VirtualHost>
Display More