Change ispconfig3 port in multi server setup

Discussion in 'Installation/Configuration' started by ginner159, Feb 3, 2014.

  1. ginner159

    ginner159 New Member

    Hi sorry if this is simple and im just not getting it.

    Im wanting to change the port ispconfig currently uses. I have a multiserver setup as follows:

    ns1.domain.com runs ispconfig3 on port 8080, also all db mail websites etc
    n2s.domain.com purly secondry name server. connected to ns1 during multiserver setup
    srv3.domain.com syncronised backup or ns1 also connected in multiserver setup.

    I want to change the port to 80 as i have users unable to connect due to thier proxy configs blocking port 8080 and allow connections to the control panel login via admin.domain.com

    I have an ssl for admin.domain and domain.com

    What steps would i need to take t keep the other servers connected?

    Thanks in advance guys
     
  2. tahunasky

    tahunasky New Member

    I would not change it to 80 as its the default port for http requests. I would use something else like 8081, 8082 etc, i do this due to my router using 8080 for management settings.

    You can specify what port to use when installing ispconfig. Or you can modify the ispconfig.vhost file.

    For apache:
    Listen 8081
    NameVirtualHost *:8081

    <VirtualHost _default_:8081>

    then restart apache:

    /etc/init.d/apache2 restart

    For nginx:
    server {
    listen 8081;

    then restart nginx:
    /etc/init.d/nginx restart
     
  3. ginner159

    ginner159 New Member

    but it wouldn't matter if i had it on port 80 as wouldn't apache lookup the vhost file associated?? i have 8-10 websites all running on port 80 already.

    Once i change the vhost to port 80 how would i ensure that my other servers can still connect?
     
  4. tahunasky

    tahunasky New Member

    Most unencrypted websites (http) use port 80.

    If you use port 80 how will apache distinguish‎ between the default website for a domain and ispconfig ?

    ispconfig uses https, which isnt used on port 80.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Port 8081 is already in use by the apps vhost, but using port 8082 or any other free port is fine.

    ispconfig uses a port based vhost, so there is no domain associated with it and you wont be able to access ispcnfig if you change the port to 80. Better use a different, free port, like tahunasky suggested.
     
  6. ginner159

    ginner159 New Member

    So even if i were to change it so that i had a vhost of subdomain such as admin.domain.com i still wouldnt be able to connect? it would have to be followed by a port?

    Would the only way to have it on 80 be to run a machine with just isp3 installed as the only site? like a small vps just as a control panel
     
  7. tahunasky

    tahunasky New Member

    You could use it as a subdomain. You will need to change the beginning of your vhost file to look something like this:


    Code:
    <VirtualHost *:80>
    	ServerName admin.mydomain.tld
    	RewriteEngine  on
    	RewriteCond    %{HTTPS} !=on
    	RewriteRule (.*) https://%{HTTP_HOST}
    </VirtualHost>
    
    <VirtualHost *:443>
    	ServerName admin.mydomain.tld
    	ServerAdmin [email protected]
      
    	<FilesMatch "\.ph(p3?|tml)$">
    		SetHandler None
    	</FilesMatch>
      
    	<IfModule mod_fcgid.c> ...............
    
    That way you can use port 80 and it will be redirected to SSL port 443 if you want it that way, or you can stick with the default ports.
    You can also add "ServerAlias admin.*" key so all domains would work with the admin subdomain:

    Code:
    <VirtualHost *:80>
    	ServerName admin.mydomain.tld
    	ServerAlias admin.*
    	RewriteEngine  on
    	RewriteCond    %{HTTPS} !=on
    	RewriteRule (.*) https://%{HTTP_HOST}
    </VirtualHost>
    
    <VirtualHost *:443>
    	ServerName admin.mydomain.tld
    	ServerAlias admin.*
    	ServerAdmin [email protected] ...............
    
    Yes you would only be able to use ISPconfig for that domain if it uses port 80.
     
    Last edited: Feb 12, 2014

Share This Page