problem changing location of index.html from default

Discussion in 'Apache' started by bill_w, Apr 1, 2018.

  1. #1
    I have somewhat of a NOOBIE question.

    I am using the 3-13-18 release of Stretch on a Raspberry Pi B+ with the latest release of apache2 loaded by sudo apt-get install apache2. I am setting up the weather station program Weewx. It locates its files, including index.html, in /var/www/html/weewx.

    Thus, the weather station is reached by address:port/weewx. I would like it to be reached directly by address:port. A quick Google of this task tells me to edit 000-default.conf within
    /etc/apache2/sites-enabled so that DoumentRoot points to my page (DocumentRoot /var/wwww/html/weewx).

    Simple enough, except it does not work. After saving this change and restarting apache2 or rebooting, I am still going to the original default index.html.

    I am at a loss as to what could be wrong. I suspect that apache2 has been revised and there are now other steps needed. I was not able to find anything useful in the manual.

    Can someone point me in the right direction (no pun intended)?
     
    Last edited: Apr 1, 2018
    bill_w, Apr 1, 2018 IP
  2. RoseHosting

    RoseHosting Well-Known Member

    Messages:
    230
    Likes Received:
    11
    Best Answers:
    11
    Trophy Points:
    138
    #2
    Is Weewx listening on a different port than Apache? If so, changing the DocumentRoot directory will not have an effect because the web server is not serving the requests to 'address:port/weewx'.

    In this case you can use mod_proxy to configure Apache as a reverse proxy so it can handle and pass the requests to your Weewx application. And you will be able to access the application at http:// address For example:

    ProxyRequests Off
    
      <Proxy *>
      Order deny,allow
      Allow from all
      </Proxy>
    
      ProxyPass / http://address:port/weewx/
      ProxyPassReverse / http://address:port/weewx/ 
    Code (markup):
     
    RoseHosting, Apr 4, 2018 IP
  3. bill_w

    bill_w Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Yup, that was it. Thank you. Actually I just changed the port back to 80. I only needed the initial testing at a different port.
     
    bill_w, Apr 5, 2018 IP