Apache is not showing /weewx on Ubuntu 16.04.1

1,040 views
Skip to first unread message

Vlad Rafeev

unread,
Jul 26, 2016, 3:11:29 PM7/26/16
to weewx-user
I am following this tutorial

1. I have installed clean Ubuntu 16.04.1
2. I have installed weewx from DEB package
3. I have installed apache2 with "sudo apt-get install apache2" command
4. I see test Apache page on localhost (its working)

When I open http://localhost/weewx, I see 404 error.

What could have gone wrong? Where should I look for a troubleshoot?

vince

unread,
Jul 26, 2016, 5:31:29 PM7/26/16
to weewx-user

You didn't add a symbolic link from your apache2 document root to the public_html tree weewx writes to.

Vlad Rafeev

unread,
Jul 27, 2016, 2:52:30 AM7/27/16
to weewx...@googlegroups.com
Thank you, I will try.

Do you think it is my fault? Or documentation should be updated with your advice?

Andrew Milner

unread,
Jul 27, 2016, 3:58:45 AM7/27/16
to weewx-user
It is either :
a) you not understanding how to make apache serve web pages that are not immediately in the apache2 root tree
or
b) you not configuring weewx to make the pages within the apache tree

weewx is set up to create the pages in weewx/public_html and then ftp them top a web server hosted externally.  If your web server is local to weewx then you have got options a and b above, and the instructions are for option b) above I think.

gjr80

unread,
Jul 27, 2016, 4:47:41 AM7/27/16
to weewx-user
Actually, if the issue was a Vince pointed out:


You didn't add a symbolic link from your apache2 document root to the public_html tree weewx writes to.

then I think under the circumstances it may not have been you and rather the docs could be at fault.


I am following this tutorial

1. I have installed clean Ubuntu 16.04.1
2. I have installed weewx from DEB package
3. I have installed apache2 with "sudo apt-get install apache2" command
4. I see test Apache page on localhost (its working)

The OP did a deb package install and the link he is following clearly says all you need do is install apache2 and then go to http://localhost/weewx. The bit about copying conf files etc clearly applies to a setup.py install which the OP does not have.

If there is a need to so something else other then 'install apache2 and then open http://localhost/weewx' then perhaps the docs need a bit of clarrification/further guidance. That being said, I am not an apache2 user.

Gary

Andrew Milner

unread,
Jul 27, 2016, 5:19:59 AM7/27/16
to weewx-user
You're probably right in that it looks as though the guide assumes apache2 is installed first, before the deb install - although there then appear to be some linguistic issues with present tense used when maybe it should be future!! I don't use apache2 either - preferring lighttpd on my rpi.

Vlad Rafeev

unread,
Jul 27, 2016, 5:29:25 AM7/27/16
to weewx-user
> First, install a web server on the computer on which weewx is running

From this line it is clear, that weewx is already running. So I install apache2 according to this guide.

The correct sequence is to install apache2 first and add weewx later?

Andrew Milner

unread,
Jul 27, 2016, 5:58:45 AM7/27/16
to weewx-user
The simple answer is to do what Vince said - put a symbolic link in the apache root.

Looking at other instructions, out of curiosity - from the quick start guide:

After about 5 minutes, open the station web page in a web browser. You should see your station information and data.

file:///var/www/weewx/index.html

If your hardware supports hardware archiving, then how long you wait will depend on the archive interval set in your hardware.


does the browser find the page??


Although if you have changed things in weewx.conf the files could now be being put into different places!!

vince

unread,
Jul 27, 2016, 1:13:03 PM7/27/16
to weewx-user
The alternate solution is for you to edit weewx.conf to have it save its files in the place the webserver expects things.

The underlying issues are:
  • there are lots of webservers to pick from, they pick different locations for document root
  • operating systems differ in where they set the webserver document root
  • 'versions' of a particular operating system also can change where they set this

So weewx can't possibly keep track of this, there are too many ever-changing upstream providers of software.


The user/admin 'must' have enough knowledge to know how to get the files weewx generates into

the place 'they' want them to appear when viewed from a web browser.  There is no one-true-answer.



Vlad Rafeev

