How to change default port apache is listening to ?

Discussion in 'Developers' Forum' started by Keoz, Dec 3, 2020.

  1. Keoz

    Keoz Member

    Machine : remote VPS SSD
    OS distro : Ubuntu 18.04
    Web server : Apache2
    ISPCongig 3 : last version

    Couple of years ago, I asked if Apache and Nginx may both run on a VPS, and was replied (If I remember correctly) to better not do that, because it may prevent ISPConfig to work correctly (meaning that this may cause bugs, conflicts, failures, or whatever within it…).

    Today, in the purpose to install Azurcast app (webradio), I still tried to do so, following a tutorial instructions (link hereafter), that this sentence is a sample of that makes me felt somehow confident to proceed “For example, you could tell apache to listen on 127.0.0.1:8080 and instruct Nginx to reverse –proxy traffic to Apache while still serving static content“ :

    *** TUTORIAL ***
    https://hostadvice.com/how-to/how-to-configure-nginx-and-apache-together-in-ubuntu/

    *** PROBLEM ***
    While remotly connected to my VPS through local terminal, I entered the command line like shown in the tutorial , to change Apache default port 80 to 8080. But it seems that Apache default port setting is hard-coded : I can’t add, replace, overwrite anything to default port setting (80) :

    command line :
    nano /ect/apache2/ports.conf
    (I can’t modify settings)

    *** Q1 ***
    Why can’t I change this setting, or where else (within what other file) is it possible to do so ?
    *** Q2 ***
    Are there still reasons to consider that having both Apache and Nginx running on same server is a configuration that exceeds or unstablels ISPConfig 3 capacities ?

    Regards



    Regards
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    I have not tried this personally, but you could create a custom vhost.conf.master and put it in the conf-custom folder of ISPConfig. In that file you can define custom ports. Make sure apache doesn't run anything on port 80 and 443 (https) anymore and then fire up nginx as reverse proxy. I don't use nginx so not sure what would be the best way to do this. Also, it might be difficult to get HTTPS working properly.
     
  3. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Running multiple web server softwares in one server with ISPConfig is never recommended nor advisable as ISPConfig will only detect and use one i.e. if both exist, only apache2 will be selected as default webserver.

    @Th0m suggestion to use conf-custom should work but only to the extend that only apache2 web server will be configured and managed by ISPConfig, while you'll need to configure and manage nginx manually.

    That said, long time ago there were attempts to create nginx reverse proxy plugin for ISPConfig so they can be used hand in hand in a server but they were all at the end, abandoned.

    However, there is one other possible way for those with high enthusiasm in this two ISPConfig web servers approach i.e. one server with nginx as reverse proxy / load balancer and the other with apache2 as the pure web server.

    The above last paragraph is just a thought which I think may be easier and more workable with ISPConfig, but may not truely be so too. ;)
     
  4. Keoz

    Keoz Member

    As for next step, I do try to gain skills that helps to make nginx run as a proxy server for apache2. But it is not that simple, even whith the help of a tutorial (please see my new thread) : https://www.howtoforge.com/communit...-prior-to-set-nginx-as-a-reverse-proxy.85804/

    Regards
     

Share This Page