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.
#11
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
Don't know if someone needs this, but some of the above didn't work on my install.
Hopefully someone who has the same problem can use this in the future..
So i took this from my old Zpanel install and changed it to Sentora and it worked!
It's for CentOS but i think it's the same on Ubuntu..

Code:
</VirtualHost>

# Configuration for phpMyAdmin
<VirtualHost *:80>
    ServerAdmin mail@domain.com
    DocumentRoot "/etc/sentora/panel/etc/apps/phpmyadmin/"
    ServerName sql.domain.com
    AddType application/x-httpd-php .php3 .php
    <Directory />
        Options FollowSymLinks Indexes
        AllowOverride All
        Order Allow,Deny
        Allow from all
    </Directory>
</VirtualHost>

# Configuration for WebMail
<VirtualHost *:80>
    ServerAdmin mail@domain.com
    DocumentRoot "/etc/sentora/panel/etc/apps/webmail/"
   ServerName webmail.domain.com
    AddType application/x-httpd-php .php3 .php
    <Directory />
        Options FollowSymLinks Indexes
        AllowOverride All
        Order Allow,Deny
        Allow from all
    </Directory>
</VirtualHost>

# Add Alias for DNS-Less Previews
<VirtualHost *:80>
    ServerAdmin mail@domain.com
    ServerName sites.domain.com
    DocumentRoot "/var/sentora/hostdata"
    AliasMatch ^/~([a-zA-Z0-9]+)/?(.*) /var/sentora/hostdata/$1/public_html/$2
    <Directory /var/sentora/hostdata>
        Options FollowSymLinks Indexes
        AllowOverride All
        Order Allow,Deny
        Allow from all
        DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm
        <IfModule mod_php5.c>
            AddType application/x-httpd-php .php
            php_flag magic_quotes_gpc Off
            php_flag track_vars On
            php_flag register_globals Off
            php_admin_value upload_tmp_dir /var/sentora/temp
        </IfModule>
    </Directory>

The forum changed all @ to [at], so you have to change it back yourself..

My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons

Sentora's development takes way too long, so i'm transitioning to HestiaCP.
Reply
Thanks given by: karlis
#12
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
(02-16-2015, 06:56 AM)Ron-e Wrote: Don't know if someone needs this, but some of the above didn't work on my install.
Hopefully someone who has the same problem can use this in the future..
So i took this from my old Zpanel install and changed it to Sentora and it worked!
It's for CentOS but i think it's the same on Ubuntu..


Code:
</VirtualHost>

# Configuration for phpMyAdmin
<VirtualHost *:80>
ServerAdmin mail@domain.com
DocumentRoot "/etc/sentora/panel/etc/apps/phpmyadmin/"
ServerName sql.domain.com
AddType application/x-httpd-php .php3 .php
<Directory />
Options FollowSymLinks Indexes
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>

# Configuration for WebMail
<VirtualHost *:80>
ServerAdmin mail@domain.com
DocumentRoot "/etc/sentora/panel/etc/apps/webmail/"
   ServerName webmail.domain.com
AddType application/x-httpd-php .php3 .php
<Directory />
Options FollowSymLinks Indexes
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
#</VirtualHost>

# Add Alias for DNS-Less Previews
<VirtualHost *:80>
ServerAdmin mail@domain.com
ServerName sites.domain.com
DocumentRoot "/var/sentora/hostdata"
AliasMatch ^/~([a-zA-Z0-9]+)/?(.*) /var/sentora/hostdata/$1/public_html/$2
<Directory /var/sentora/hostdata>
Options FollowSymLinks Indexes
AllowOverride All
Order Allow,Deny
Allow from all
DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_admin_value upload_tmp_dir /var/sentora/temp
</IfModule>
</Directory>

The forum changed all @ to [at], so you have to change it back yourself..

This also works for me. Thanks!
Reply
Thanks given by:
#13
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
TGates Diablo925 the above settings are not secure. You are not adding an openbase_dir and a suhosin to disable functions.

I think I will build later a script to automate this.

Also instead of adding it that better you create a conf file apps.conf and include it in apache main config file as last file.

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

200$ free to start your VPS 60 days credit
Reply
Thanks given by:
#14
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
You don't need openbase_dir or suhosin since it is controlled by zadmin account and is only a redirect to the webmail folder.

Has been used over 5 years now without exploit.

It would be better to have it just in case though!
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#15
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
Tested here in every way, but I can not access 'webmail.domain.tld' ¬¬

Always go to this page:
   

I access webmail at link:

http://myIP/etc/apps/webmail/
and
http://panel.domain.tld/etc/apps/webmail/

on my server with zpanel, functions normally.

I am using the following config in zpanel:

Code:
</VirtualHost>
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /etc/zpanel/panel/etc/apps/webmail
ServerName webmail.domain.tld
AddType application/x-httpd-php .php3 .php
<Directory />
Options FollowSymLinks Indexes
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
Domain Enabled: selected
Suhosin Enabled: selected
OpenBase Enabled: not selected
DNS module is creating the CNAME webmail, same as the www and ftp.

I tried to use the same config in sentora, changing only the DocumentRoot to /etc/sentora/panel/etc/apps/webmail, but still does not work

What is the problem here?
Reply
Thanks given by:
#16
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
Your profile say that you use CentOS 6.5 but i notice that this problem possibly only occurs with CentOS 7, something to do with newer Apache version?
Which CentOS are you using?

My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons

Sentora's development takes way too long, so i'm transitioning to HestiaCP.
Reply
Thanks given by:
#17
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
(03-16-2015, 03:19 PM)Ron-e Wrote: Your profile say that you use CentOS 6.5 but i notice that this problem possibly only occurs with CentOS 7, something to do with newer Apache version? Which CentOS are you using?
I'm sorry, I just upgrade my servers, but, I'm using CentOS 7.


Is there solution to this problem?
Reply
Thanks given by:
#18
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
check any vhost you have on centos and replicate it's config.

TGates your hack is insecure as it lacks suhosin disable function and openbase_dir.

Notice also on apache 2.4 Vhost config change. I think I will make a script that would implement this in safer/cleaner way.

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

200$ free to start your VPS 60 days credit
Reply
Thanks given by:
#19
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
I found some of my vhost as Me.B informed, and problem solved.

leave here for future doubts:
Code:
</virtualhost>

<virtualhost *:80>
    ServerName webmail.domain.tld
    DocumentRoot "/etc/sentora/panel/etc/apps/webmail"
    AddType application/x-httpd-php .php3 .php
    <Directory />
        Options +FollowSymLinks -Indexes
        AllowOverride All
        Require all granted
    </Directory>
I could not run the DNS-Less Previews.
If someone can, tell me.

Thanks to all
Reply
Thanks given by:
#20
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
@[FinallF] this is not secure.

as it lacks too suhosing support.

you need to add:



Code:
php_admin_value open_basedir "/etc/sentora/panel/etc/apps/webmail:/var/sentora/temp/"

php_admin_value suhosin.executor.func.blacklist "passthru, show_source, shell_exec, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec"




M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

200$ free to start your VPS 60 days credit
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
SSL and Custom Vhost Entries for Webmail etienne7702 5 15 ,878 03-08-2018, 09:54 PM
Last Post: etienne7702
How to overwrite default admin. vhost? NIicK 1 7 ,049 03-27-2016, 01:16 AM
Last Post: Me.B
Roundcube Webmail https path pthalmann 0 4 ,904 12-29-2014, 09:09 AM
Last Post: pthalmann

Forum Jump:


Users browsing this thread: 2 Guest(s)