Posts: 683
Threads: 40
Joined: Jul 2014
Reputation:
29
Sex: Male
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
02-16-2015, 06:56 AM
(This post was last modified: 02-28-2015, 12:17 AM by Ron-e.)
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..
Posts: 8
Threads: 0
Joined: Nov 2014
Reputation:
0
Sex: Undisclosed
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
02-16-2015, 07:31 AM
(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!
Posts: 4 ,008
Threads: 193
Joined: Jul 2014
Reputation:
83
Sex: Undisclosed
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
02-24-2015, 04:32 PM
@[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
Posts: 3 ,714
Threads: 253
Joined: May 2014
Reputation:
85
Sex: Male
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
02-25-2015, 01:43 AM
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
Posts: 20
Threads: 2
Joined: Sep 2014
Reputation:
-2
Sex: Male
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
03-16-2015, 06:12 AM
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?
Posts: 683
Threads: 40
Joined: Jul 2014
Reputation:
29
Sex: Male
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
03-16-2015, 03:19 PM
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?
Posts: 20
Threads: 2
Joined: Sep 2014
Reputation:
-2
Sex: Male
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
03-16-2015, 03:37 PM
(This post was last modified: 03-16-2015, 05:16 PM by Finallf.)
(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?
Posts: 4 ,008
Threads: 193
Joined: Jul 2014
Reputation:
83
Sex: Undisclosed
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
03-16-2015, 06:44 PM
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
Posts: 20
Threads: 2
Joined: Sep 2014
Reputation:
-2
Sex: Male
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
03-17-2015, 12:44 PM
(This post was last modified: 03-17-2015, 01:25 PM by Finallf.)
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
Posts: 4 ,008
Threads: 193
Joined: Jul 2014
Reputation:
83
Sex: Undisclosed
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc.
03-17-2015, 07:39 PM
@[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
|