Problem solved and closed !
Got the code for everyone
Add this 2 lines in /etc/httpd/conf/httpd.conf
--------------------------------------------
NameVirtualHost *:443
NameVirtualHost *:80
---------------------------------------------
in /etc/httpd/conf.d/set up this files
SSL.CONF
---------------------------------------------------------------------------------------------------------------------
LoadModule ssl_module modules/mod_ssl.so
Listen 443
SSLPassPhraseDialog builtin
SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000)
SSLSessionCacheTimeout 300
SSLMutex default
SSLRandomSeed startup file:/dev/urandom 256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin
---------------------------------------------------------------------------------------------------------------------
ROUNDCUBEMAIL.CONF
---------------------------------------------------------------------------------------------------------------------
######### HTTP://WWW.DOMAIN.PT/MAIL 80 #########
Alias /mail "/var/www/roundcubemail/"
######### HTTP://WWW.DOMAIN.PT/MAIL 443 #########
<VirtualHost *:443>
ServerAdmin administrator@domain.pt
DocumentRoot /var/www/
ServerName www.domain.pt
ServerAlias domain.pt
Alias /mail "/var/www/roundcubemail/"
<Directory "/var/www/roundcubemail">
Options -Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog logs/ssl_error_mail2_log
TransferLog logs/ssl_access_log
LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /etc/pki/tls/certs/iRedMail_CA.pem
SSLCertificateKeyFile /etc/pki/tls/private/iRedMail.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
setEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_mail2_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
######### HTTP://MAIL.DOMAIN.PT 80 #########
<VirtualHost *:80>
ServerAdmin administrator@domain.pt
DocumentRoot /var/www/
ServerName mail.domain.pt
ServerAlias webmail.domain.pt
Alias / "/var/www/roundcubemail/"
<Directory "/var/www/roundcubemail">
Options -Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
######### HTTP://MAIL.DOMAIN.PT 443 #########
<VirtualHost *:443>
ServerAdmin administrator@domain.pt
DocumentRoot /var/www/
ServerName mail.domain.pt
ServerAlias webmail.domain.pt
Alias / "/var/www/roundcubemail/"
<Directory "/var/www/roundcubemail">
Options -Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog logs/ssl_error_mail1_log
TransferLog logs/ssl_access_mail1_log
LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /etc/pki/tls/certs/iRedMail_CA.pem
SSLCertificateKeyFile /etc/pki/tls/private/iRedMail.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
setEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_mail1_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
---------------------------------------------------------------------------------------------------------------------
PHPMYADMIN.CONF
---------------------------------------------------------------------------------------------------------------------
####### http://domain.pt/phpmyadmin 80 #######
Alias /phpmyadmin "/var/www/phpmyadmin/"
<Directory /var/www/phpmyadmin/>
#pulls out to https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Options -Indexes FollowSymlinks MultiViews
AllowOverride All
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
####### dbadmin.domain.pt 443 #######
<VirtualHost *:443>
ServerAdmin administrator@domain.pt
DocumentRoot /var/www/
ServerName dbadmin.domain.pt
Alias / "/var/www/phpmyadmin/"
<Directory "/var/www/phpmyadmin/">
Options -Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog logs/ssl_error_phpmyadmin_log
TransferLog logs/ssl_access_phpmyadmin_log
LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /etc/pki/tls/certs/iRedMail_CA.pem
SSLCertificateKeyFile /etc/pki/tls/private/iRedMail.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
setEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_phpmyadmin_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
---------------------------------------------------------------------------------------------------------------------
IREDADMIN.CONF
---------------------------------------------------------------------------------------------------------------------
WSGISocketPrefix /var/run/wsgi
WSGIDaemonProcess iredadmin user=iredadmin threads=15
WSGIProcessGroup iredadmin
AddType text/html .py
Alias /iredadmin/static "/var/www/iredadmin/static/"
WSGIScriptAlias /iredadmin "/var/www/iredadmin/iredadmin.py/"
<Directory /var/www/iredadmin/>
#pulls out to https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Options -Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:443>
ServerAdmin administrator@domain.pt
DocumentRoot /var/www/
ServerName admin.domain.pt
Alias /static "/var/www/iredadmin/static/"
WSGIScriptAlias / /var/www/iredadmin/iredadmin.py/
<Directory /var/www/iredadmin/>
Options -Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog logs/ssl_error_iredadmin_log
TransferLog logs/ssl_access_iredadmin_log
LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /etc/pki/tls/certs/iRedMail_CA.pem
SSLCertificateKeyFile /etc/pki/tls/private/iRedMail.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
setEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_iredadmin_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
---------------------------------------------------------------------------------------------------------------------
AWSTATS.CONF
---------------------------------------------------------------------------------------------------------------------
Alias /awstats/icon "/var/www/awstats/icon/"
ScriptAlias /awstats "/var/www/awstats/"
<Directory /var/www/awstats/>
DirectoryIndex awstats.pl
Options +ExecCGI
Order allow,deny
allow from all
AuthName "Authorization Required"
AuthType Basic
AuthMYSQLEnable On
AuthMySQLHost 127.0.0.1
AuthMySQLPort 3306
AuthMySQLUser vmail
AuthMySQLPassword vPv5qi7hpwN1048vf9QUA8uEM5t10p
AuthMySQLDB vmail
AuthMySQLUserTable admin
AuthMySQLNameField username
AuthMySQLPasswordField password
Require valid-user
</Directory>
<VirtualHost *:443>
ServerAdmin administrator@domain.pt
DocumentRoot /var/www/
ServerName stats.domain.pt
Alias /awstats/icon "/var/www/awstats/icon/"
Alias /awstats/css "/var/www/awstats/css/"
Alias /awstats/js "/var/www/awstats/js/"
Alias /awstats/classes "/var/www/awstats/classes/"
ScriptAlias / "/var/www/awstats/"
<Directory "/var/www/awstats/">
DirectoryIndex awstats.pl
Options +ExecCGI
Order allow,deny
allow from all
AuthName "Authorization Required"
AuthType Basic
AuthMYSQLEnable On
AuthMySQLHost 127.0.0.1
AuthMySQLPort 3306
AuthMySQLUser vmail
AuthMySQLPassword vPv5qi7hpwN1048vf9QUA8uEM5t10p
AuthMySQLDB vmail
AuthMySQLUserTable admin
AuthMySQLNameField username
AuthMySQLPasswordField password
Require valid-user
</Directory>
ErrorLog logs/ssl_error_awstats_log
TransferLog logs/ssl_access_awstats_log
LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /etc/pki/tls/certs/iRedMail_CA.pem
SSLCertificateKeyFile /etc/pki/tls/private/iRedMail.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
setEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_awstats_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
---------------------------------------------------------------------------------------------------------------------
With this you can have both working !!
for example:
www.domain.com/mail and mail.domain.com