unread,
Jul 27, 2016, 3:01:32 PM7/27/16
to weewx...@googlegroups.com
Vince, thank you for clearing this out. I think your great explanation deserves to be included in the documentation. Right now it feels like everything should work out of the box, which is clearly not the case.


---
Влад Рафеев

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/kzXjvLjWI-k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Keffer

unread,
Jul 27, 2016, 4:47:09 PM7/27/16
to weewx-user
I am not an apache expert either, but from what I can tell, the problem is that the weewx Debian installs sets HTML_ROOT incorrectly. It's being set to /var/www, when it should be /var/www/html

Because of this, the HTML files are being put in a directory that is not accessible to the Apache server, at least not without modifying its configuration file.

Try going into /etc/weewx/weewx.conf and changing the lines

    # Where the generated reports should go, relative to WEEWX_ROOT
    HTML_ROOT = /var/www/weewx
 
to

    # Where the generated reports should go, relative to WEEWX_ROOT
    HTML_ROOT = /var/www/weewx/html
 
then restart weewx.

If my diagnosis is correct, I'm amazed that this problem has been sitting here all this time. Perhaps Apache changed the default DocumentRoot recently?

-tk


--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

mwall

unread,
Jul 27, 2016, 5:50:56 PM7/27/16
to weewx-user
On Wednesday, July 27, 2016 at 4:47:09 PM UTC-4, Tom Keffer wrote:
I am not an apache expert either, but from what I can tell, the problem is that the weewx Debian installs sets HTML_ROOT incorrectly. It's being set to /var/www, when it should be /var/www/html

blame it on more redhat-ification (and disregard for users) of debian.

in debian 7 and earlier, DocumentRoot was /var/www

in debian 8, DocumentRoot is /var/www/html

in redhat and suse, DocumentRoot has been /var/www/html for quite some time

there are at least two solutions:

a) modify HTML_ROOT in weewx.conf:

sudo sed -i -e 's%HTML_ROOT =.*%HTML_ROOT = /var/www/html/weewx%' /etc/weewx/weewx.conf

b) create a symlink to the weewx report directory:

sudo ln -s ../weewx /var/www/html

i tend to prefer the latter, especially for systems such as rpi where the weewx reports are on a tmpfs to minimize sd card wear.

i have not yet figured out a solution for the weewx .deb package that will work out-of-the-box with pre deb8 and post deb8 systems.  it would be nice if it worked with lighthttpd and nginx web servers as well as apache.

m

Thomas Keffer

unread,
Jul 27, 2016, 5:56:56 PM7/27/16
to weewx-user
Mystery solved! Thanks, Matthew

I've started issue #137 to track it.

-tk

--

mark Frost

unread,
Sep 13, 2016, 5:04:01 PM9/13/16
to weewx-user

sorry about this guys, I'm quite unskilled when it comes to this stuff. I've installed sqlite and apache2 using apt and then weewx using dpkg. It seems to be running but i cannot see the server through a browser or locate pages and config etc. i see that there is an issue regarding default locations for config and the actual html interface page. ive read the thread here and on sourceforge but i think i have been unable to find a sequence of commands and configurations that works. i'm using bodhilinux3 so that ought to be equiv to ubuntu 16?

thanks in advance fr your help. 

Mark

mark Frost

unread,
Sep 13, 2016, 5:41:15 PM9/13/16
to weewx-user
fyi, i've updated my config to include wunderground and other upload variables. the config says default root file is /var/www/html/weewx. there is a file of that name in that directory but it cannot be found by a browser and if i open it in terminology it contains a single char....1 and nothing else. im not sure my config changes are going through as i think i may have a permission issue there.

Jan Valkenier

unread,
Sep 16, 2016, 3:28:31 PM9/16/16
to weewx-user
How did you guys configure Apache?
Apache2 for instance is able to serve multiple/different sites from different directories based on the requesting url.

I created a virtualhost in Apache based on the url, which tells Apache to serve the weewx pages from the directory where they are located.
You could read this:
https://help.ubuntu.com/lts/serverguide/httpd.html

i placed

DocumentRoot /var/www/weewx

In the configuration file for the site, and this works

Michael Grossie

