Sentora Support Forums
Using Custom Vhost Entries for Webmail, MySQL, Etc. - Printable Version

+- Sentora Support Forums (https://senforums.mach-hosting.com)
+-- Forum: Sentora Forum Archives (https://senforums.mach-hosting.com/forumdisplay.php?fid=5)
+--- Forum: Sentora Public Support Forums v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=32)
+---- Forum: Community Guides & How-To's v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=33)
+---- Thread: Using Custom Vhost Entries for Webmail, MySQL, Etc. (/showthread.php?tid=495)

Pages: 1 2 3 4 5 6 7 8 9


Using Custom Vhost Entries for Webmail, MySQL, Etc. - TGates - 10-22-2014

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


RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - Diablo925 - 02-03-2015

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>



RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - Cantalupo - 02-04-2015

Nice, thanks. Smile


RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - Me.B - 02-04-2015

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


RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - TGates - 02-04-2015

We will see in the future, but for now this works Wink


RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - karlis - 02-16-2015

(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?


RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - TGates - 02-16-2015

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


RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - karlis - 02-16-2015

(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?


RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - TGates - 02-16-2015

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


RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - Me.B - 02-16-2015

Blank page === > PHP ERROR check logs for that.