This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Using Custom Vhost Entries for Webmail, MySQL, Etc.
#1
Using Custom Vhost Entries for Webmail, MySQL, Etc.
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 /etc/sentora/panel/etc/apps/webmail
            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
-TGates - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support or modules helpful? Donate HERE
Get your domains using my affiliate link:
GoDaddy - Domains
Reply
Thanks given by: rafaht
#2
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
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>
Sentora 1.0.3 on [Image: DO_Logo_Horizontal_Blue-3db19536.png]

-= Github =-  -= My Repo =-

My Modules
Reply
Thanks given by: rafaht
#3
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
Nice, thanks. Smile
Reply
Thanks given by:
#4
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
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
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask
Coldfusion Freelance

10$ free to start your VPS

Reply
Thanks given by:
#5
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
We will see in the future, but for now this works Wink
-TGates - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support or modules helpful? Donate HERE
Get your domains using my affiliate link:
GoDaddy - Domains
Reply
Thanks given by:
#6
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
(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?
Reply
Thanks given by: kamzo
#7
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
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
-TGates - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support or modules helpful? Donate HERE
Get your domains using my affiliate link:
GoDaddy - Domains
Reply
Thanks given by: karlis
#8
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
(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?
Reply
Thanks given by:
#9
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
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
-TGates - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support or modules helpful? Donate HERE
Get your domains using my affiliate link:
GoDaddy - Domains
Reply
Thanks given by:
#10
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
Blank page === > PHP ERROR check logs for that.
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask
Coldfusion Freelance

10$ free to start your VPS

Reply
Thanks given by:


Possibly Related Threads...
Thread Author Replies Views Last Post
SSL and Custom Vhost Entries for Webmail etienne7702 4 501 03-19-2017, 09:16 AM
Last Post: TGates
Custom Error Pages/Static Pages TGates 8 6,685 05-11-2016, 03:15 PM
Last Post: Kumar
How to overwrite default admin. vhost? NIicK 1 823 03-27-2016, 01:16 AM
Last Post: Me.B

Forum Jump:


Users browsing this thread: 1 Guest(s)