You are on page 1of 2

[Tutorial] Changing ZPanel to Different port

Tutorial on changing your ZPanel port 80 to a different port ( Alternative Setting)

(THIS IS ONLY A REFERENCE GUIDE ON HOW TO CHANGE DEFAULT PORT TO DIFFERENT PORT ON ZPANEL) Here we will cover on how to change your ZPanel port 80 (default) to eg: 1080 ~ 9080 or what ever you like to setup to. Remember that "80" will still remain in the last 2 digits of the port setting. Do not add more than 2 digits eg:123/80 so thats a total of 5 digits which is wrong (never been tested). The result should only be like this eg: 10/80 in a total of 4 digits IMPORTANT NOTES: back up the files that we are going to re-configure OnDaemonRun.hook.php httpd-vhost.config so if something goes wrong with the re-configuration, you can revert the backup files to default. Now here's how: We need to locate the path: /zpanel/panel/modules/apache_admin/hooks Open the file: OnDaemonRun.hook.php (<<== backup this file first then modify it) Search for the line: $line .= "<VirtualHost *: " . ctrl_options::GetSystemOption('apache_port') . ">" . fs_filehandler::NewLine(); Add the extra port you want to use eg: Code:
$line .= "<VirtualHost *:10" . ctrl_options::GetSystemOption('apache_port') . ">" . fs_filehandler::NewLine();

Now locate your: "httpd.conf" Add: Listen 1080 Save your httpd.conf and restart service.

If the daemon runs and doesn't change your httpd-vhost.conf, manually edit your VHOST eg: NameVirtualHost *:80 # Configuration for ZPanel control panel. <VirtualHost *:1080> ServerAdmin admin@localhost DocumentRoot "/etc/zpanel/panel/" ServerName zpanel.mydomain.com

ServerAlias *.zpanel.mydomain.com 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> Restart again your Apache service.... now the output of your setting will now be "http://panel.yourdomain.tld:1080" Why do we need to re-configure "OnDaemonRun.hook.php"? We need to re-configure it so when ever the daemon runs manually or automatically.. your https-vhost.conf ZPanel VHOST will never revert to port 80. That's it!!! your ZPanel is now in a different port and all other VHOST entry remains port 80. (Remember that this is only an alternative setting or reference guide and it is not official, when ever an update of ZPanel comes? this setting will revert to default Zpanel hook setting. ALSO REMEMBER that Zpanel Devs is not responsible on your modified Zpanel files) If you want to set your ZPanel using SSL within different port? eg: https://panel.yourdomain.tld:2380 See TUTS with the link below:
[Tutorial] ZPanelX SSL configuration on default and different port

Good luck

You might also like