Lixdo[dot]Net



« | »

Zpanel How To Change Webmail URL?

be47_zplogo_v9.png
[HOW TO] Change Webmail URL?
eg: http://webmail.zyx.tld
Make sure that you have created a Zone record on your domain registrar that points to your WEBMAIL.YOURDOMAIN.TLD.

First step is to know the structure of your VHOST (Take note: Do not edit the VHOST manually and do not use your ZPanel subdomain as your Webmail.Domain)
you need to create a WEBMAIL.YOURDOMAIN.TLD in either your Domain Registrar or in your ZPanel Sub-Domain Manager.

Let’s use http://panel.zyx.tld as your Zpanel URL as an example which you have on the top of httpd-vhost.conf.

Then you have a main domain called:

Code:
zyx.tld | *.zyx.tld | www.zyx.tld

Go to Module Admin>>Apache Config>>Shared Domains
then share your domain w/o tld eg: no-ip,dyndns,zyx

Force update and save it.

create a subdomain called: webmail.zyx.tld in your ZPanel domain or subdomain manager
save it then run the daemon and restart apache service as well.

Why do we need to create a subdomain? We will let the VHOST of Webmail subdomain to be pointed at DocumentRoot: “Webmail”
This is also to prevent your original httpd-vhost.conf from modifying it manually and this is much easier to do.

After creating the subdomain called webmail, go back to:
Module Admin>>Apache Config>>Select VHOST>>Select webmail.zyx.tld
What to do?:
Uncheck Open_Basedir *There are instance that this depends on your PHP.ini and Apache settings, so just play with it until it suits your settings.
Add this to the Custom Entry box:

Code:
DocumentRoot "/etc/zpanel/panel/etc/apps/webmail"

Then save vhost.

Run Daemon and restart Apache service.

Now check or open your httpd-vhost.conf and check entries after restarting Apache service

and you’ll have this entry: (sample only)

Code:
# DOMAIN: webmail.zyx.tld
<virtualhost *:80>
ServerName webmail.zyx.tld
ServerAlias webmail.zyx.tld www.webmail.zyx.tld
ServerAdmin postmaster[at]zyx.tld
DocumentRoot "/var/zpanel/hostdata/user_account/public_html/pubmail_zyx_tld"
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"
ErrorLog "/var/zpanel/logs/domains/user_account/webmail.zyx.tld-error.log"
CustomLog "/var/zpanel/logs/domains/user_account/webmail.zyx.tld-access.log" common
CustomLog "/var/zpanel/logs/domains/user_account/webmail.zyx.tld-bandwidth.log" common
<Directory />
Options FollowSymLinks Indexes
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
AddType application/x-httpd-php .php3 .php
ScriptAlias /cgi-bin/ "/_cgi-bin/"
<location /cgi-bin>
AddHandler cgi-script .cgi .pl
Options ExecCGI -Indexes
</location>
ErrorDocument 500 /_errorpages/500.html
ErrorDocument 403 /_errorpages/403.html
ErrorDocument 404 /_errorpages/404.html
ErrorDocument 510 /_errorpages/510.html
DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm
# Custom Global Settings (if any exist)

# Custom VH settings (if any exist)
DocumentRoot "/etc/zpanel/panel/etc/apps/webmail"
</virtualhost>
# END DOMAIN: webmail.zyx.tld

Then test your webmail url!
=============================================== that’s it!


[HOW TO] Change Webmail URL with a Different PORT?
eg: http://webmail.zyx.tld:1580

Instruction is just the same as above just make sure before changing port, you are already done what is instructed above.
Then you have to add a Listen Port in your original httpd.conf.
CentOS path: # /etc/httpd/conf/
Ubuntu path: # /etc/apache2/ <<== not sure, no Ubuntu installed ATM so I can’t check the path. Just correct the path if you want to. Wink
Windows Path: C:\Zpanel\Apache
Add Listen:

Code:
eg: Listen 1580

Open again your Module Admin>>Apache Config>>Select VHOST>>Select webmail.zyx.tld

Code:
Add Port Override: 1580
Code:
Forward Port 80 to Overriden Port: (Check this)

Save vhost

Run Daemon and restart Apache service again.

Check your httpd-vhost.conf and you’ll have now a vhost entry: (sample only)

Code:
################################################################
# Apache VHOST configuration file
# Automatically generated by ZPanel 10.0.2
# Generated on: 10:30pm 26th Jul 2013 PHT
################################################################

NameVirtualHost *:80
NameVirtualHost *:1580

# Configuration for ZPanel control panel.
<VirtualHost *:80>
ServerAdmin postmaster[at]zyx.tld
DocumentRoot "/etc/zpanel/panel/"
ServerName zpanel.zyx.tld
ServerAlias *.zpanel.zyx.tld
AddType application/x-httpd-php .php
<Directory "/etc/zpanel/panel/">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

# Custom settings are loaded below this line (if any exist)

</VirtualHost>

################################################################
# ZPanel generated VHOST configurations below.....
################################################################

# DOMAIN: webmail.zyx.tld
<virtualhost *:1580>
ServerName webmail.zyx.tld
ServerAlias webmail.zyx.tld www.webmail.zyx.tld
ServerAdmin postmaster[at]zyx.tld
DocumentRoot "/var/zpanel/hostdata/zadmin/public_html/pubmail_zyx_tld"
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"
ErrorLog "/var/zpanel/logs/domains/zadmin/webmail.zyx.tld-error.log"
CustomLog "/var/zpanel/logs/domains/zadmin/webmail.zyx.tld-access.log" common
CustomLog "/var/zpanel/logs/domains/zadmin/webmail.zyx.tld-bandwidth.log" common
<Directory />
Options FollowSymLinks Indexes
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
AddType application/x-httpd-php .php3 .php
ScriptAlias /cgi-bin/ "/_cgi-bin/"
<location /cgi-bin>
AddHandler cgi-script .cgi .pl
Options ExecCGI -Indexes
</location>
ErrorDocument 500 /_errorpages/500.html
ErrorDocument 403 /_errorpages/403.html
ErrorDocument 404 /_errorpages/404.html
ErrorDocument 510 /_errorpages/510.html
DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm
# Custom Global Settings (if any exist)

# Custom VH settings (if any exist)
DocumentRoot "/etc/zpanel/panel/etc/apps/webmail"
</virtualhost>
# END DOMAIN: webmail.zyx.tld

NOTE: After creating the WEBMAIL.YOURDOMAIN.TLD, you can now remove the “Shared Domain” in Module Admin>>Apache Config>>Shared Domains. Don’t worry removing will not affect your previous setup or it’s up to you if you still want to share your domain.

Good luck!!

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Posted by on 10/04/2014.

Categories: Meja Admin

« | »




Recent Posts


Pages



About Lixdo[dot]Net

LIXDO adalah berasal daripada Linux + Doremon = LIXDOmore →