Panel on port 8443, webmail, pma and ftp subdomains FIXED - gus78 - 02-22-2012 09:41 AM
I followed the instrucctions given on http://isp-control.net/documentation/doku.php?id=howto:defaultport, but was a headache because it didn't worked as I wanted.
Finally after some cups of coffee I fixed it.
Scenario:
- Debian squeeze fresh install
- Control panel on port 8443
- SSL support
- Correct redirection for subdomains webmail, ftp and pma
Respect the link mentioned above, now you can generate free SSL certificates in startssl.com, accepted on most of the current browsers.
00_master.conf
Code:
<VirtualHost {BASE_SERVER_IP}:80>
ServerName {BASE_SERVER_VHOST}
ServerAlias webmail.* pma.* ftp.*
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(webmail|pma|ftp)\..* [NC]
RewriteRule ^/(.*) https://{BASE_SERVER_VHOST}/%1/ [R=301]
Redirect permanent / https://{BASE_SERVER_VHOST}/admin/index.php
</VirtualHost>
<VirtualHost {BASE_SERVER_IP}:443>
ServerName {BASE_SERVER_VHOST}
ServerAlias webmail.* pma.* ftp.*
Alias /webmail {ROOT_DIR}/gui/tools/webmail/
Alias /pma {ROOT_DIR}/gui/tools/pma/
Alias /ftp {ROOT_DIR}/gui/tools/filemanager/
SSLEngine On
SSLCertificateFile /etc/ssl/certs/{BASE_SERVER_VHOST}.crt
SSLCertificateKeyFile /etc/ssl/certs/{BASE_SERVER_VHOST}.key
#In case of coming in directly with https://...
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(webmail|pma|ftp)\..* [NC]
RewriteRule ^/(.*) https://{BASE_SERVER_VHOST}/%1/ [R=301]
#RewriteLogLevel 7
#RewriteLog "/var/log/apache2/rewrite.log"
<IfModule suexec_module>
SuexecUserGroup {APACHE_SUEXEC_USER_PREF}{APACHE_SUEXEC_MIN_UID} {APACHE_SUEXEC_USER_PREF}{APACHE_SUEXEC_MIN_GID}
</IfModule>
<IfModule mod_fcgid.c>
<Directory {ROOT_DIR}/gui>
FCGIWrapper {PHP_STARTER_DIR}/master/php{PHP_VERSION}-fcgi-starter .php
Options +ExecCGI
</Directory>
<Directory "{PHP_STARTER_DIR}/master">
AllowOverride None
Options +ExecCGI MultiViews -Indexes
Order allow,deny
Allow from all
</Directory>
</IfModule>
<IfModule mod_fastcgi.c>
ScriptAlias /php5/ {PHP_STARTER_DIR}/master/
<Directory "{PHP_STARTER_DIR}/master">
AllowOverride None
Options +ExecCGI MultiViews -Indexes
Order allow,deny
Allow from all
</Directory>
</IfModule>
</VirtualHost>
#
# Master Begin
#
<VirtualHost {BASE_SERVER_IP}:8443>
ServerAdmin {DEFAULT_ADMIN_ADDRESS}
DocumentRoot {ROOT_DIR}/gui
ServerName {BASE_SERVER_VHOST}
Alias /errors {ROOT_DIR}/gui/errordocs/
ErrorDocument 401 /errors/401.html
ErrorDocument 403 /errors/403.html
ErrorDocument 404 /errors/404.html
ErrorDocument 500 /errors/500.html
ErrorDocument 503 /errors/503.html
Alias /pma {ROOT_DIR}/gui/tools/pma/
Alias /webmail {ROOT_DIR}/gui/tools/webmail/
Alias /ftp {ROOT_DIR}/gui/tools/filemanager/
#Fix path for entering roundcube from ispcp.
#You can also edit on /etc/ispcp/ispcp.conf and delete this
Redirect permanent /tools/webmail/src/login.php /tools/webmail/index.php
<IfModule suexec_module>
SuexecUserGroup {APACHE_SUEXEC_USER_PREF}{APACHE_SUEXEC_MIN_UID} {APACHE_SUEXEC_USER_PREF}{APACHE_SUEXEC_MIN_GID}
</IfModule>
<Directory {ROOT_DIR}/gui>
Options -Indexes Includes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule mod_fcgid.c>
<Directory {ROOT_DIR}/gui>
FCGIWrapper {PHP_STARTER_DIR}/master/php{PHP_VERSION}-fcgi-starter .php
Options +ExecCGI
</Directory>
<Directory "{PHP_STARTER_DIR}/master">
AllowOverride None
Options +ExecCGI MultiViews -Indexes
Order allow,deny
Allow from all
</Directory>
</IfModule>
<IfModule mod_fastcgi.c>
ScriptAlias /php5/ {PHP_STARTER_DIR}/master/
<Directory "{PHP_STARTER_DIR}/master">
AllowOverride None
Options +ExecCGI MultiViews -Indexes
Order allow,deny
Allow from all
</Directory>
</IfModule>
<IfModule mod_php5.c>
<Directory {ROOT_DIR}/gui>
php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}/:{CONF_DIR}/:{MR_LOCK_FILE}:/proc/:/bin/df:/bin/mount:{RKHUNTER_LOG}:{CHKROOTKIT_LOG}:{PEAR_DIR}/{OTHER_ROOTKIT_LOG}"
php_admin_value session.save_path "{ROOT_DIR}/gui/phptmp/"
php_admin_value upload_tmp_dir "{ROOT_DIR}/gui/phptmp/"
</Directory>
</IfModule>
</VirtualHost>
#
# Master End
#
The rest of the changes are like in the referred link.
mvh
|