Can i make ispconfig Interface accessible over alias path?

Discussion in 'Installation/Configuration' started by muelleks, Sep 11, 2024.

  1. muelleks

    muelleks New Member

    Hello all,

    at the first many many thanks for a very nice ispconfig and your help for all.
    I've been using ispconfig for a while and now I need help with a solution for a specific configuration

    I am using debian12 and have a standard perfect server installation.
    The ispconfig Interface is accessible over the Port 8080
    e.g. abc.com:8080

    Can I make it accessible via a specific directory?
    e.g. abc.com:8080/admin

    If i insert an alias into the vhost e.g. alias /admin/ /var/www/ispconfig I am always rewritten to abc.com:8080/login and not abc.com:8080/admin/login

    Must or can the root_base_dir be changed or something?
    I have seen in /usr/local/ispconfig/server/lib/config.inc.php and /usr/local/ispconfig/interface/lib/config.inc.php the option interface_base_url,
    but it doesn't work the way I need.

    Thanks again for all helps,
    Best Regards,
    muelleks
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I don't know why do you need to do that nor that I think it is possible. You may opt for other way like proxy or use a custom vhost as the alternative.
     
  3. muelleks

    muelleks New Member

    Hi,
    Ok thanks, I'll try configuring a haproxy or squid in front of it.
    Best Regards,
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Why do you want to do that? You can use proxy directives in Apache and Nginx and I'm sure that this is what @ahrasis refers to as it the default way to make the ISPConfig GUI accessible on another URL. So no need for any proxy software here.
     
  5. muelleks

    muelleks New Member

    I would like to make the ispconfig GUI accessible via /admin, the Roundcube is already accessible via /webmail but for / and everything else only a default or error page should be active
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    As @ahrasis mentioned, you can do that using proxy directives in Apache and Nginx. So no separate software needed.
     
  7. muelleks

    muelleks New Member

    Oh ok, thanks for this tip,
    I will see how to configure this with Apache proxy.
    What is the best place to do this?
    I configure this into a copy of
    apache_ispconfig.conf.master in the directory /usr/local/ispconfig/server/conf-custom/install ?
     
  8. pyte

    pyte Well-Known Member HowtoForge Supporter

    No just create a new site config at /etc/apache2/sites-available with the configuration needed and actiave it with a2ensite <name>.

    An example:

    Code:
    <VirtualHost *:443>
            SSLEngine on
    
            SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
            SSLHonorCipherOrder on
            SSLCipherSuite HIGH:!aNULL:!MD5:!3DES:!CBC
    
            SSLCertificateFile /usr/local/ispconfig/interface/ssl/ispserver.crt
            SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
    
            Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
    
            ServerName panel.domain.tld
            ServerAlias www.panel.domain.tld
    
            SSLProxyEngine on
            ProxyPreserveHost On
            ProxyRequests Off
            ProxyVia Off
            ProxyPass / https://localhost:8080/
            ProxyPassReverse / https://localhost:8080/
            ProxyPass .well-known/ !
    </VirtualHost>
    
    This is just an example with the ProxyPass configuration, you need to change these settings to match your specific requirements
     
    Strontium and ahrasis like this.
  9. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    better yet.. create it as a full website, or vhost subdomain in the ispconfig gui itself, and then just set the proxy settings in the webserver directives area on the options tab of the website settings.
     
    ahrasis, till and pyte like this.
  10. muelleks

    muelleks New Member

    Hi all,
    thanks for this tips,
    But i can not use this setup with a own subdomain.
    I need the ispconfig GUI accessible over a seperat directory and not over /

    With this apache proxy example i have the same problem that ispconfig rewrite me to the /login and not to /admin/login
     
  11. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    you can use this setup with a vhost subdomain, that does use it's own directory, regardless of that, you could still setup a subdomain address as it's own fully separate website in ispconfig

    and i'm not sure why you think the proxy rewrite going to /login and not /admin/login is a problem...
    i use the same settings on my own ispconfig control panel. logging into /login as the admin user works perfectly fine.
     
    till likes this.
  12. muelleks

    muelleks New Member

    Hi,
    Ok, sorry for my bad English and any possible misunderstanding.
    Either I described it poorly or incomprehensibly.

    I asked how and whether I could get the ispconfig GUI accessible via a directory.

    Not how I configure a subdomain or a vhost with subdomain.

    I can't run subdomains.
    Why doesn't matter here.

    Hence another example.

    I need access to the GUI via domain.tld:8080/admin

    Not via domain.tld:8080 and also not via my.domain.tld:8080

    I hope maybe someone has an idea about this.
    If anyone has a solution with subdomain, thank you but please don't write anymore.
    I can use multiple port bindings but no subdomains.

    Regards,
    muelleks
     
  13. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    That is not possible.
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, at least not that easily. Theoretically, he could try to change the port of the ISPConfig vhost to let's say 8082, then manually create a new vhost on port 8080 with a proxy config. But it does not make sense why 8080:/admin is needed while 8080:/ does not work.
     
  15. muelleks

    muelleks New Member

    Ok thanks again,
    I'll see how I can make it accessible.
     
  16. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    does the /admin part just need to be used in the requesting url, or does it actually need to be used in the redirected address, or both?

    hmm.. just wondering.. if he created the website domain.tld in ispconfig,

    could he not, in the options tab, under apache directives, not put all the proxy_pass settings inside
    Code:
    <Directory /var/www/domain.tld/web/admin/>
    
    </Directory>
    
    never tried creating a reverse proxy this way, looking at some of these, it seems it could be done with nginx...
    https://serverfault.com/questions/792326/nginx-proxy-pass-using-subfolder
    https://stackoverflow.com/questions...e-proxy-subdirectory-rewrites-for-sourcegraph

    no idea if apache would allow this though.
     
  17. muelleks

    muelleks New Member

    Hi,
    /admin is required for all access to the GUI.
    The problem is that ispconfig always rewrites itself to / or /login after login or logout and not to my new basedir /admin/ or /admin/login
    I'll try out whether Apache can do that or I'll test nginx.
    Regards,
     
  18. pyte

    pyte Well-Known Member HowtoForge Supporter

    Can you elaborate why you want to change the default behaviour in such a way? Even if it is possible to achieve such a configuration change what is the benefit of it and why do you need it to behave like that? Maybe there is some misunderstanding
     
  19. muelleks

    muelleks New Member

    Hi,
    I've now solved it with redirect and it looks like it's working the way I need it.

    Alias /webadmin/ /var/www/ispconfig/
    RedirectMatch 301 ^/index\.php$ https://mydomain.tld:8080/webadmin/index.php
    RedirectMatch 301 ^/capp\.php$ https://mydomain.tld:8080/webadmin/capp.php
    RedirectMatch 301 ^/nav\.php$ https://mydomain.tld:8080/webadmin/nav.php
    RedirectMatch 301 ^/keepalive\.php$ https://mydomain.tld:8080/webadmin/keepalive.php
    RedirectMatch 301 ^/datalogstatus\.php$ https://mydomain.tld:8080/webadmin/datalogstatus.php
    RedirectMatch 301 ^/login/$ https://mydomain.tld:8080/webadmin/login/
    RedirectMatch 301 ^/themes/$ https://mydomain.tld:8080/webadmin/themes/
    RedirectMatch 301 ^/js/$ https://mydomain.tld:8080/webadmin/js/
    RedirectMatch 301 ^/dashboard/$ https://mydomain.tld:8080/webadmin/dashboard/
    RedirectMatch 301 ^/client/$ https://mydomain.tld:8080/webadmin/client/
    RedirectMatch 301 ^/tools/$ https://mydomain.tld:8080/webadmin/tools/
    RedirectMatch 301 ^/mail/$ https://mydomain.tld:8080/webadmin/mail/
    RedirectMatch 301 ^/mailuser/$ https://mydomain.tld:8080/webadmin/mailuser/

    Regards,
    Muelleks
     
    ahrasis likes this.

Share This Page