unread,
Jul 12, 2020, 1:18:09 PM7/12/20
to weewx-user
This is a very old thread - but it relates to my question - with the exception of Ubuntu
Raspberry Pi 2 B
Raspbian Stretch
Station: Argent WS1

I have got Apache2 installed, followed the setup and completed the Apache configuration snippet. I have checked and the various files and directories are in place, however I do not find the /home/weewx/public_html file.
Since I am not connected to active weather instruments at this time, could it be that this file will not be created until the weewx program receives data - 
the http://localhost/weewx  gives me a 404 page not found error.

TIA

Michael Grossie

unread,
Jul 12, 2020, 2:59:03 PM7/12/20
to weewx...@googlegroups.com
Answered one of my questions - I changed the Weather Station to Simulator and the weewx/public_HTML folder was created and populated.
However running http://localhost/weewx  yields the Page Not Found error.
 
 
Michael H Grossie


--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/kzXjvLjWI-k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/7ff66258-27e1-4418-83c2-11ed49e5c77an%40googlegroups.com.

Andre

unread,
Jul 12, 2020, 3:41:13 PM7/12/20
to weewx-user
First, take a look to your weewx.conf
Section [StdReport]
There is HTML_ROOT = /path/name/path

If you have only have one website you can point to your default Apache2 path or you can edit your /etc/apache2/sites-available/000-default.conf
After editing restart Apache2 with sudo /etc/init.d/apache2 restart


To unsubscribe from this group and all its topics, send an email to weewx...@googlegroups.com.

Michael Grossie

unread,
Jul 12, 2020, 6:01:25 PM7/12/20
to weewx...@googlegroups.com
Andre,
Thanks for the response - in the [StdReport] section of the weewx.conf, it shows, "where generated reports should go, relative to WEEWX_ROOT  HTML_ROOT= public_HTML"

Since the station is set to Simulation, will there be any reports generated?

TIA
 
 
Michael H Grossie


To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/0a0eeb25-e5b4-4767-a254-92168ff6ed72o%40googlegroups.com.

Graham Eddy

unread,
Jul 13, 2020, 12:39:10 AM7/13/20
to weewx...@googlegroups.com
it’s all very clear in the manual.
see User Guide, “Integrating with a Web Server”.
cheers

You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAJBcQpULnR__KfkROV3owpF1vTV2H3u5RR_QsF_pAGkQhwQm4g%40mail.gmail.com.

Andrew Milner

unread,
Jul 13, 2020, 1:17:58 AM7/13/20
to weewx-user
setting station type to simulator effectively creates a station which pretends to create data and gives the data to weewx.  weewx then does everything it should do with the 'received' data including generate reports.  it will also store the dta in the database, so when you have finished using simulator you will need to clear out the simulation data from the database - usually just deleting the database file is sufficient.

Michael Grossie

unread,
Jul 13, 2020, 9:56:24 AM7/13/20
to weewx...@googlegroups.com
Mr. Eddy;
Raspberry Pi 2 B
Raspbian Stretch
Station: Argent WS1

Following the instructions in the User Guide for a setup.py installation, I have gotten Apache2 installed. I followed the setup and completed the Apache configuration snippet. I have checked and all the various files and directories are in place, including the /home/weewx/public_html file.
The http://localhost/weewx  gives me a 404 page not found error.
 Since I am not connected to active weather instruments at this time, could it be that this file will not be created until the weewx program receives data - (nothing in the User Manual concerning this question.)
Again the procedures listed in the user manual were followed for a setup.py installation.
Andrew, politely has answered one of the questions concerning the Simulator Station.
Michael H Grossie


Michael Grossie

unread,
Jul 13, 2020, 9:58:38 AM7/13/20
to weewx...@googlegroups.com
Andrew,

Thanks for the response - That answered my question regarding the Simulator Station. I now need to find out where the data it is generating is going. 
 
 
Michael H Grossie


To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/1b232c4f-e536-4ab5-9952-ea862c0576cfo%40googlegroups.com.

John Kline

unread,
Jul 13, 2020, 10:09:24 AM7/13/20
to weewx...@googlegroups.com
The log will tell you where reports are being written.  Look for a line like the following:

