Author Topic: Changing default weewx page with mod_rewrite/apache2?  (Read 880 times)

0 Members and 1 Guest are viewing this topic.

Offline rovingmedics

  • Member
  • *
  • Posts: 2
Changing default weewx page with mod_rewrite/apache2?
« on: December 16, 2023, 06:27:52 PM »
Hi everyone,

I currently have a working weewx install at https://wx.mdt.fyi and a working Belchertown skin install at https://wx.mdt.fyi/belchertown and for some reason, I'm having a bit of trouble.

It's on a debian virtual machine with no other services running. My HTML root is default at /var/www/html/weewx. So from what I can tell, all of the html is being served from that directory.

I tried a mod_rewrite with .htaccess and it validates:

RewriteEngine On
RewriteRule ^/?(.*)$ /belchertown/$1 [R=301,L]

that .htaccess is in /var/www/html/weewx and there's even a copy in /var/www/html too. Yes, I also remembered to a2enmod rewrite and even stop/start Apache.

But everything is still loading from the default skin.

Is there a more sensible way to achieve my goal? The goal is basically to have the belchertown skin be the default one but I don't want to have anything break during an update.

Should I be trying to do this in an apache virtual host or is .htaccess sufficient?

cheers!
edit: I also tried changing the web root in both virtual hosts in sites-available. The two very basic .conf files from a basic Apache 2 install. One is simply the default-ssl.conf one. I checked the /etc/weewx/apache/weewx.conf file and from what I can tell, nothing in there is being used.

I restarted weewx. I restarted the entire server. I followed the directions on the Belchertown skin page for how to set it as default. Still no luck. I am stumped.

edit 2:
from my syslog, it seems like it's definitely generating information for both.

Dec 19 14:50:56 wx weewxd: weatherflowudp: MainThread: Listening for UDP broadcasts to IP address <broadcast> on port 50222, with timeout 90 and share_socket False...
Dec 19 14:50:56 wx weewx[653] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 0.48 seconds
Dec 19 14:50:57 wx weewx[653] INFO weewx.imagegenerator: Generated 11 images for report SeasonsReport in 0.18 seconds
Dec 19 14:50:57 wx weewx[653] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx
Dec 19 14:50:57 wx weewx[653] INFO weewx.cheetahgenerator: Generated 12 files for report Belchertown in 0.47 seconds
Dec 19 14:50:57 wx weewx[653] INFO weewx.reportengine: Copied 3 files to /var/www/html
Dec 19 14:55:58 wx weewx[653] INFO weewx.manager: Added record 2023-12-19 14:55:00 PST (1703026500) to database 'weewx.sdb'
Dec 19 14:55:58 wx weewx[653] INFO weewx.manager: Added record 2023-12-19 14:55:00 PST (1703026500) to daily summary in 'weewx.sdb'
Dec 19 14:55:58 wx weewxd: weatherflowudp: MainThread: Listening for UDP broadcasts to IP address <broadcast> on port 50222, with timeout 90 and share_socket False...
Dec 19 14:55:58 wx weewx[653] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 0.48 seconds
Dec 19 14:55:59 wx weewx[653] INFO weewx.imagegenerator: Generated 11 images for report SeasonsReport in 0.19 seconds
Dec 19 14:55:59 wx weewx[653] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx
Dec 19 14:55:59 wx weewx[653] INFO weewx.cheetahgenerator: Generated 12 files for report Belchertown in 0.47 seconds
Dec 19 14:55:59 wx weewx[653] INFO weewx.reportengine: Copied 3 files to /var/www/html
Dec 19 15:00:57 wx weewx[653] INFO weewx.manager: Added record 2023-12-19 15:00:00 PST (1703026800) to database 'weewx.sdb'
Dec 19 15:00:57 wx weewx[653] INFO weewx.manager: Added record 2023-12-19 15:00:00 PST (1703026800) to daily summary in 'weewx.sdb'
Dec 19 15:00:57 wx weewxd: weatherflowudp: MainThread: Listening for UDP broadcasts to IP address <broadcast> on port 50222, with timeout 90 and share_socket False...
Dec 19 15:00:57 wx weewx[653] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 0.48 seconds
Dec 19 15:00:58 wx weewx[653] INFO weewx.imagegenerator: Generated 33 images for report SeasonsReport in 0.91 seconds
Dec 19 15:00:58 wx weewx[653] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx
Dec 19 15:00:59 wx weewx[653] INFO weewx.cheetahgenerator: Generated 12 files for report Belchertown in 0.47 seconds
Dec 19 15:00:59 wx weewx[653] INFO weewx.reportengine: Copied 3 files to /var/www/html

edit: it was my fault. I had AllowOverride None still set in /etc/apache2/apache2.conf ... oops. Now I'm battling DNS. It's always DNS....
« Last Edit: December 19, 2023, 11:01:57 PM by rovingmedics »

 

anything