![]() |
|
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) |
RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - Ron-e - 02-16-2015 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.. RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - karlis - 02-16-2015 (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. This also works for me. Thanks! RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - Me.B - 02-24-2015 @[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 RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - TGates - 02-25-2015 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! RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - Finallf - 03-16-2015 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>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? RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - Ron-e - 03-16-2015 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? RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - Finallf - 03-16-2015 (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? RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - Me.B - 03-16-2015 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 RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - Finallf - 03-17-2015 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>If someone can, tell me. Thanks to all RE: Using Custom Vhost Entries for Webmail, MySQL, Etc. - Me.B - 03-17-2015 @[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 |