How to Roundcube and phpmyadmin on port 8080 instead

Discussion in 'HOWTO-Related Questions' started by emaddaou, Nov 14, 2018.

  1. emaddaou

    emaddaou New Member

    Hi Everyone,

    I have built my fav web hosting server using ISPconfig following this howto https://www.howtoforge.com/tutorial/perfect-server-debian-9-nginx-bind-dovecot-ispconfig-3.1/3/ based on nginx and Debian 9.

    However, I want to view my webmail and phpmyadmin over SSL using my webhosting server host name without ports, I was successfully able to forward port 8080 to 80 using Nginx directive but how to do the same thing for Roundcube and phpmyadmin?

    Who would use port 8081 without SSL???

    If you click the following link, it takes you to my web hosting server, is it possible just to type /webmail or /phpmyadmin infront of the domain without ports such https://whs.imaddaou.com/phpmyadmin and https://whs.imaddaou.com/webmail?

    # ISPconfig without port 8080 :)
    https://whs.imaddaou.com

    Thanks

    Imad
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Do you mean after the domain?
    You posted on Linux forum, but seem to be using ISPConfig?
    Anyway, on my ISPConfig maintained servers, domainname/phpmydmin and domainname/webmail has worked, and I have not done anything except what the Perfect Server Tutorial tells me to do. Both work with HTTPS if I have created certificate with Let's Encrypt.
     
  3. emaddaou

    emaddaou New Member

    Thanks Taleman for your help. Which Perfect Server Howto you used? I used the Nginx with Debian 9 version, everything works fine with me except the phpMyadmin Directives and roundcube which they don't work at port 8080 with SSL, I tried but they never worked. I guess the one you used is based on Apache, Apache version of the same howto works out of the box I believe, but Nginx version is tricky. None of the Nginx directive for phpmyadmin ever worked.

    My first method is to use the /webmail and /phpmyadmin after the server hostname and if it worker after customer's domain would be great too, hence I created a subdomain website called whs.imaddaou.com (that sub-domain represent the ISPconfig Hostname) with let's Encrypt enabled and used the following Nginx directive in order to force ISPconfig to use the default ssl port 443.
    # Force SSL
    if ($scheme = http) {
    return 301 https://$server_name$request_uri;
    }

    location / {
    proxy_pass https://whs.imaddaou.com:8080;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_http_version 1.1;
    }
    However, I have to disable the following entry otherwise the directive won't work by editing the Nginx whs.imaddaou.com file /etc/nginx/sites-enabled/100-whs.imaddaou.com.vhost and search the following line and disable it by commenting
    #location ~ \.php$ {
    # try_files /abe288f46bfb3fde2f9716a3f9f89f86.htm @php;
    # }
    Save and restart Nginx and

    I was hopping webmail and phpmyadmin will work after the ISPconfig hostname using the default port 443, they never worked not even with port 8080. They only work with port 8081 which has no ssl set.

    FYI, the Let's Encrypt enabled in whs.imaddaou.com allows me to use its ssl for other services as well since whs.imaddaou.com represent the ISPconfig hostname itself, hence, I don't to create cert manually using certbot.

    My second method is to create sub-domain websites such as webmail.imaddaou.com and phpmyadmin.imaddaou.com and use nginx directive to force SSL and port 443 for either webmail or phpmyadmin, I tired but I was not successful, I really need help. I hope Till or Falko shows us hwoto for once and everyone would be so happy :O)

    I would like to test both ways and be successful of setting both ways, either after the ISPconfig hostname/domain or by using sub-domains for each service directed by nginx directive.

    Thank you all for your help, your time is highly appreciated.

    Imad
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I use Apache, Debian 9.5 Stretch.
    /webmail and /phpmyadmin work with https, I have created certificates with LE. There is tutorial:
    https://www.howtoforge.com/tutorial/securing-ispconfig-3-with-a-free-lets-encrypt-ssl-certificate/
    I used the LE4ISPC method by @ahrasis. He uses NGINX, so I am confident it works both with Apache and NGINX.
    I'm not sure about the control panel without port number, however. Is it possible that has messed the setup and that causes your problems? But I have never needed to use port numbers with /webmail or /phpmyadmin, just with the control panel :8080.
     
  5. emaddaou

    emaddaou New Member

    Hi Taleman, I agree, I am going to take my chances and try, I am seeking a pro help from Fiverr too :)
     
  6. fifi220

    fifi220 New Member

    I guess the one you used is based on Apache, Apache version of the same howto works out of the box I believe,
     

Share This Page