Jul 12 00:20:07 charlemagne weewx[22501] INFO weewx.reportengine: Copied 119 files to /home/weewx/public_html

On Jul 13, 2020, at 6:58 AM, Michael Grossie <mhgr...@sbcglobal.net> wrote:


You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAJBcQpVDsV6kNeLXnY_xgFtqNnVbu1CBmVb7rgeJDRPJ7A1rpA%40mail.gmail.com.

Andrew Milner

unread,
Jul 13, 2020, 10:15:31 AM7/13/20
to weewx-user
if you used setup.py the .sdb file will be in /home/weewx/archive and should contain all your simulator data.  It may be useful to edit weewx.conf and set debug=1 to get more detailed logging - remember to set it back to 0 when you have finished.




On Monday, 13 July 2020 16:58:38 UTC+3, Michael Grossie wrote:
Andrew,

Thanks for the response - That answered my question regarding the Simulator Station. I now need to find out where the data it is generating is going. 
 
 
Michael H Grossie


Andrew Milner

unread,
Jul 13, 2020, 10:16:14 AM7/13/20
to weewx-user

Michael Grossie

unread,
Jul 13, 2020, 12:53:53 PM7/13/20
to weewx...@googlegroups.com
In trying to find folders and files are at, they are all in the proper places (based on the list in the User Guide) - I ran 
"sudo /etc/init.d/weewx status -l" from the /home/weewx directory.  I received the following -
pi@raspberrypi:/home/weewx $ sudo /etc/init.d/weewx status -ls
● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated; vendor preset: enabled)
   Active: active (running) since Mon 2020-07-13 11:10:24 CDT; 28min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 281 ExecStart=/etc/init.d/weewx start (code=exited, status=0/SUCCESS)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/weewx.service
           └─558 /usr/bin/python2 /home/weewx/bin/weewxd --daemon --pidfile=/var/run/weewx.pid /home/weewx/weewx.conf

Jul 13 11:35:18 raspberrypi weewxd[558]: weewx[558] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reporteng…0, in run
Jul 13 11:35:18 raspberrypi weewxd[558]: weewx[558] ERROR weewx.reportengine:         ****      obj = weeutil.weeutil.get_object(generator)(
Jul 13 11:35:18 raspberrypi weewxd[558]: weewx[558] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weeutil/weeutil…et_object
Jul 13 11:35:18 raspberrypi weewxd[558]: weewx[558] ERROR weewx.reportengine:         ****      mod = __import__(module)
Jul 13 11:35:18 raspberrypi weewxd[558]: weewx[558] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/cheetahge… <module>
Jul 13 11:35:18 raspberrypi weewxd[558]: weewx[558] ERROR weewx.reportengine:         ****      import Cheetah.Filters
Jul 13 11:35:18 raspberrypi weewxd[558]: weewx[558] ERROR weewx.reportengine:         ****  ImportError: No module named Cheetah.Filters
Jul 13 11:35:18 raspberrypi weewxd[558]: weewx[558] ERROR weewx.reportengine:         ****  Generator ignored
Jul 13 11:35:20 raspberrypi weewxd[558]: weewx[558] INFO weewx.imagegenerator: Generated 15 images for report SeasonsReport in 1.96 seconds
Jul 13 11:35:20 raspberrypi weewxd[558]: weewx[558] INFO weewx.reportengine: Copied 0 files to /home/weewx/public_html
Hint: Some lines were ellipsized, use -l to show in full.

 
Looking in /home/weewx/bin/weewx I can see the files (reportengine, cheetahgenerator). I will reload Cheetah3 and see what happens.

Michael H Grossie


To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/cff77065-309c-454d-aab6-2096c20784bbo%40googlegroups.com.

Michael Grossie

unread,
Jul 13, 2020, 1:30:20 PM7/13/20
to weewx...@googlegroups.com
After reloading cheetah, I rebooted, started weewx and apache2. I opened a browser and went to http://localhost/weewx (as directed in the User Guide) and received the 404 page not found error.

I then ran "sudo /etc/init.d/weewx status -l"  and received -
pi@raspberrypi:/home/weewx $ sudo /etc/init.d/weewx status -l
● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated; vendor preset: enabled)
   Active: active (running) since Mon 2020-07-13 12:03:01 CDT; 18min ago

     Docs: man:systemd-sysv-generator(8)
  Process: 281 ExecStart=/etc/init.d/weewx start (code=exited, status=0/SUCCESS)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/weewx.service
           └─497 /usr/bin/python2 /home/weewx/bin/weewxd --daemon --pidfile=/var/run/weewx.pid /home/weewx/weewx.conf

