Skip to content

Integrating with a web server

If the server is on the same machine

The reports generated by WeeWX can be served by a web server running on the same machine as WeeWX. See the wiki article Configure a web server for how to do this.

If the server is on a different machine

Use FTP or RSYNC to transfer the files generated by WeeWX to your remote server. In WeeWX, FTP and RSYNC are implemented as reports. They are configured in the [StdReport] section of the WeeWX configuration file.

For example, the following configuration would use RSYNC to copy the html and images files from the standard report to a folder /var/www/html/weewx on the server wx.example.com:

[StdReport]
    [[RSYNC]]
        skin = Rsync
        server = wx.example.com
        path = /var/www/html/weewx
        user = wxuser

The following configuration would use FTP to copy the html and image files:

[StdReport]
    [[FTP]]
        skin = Ftp
        server = wx.example.com
        path = /weewx
        user = wxuser
        password = wxpass

It is possible to rsync or FTP more than one directory to the remote server. For example, suppose you have a home webcam that puts its images in /home/webcam/www. You want to FTP not only the files generated by WeeWX, but also these webcam images, to a remote server. The webcam images should go in a subdirectory webcam of the weewx directory. The solution is to include more than one FTP section under [[StdReport]]:

[StdReport]

    # Location of the generated reports, relative to WEEWX_ROOT
    HTML_ROOT = public_html

    ...

    # As before:
    [[FTP]]
        skin = Ftp
        server = wx.example.com
        path = /weewx
        user = wxuser
        password = wxpass

    # Add a second FTP. You can name it anything.
    [[webcam_FTP]]
        skin = Ftp
        # Override HTML_ROOT:
        HTML_ROOT=/home/webcam/www
        server = wx.example.com
        path = /weewx/webcam
        user = wxuser
        password = wxpass

See the documentation for the [[FTP]] and [[RSYNC]] sections of the configuration file weewx.conf for details and options.