Sentora Support Forums

Full Version: Using Custom Vhost Entries for Webmail, MySQL, Etc.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9
You can use these custom vhost entries to customize sub-domains for various apps:

NOTICE: This could be vulnerable as the sub domains are not locked down using suhosin. Use at your own risk!


Module Admin>Apache Config>Override a Virtual Host Setting>[select domain]>Custom Entry
(Customize file/folder paths to work with your server setup.)
(NOTE: Do NOT add these sub-domains in the sub-domain module!)

Code:
Code:
</VirtualHost>     # Configuration for phpMyAdmin - mysql.yoursite.tld     <VirtualHost *:80>         ServerAdmin webmaster[at]yoursite.tld         DocumentRoot "/etc/sentora/panel/etc/apps/phpmyadmin/"         ServerName mysql.yoursite.tld         AddType application/x-httpd-php .php3 .php         <Directory />             php_admin_value open_basedir /etc/sentora/panel/etc/apps/phpmyadmin             Options FollowSymLinks Indexes             AllowOverride All             Order Allow,Deny             Allow from all         </Directory>     </VirtualHost>     # Configuration for WebMail - webmail.yoursite.tld     <VirtualHost *:80>         ServerAdmin webmaster[at]yoursite.tld         DocumentRoot "/etc/sentora/panel/etc/apps/webmail/"         ServerName webmail.yoursite.tld         AddType application/x-httpd-php .php3 .php         <Directory />             php_admin_value open_basedir # Alias for roundcube WebMail login Alias "/webmail" "/etc/sentora/panel/etc/apps/webmail" <Directory "/etc/sentora/panel/etc/apps/webmail/">     php_admin_value open_basedir /var/sentora/temp/:/etc/sentora/panel/etc/apps/webmail:/var/sentora/logs/roundcube     Options +FollowSymLinks -Indexes     AllowOverride All     Require all granted </Directory>             Options FollowSymLinks Indexes             AllowOverride All             Order Allow,Deny             Allow from all         </Directory>
You will also need to add them in your DNS registrar and in Sentora's DNS Manager module (add A records for each of mysql.yoursite.tld  and webmail.yoursite.tld, etc.)

NOTE: Changes may take up to 48 hours to work! Be patient
On Linux

Remember to add </VirtualHost> at the start

and no </VirtualHost> at the end Smile

Webmail:
Code:
</VirtualHost> # Configuration for WebMail <VirtualHost *:80>  ServerAlias webmail.*  DocumentRoot "/etc/sentora/panel/etc/apps/webmail/"  AddType application/x-httpd-php .php  <Directory "/etc/sentora/panel/etc/apps/webmail/">  Options +FollowSymLinks -Indexes  AllowOverride All  Require all granted  </Directory> 
Phpmyadmin / Mysql
Code:
</VirtualHost> # Configuration for PHPmyadmin    <VirtualHost *:80>  ServerAlias pma.*  DocumentRoot "/etc/sentora/panel/etc/apps/phpmyadmin/"  AddType application/x-httpd-php .php  <Directory "/etc/sentora/panel/etc/apps/phpmyadmin/">  Options +FollowSymLinks -Indexes  AllowOverride All  Require all granted  </Directory>
Nice, thanks. Smile
This is a trick for subdomains but I think in next release we would set a new way for SSL & such tricks instead of supporting those hacks. Let's see...

M B
We will see in the future, but for now this works Wink
(02-03-2015, 11:13 PM)Diablo925 Wrote: [ -> ]On Linux
Webmail:


Code:
</VirtualHost> # Configuration for WebMail <VirtualHost *:80>  ServerAlias webmail.*  DocumentRoot "/etc/sentora/panel/etc/apps/webmail/"  AddType application/x-httpd-php .php  <Directory "/etc/sentora/panel/etc/apps/webmail/">  Options +FollowSymLinks -Indexes  AllowOverride All  Require all granted  </Directory> 
Any idea why am i getting internal server error after doing this?
Code:
ServerAlias webmail.*
Possibly this line. I have tried it in the past also with no luck, I settled on using:
Code:
Alias /webmail /etc/sentora/panel/etc/apps/webmail
as a Global Vhost Entry in Module Admin > Apache Config.
This allows all domains and subdomains to use domain.com/webmail to access roundcube and has worked without flaw for a few years now.
(I also use a similar variation for external phpmyadmin login.)
Doing it this way also prevents clients from having to add a webmail record to their DNS settings. Much easier for everybody Wink
(02-16-2015, 04:03 AM)TGates Wrote: [ -> ]
Code:
Alias /webmail /etc/sentora/panel/etc/apps/webmail/
as a Global Vhost Entry in Module Admin > Apache Config.
This allows all domains and subdomains to use domain.com/webmail to access roundcube and has worked without flaw for a few years now.
(I also use a similar variation for external phpmyadmin login.)
Doing it this way also prevents clients from having to add a webmail record to their DNS settings. Much easier for everybody Wink
Tried it and it gives me a blank page. Any idea why?
hmmm. Try accessing it by using your panel login URL (panel.domain.com)/etc/apps/webmail/
If that works, then it could be a .htaccess lockdown. @[Me.B] is more familiar with what they did to lock things down and could advise better Wink
Blank page === > PHP ERROR check logs for that.
Pages: 1 2 3 4 5 6 7 8 9