redirect site to servername:8000

Discussion in 'Installation/Configuration' started by Steffan, Oct 17, 2016.

  1. Steffan

    Steffan Member

    Last edited: Oct 18, 2016
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    No, you can't answer on the same port (8000) speaking both http and https.
     
  3. Steffan

    Steffan Member

  4. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Yes, you could do that; you'd need to add a redirect rule based on the servername (if it doesn't match 'servername', redirect) in the ispconfig virtualhost definition (000-ispconfig.vhost). Note that any direct changes will be overwritten the next time you update ispconfig, so you need to copy the default template from /usr/local/ispconfig/server/conf/ to /usr/local/ispconfig/server/conf-custom/ and make changes there, too.
     
  5. Steffan

    Steffan Member

    well this is in:
    /etc/httpd/conf/sites-enabled/000-ispconfig.vhost
    from day one.

    It does work but then a certifcate worning is given.
    The vhost domein is not redirected to the server domain holding the ispconfig certificate

    Listen 8000
    NameVirtualHost *:8000


    <VirtualHost _default_:8000>
    ServerAdmin webmaster@localhost
    <Directory /var/www/ispconfig/>
    <FilesMatch "\.ph(p3?|tml)$">
    SetHandler None
    </FilesMatch>
    ................
     
  6. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    To fix that, so that every single site has a valid ssl certificate with correct name, you will need to add a ServerName directive to the current _default_:8000 vhost (so create a conf-custom file for that as mentioned above), and also modify the normal website vhost template to have a port 8000 vhost as well as 80 and 443, using a ServerName for the 'vsite' and pointing to the correct certificate (so copy the website vhost file to a conf-custom file) and doing the redirect there. You'll of course need to arrange adding all the ssl certificates (use letsencrypt or add to SSL tab).
     
  7. Steffan

    Steffan Member

    oke so no oneliner for this.

    thanxs will give it a try this week.
     

Share This Page