Jul 13 12:15:16 raspberrypi weewxd[497]: weewx[497] INFO weewx.manager: Added record 2020-07-13 12:15:00 CDT (1594660500) to database 'weewx.sdb'
Jul 13 12:15:16 raspberrypi weewxd[497]: weewx[497] INFO weewx.manager: Added record 2020-07-13 12:15:00 CDT (1594660500) to daily summary …weewx.sdb'
Jul 13 12:15:21 raspberrypi weewxd[497]: weewx[497] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 3.39 seconds
Jul 13 12:15:25 raspberrypi weewxd[497]: weewx[497] INFO weewx.imagegenerator: Generated 15 images for report SeasonsReport in 3.65 seconds
Jul 13 12:15:25 raspberrypi weewxd[497]: weewx[497] INFO weewx.reportengine: Copied 0 files to /home/weewx/public_html
Jul 13 12:20:16 raspberrypi weewxd[497]: weewx[497] INFO weewx.manager: Added record 2020-07-13 12:20:00 CDT (1594660800) to database 'weewx.sdb'
Jul 13 12:20:16 raspberrypi weewxd[497]: weewx[497] INFO weewx.manager: Added record 2020-07-13 12:20:00 CDT (1594660800) to daily summary …weewx.sdb'
Jul 13 12:20:21 raspberrypi weewxd[497]: weewx[497] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 3.79 seconds
Jul 13 12:20:34 raspberrypi weewxd[497]: weewx[497] INFO weewx.imagegenerator: Generated 30 images for report SeasonsReport in 12.33 seconds
Jul 13 12:20:34 raspberrypi weewxd[497]: weewx[497] INFO weewx.reportengine: Copied 0 files to /home/weewx/public_html

Hint: Some lines were ellipsized, use -l to show in full.

 
Now I see that records were added and reports generated, but nothing transferred to /home/weewx/public_html
I am still missing something - I don't know if I have a program installed to view the contents of weewx.sdb
Michael H Grossie

Michael Grossie

unread,
Jul 13, 2020, 1:49:48 PM7/13/20
to weewx...@googlegroups.com
Installed sqlitebrowser. Opened weewx.sdb and did see records had been created. So, why does it not write to "weewx/public_html?"
 
 
Michael H Grossie

Michael Grossie

unread,
Jul 17, 2020, 10:33:05 PM7/17/20
to weewx...@googlegroups.com
I have found the index.html file in /home/weewx/public_html. I still cannot access it with http://localhost/weewx - I need to use the full path - but I can get to it and it does show data.
 
Michael H Grossie

Greg from Oz

unread,
Jul 18, 2020, 6:55:27 AM7/18/20
to weewx-user
Maybe if you create a weewx.conf file in /etc/apache2/sites-available and call it weewx.conf

Put this in the file:

Alias /weewx "/home/weewx/public_html"
    <Directory "/home/weewx/public_html">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
        Require all granted
    </Directory>

Save the file.

 Then run sudo a2ensite weewx.conf   (this enables the site)

Then reload apache


I am not an expert either and don't have a raspbaerry pi running apache.

Good luck. I don't guarantee this will work but hey! you never know. 

Michael Grossie

unread,
Jul 18, 2020, 10:38:13 AM7/18/20
to weewx...@googlegroups.com
Greg - works like a charm - thanks for the advice and for explaining -

 
 
Michael H Grossie


Greg from Oz

unread,
Jul 18, 2020, 7:44:44 PM7/18/20
to weewx-user
WOW..I MUST be an expert hhaha.
Glad it works.
I don't have raspberry but I took that code from my Ubuntu server, so I guess it would work.
I run proxmox and 5 virtual machines on a Dell  r210 ii and it only draws 35 watts.
Reply all
Reply to author
Forward
0 new messages