Apache2 setup new install of weewx

1,228 views
Skip to first unread message

Jimmy r

unread,
Aug 13, 2016, 10:16:58 PM8/13/16
to weewx-user
Getting The requested URL /weewx was not found on this server.. Trying to figure out what is wrong. the default Apache webpage shows up at http://192.168.1.129/

config.d
alias /weewx /home/weewx/public_html
<Directory /home/weewx/public_html>
  Options FollowSymlinks
  AllowOverride None
# for apache 2.2
  Order allow,deny
  Allow from all
# for apache 2.4
#  Require all granted
</Directory>

checked and index.html is in  /home/weewx/public_html

permissions on index.html
 -rw-r--r--  1 root  root  11152 Aug 14 02:05 index.html

any help would be great


Glenn McKechnie

unread,
Aug 13, 2016, 11:09:41 PM8/13/16
to weewx...@googlegroups.com
In the absence of an apache expert....

I don't recognize config.d , except as a vague memory.

For me, that config sits in /etc/apache2/conf-available/weewx.conf
with a symlink from /etc/apache2/conf-enabled
lrwxrwxrwx 1 root root 38 Mar 10 12:37 weewx.conf ->
/etc/apache2/conf-available/weewx.conf

Have you restarted apache?
systemctl restart apache2 or /etc/init.d/apache2 restart


What's in the logs?
Assuming /var/log/apache2 then
tail -f /var/log/apache2/*.log
(Ctrl C to exit)
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.



--

Cheers
Glenn

Jimmy r

unread,
Aug 14, 2016, 10:11:30 AM8/14/16
to weewx-user
yes the service has been restarted. log:
192.168.1.204 - - [14/Aug/2016:03:11:27 +0000] "GET / HTTP/1.1" 200 3419 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
192.168.1.204 - - [14/Aug/2016:03:11:35 +0000] "GET /weewx HTTP/1.1" 404 503 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
192.168.1.204 - - [14/Aug/2016:03:20:02 +0000] "GET /weewx HTTP/1.1" 404 503 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
192.168.1.204 - - [14/Aug/2016:03:20:11 +0000] "GET /weewx HTTP/1.1" 404 503 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
192.168.1.204 - - [14/Aug/2016:03:22:05 +0000] "GET /weewx HTTP/1.1" 404 503 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
192.168.1.204 - - [14/Aug/2016:03:22:09 +0000] "GET / HTTP/1.1" 200 3418 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
192.168.1.204 - - [14/Aug/2016:03:22:16 +0000] "GET /weewx HTTP/1.1" 404 503 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
192.168.1.204 - - [14/Aug/2016:03:22:26 +0000] "GET /weewx/index.html HTTP/1.1" 404 514 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
192.168.1.204 - - [14/Aug/2016:03:24:11 +0000] "GET /weewx/index.html HTTP/1.1" 404 514 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
192.168.1.204 - - [14/Aug/2016:03:24:14 +0000] "GET /weewx/ HTTP/1.1" 404 503 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"

==> /var/log/apache2/error.log <==
[Sun Aug 14 03:11:10.058005 2016] [core:notice] [pid 2476:tid 1996214272] AH00094: Command line: '/usr/sbin/apache2'
[Sun Aug 14 03:19:56.986519 2016] [mpm_event:notice] [pid 2476:tid 1996214272] AH00491: caught SIGTERM, shutting down
[Sun Aug 14 03:19:58.439578 2016] [mpm_event:notice] [pid 2638:tid 1996161024] AH00489: Apache/2.4.10 (Raspbian) configured -- resuming normal operations
[Sun Aug 14 03:19:58.440212 2016] [core:notice] [pid 2638:tid 1996161024] AH00094: Command line: '/usr/sbin/apache2'
[Sun Aug 14 03:21:59.621092 2016] [mpm_event:notice] [pid 2638:tid 1996161024] AH00491: caught SIGTERM, shutting down
[Sun Aug 14 03:22:01.114269 2016] [mpm_event:notice] [pid 2784:tid 1995943936] AH00489: Apache/2.4.10 (Raspbian) configured -- resuming normal operations
[Sun Aug 14 03:22:01.114889 2016] [core:notice] [pid 2784:tid 1995943936] AH00094: Command line: '/usr/sbin/apache2'
[Sun Aug 14 03:23:18.258074 2016] [mpm_event:notice] [pid 2784:tid 1995943936] AH00491: caught SIGTERM, shutting down
[Sun Aug 14 03:23:35.441406 2016] [mpm_event:notice] [pid 621:tid 1996025856] AH00489: Apache/2.4.10 (Raspbian) configured -- resuming normal operations
[Sun Aug 14 03:23:35.447418 2016] [core:notice] [pid 621:tid 1996025856] AH00094: Command line: '/usr/sbin/apache2'

==> /var/log/apache2/other_vhosts_access.log <==

Glenn McKechnie

unread,
Aug 14, 2016, 6:59:32 PM8/14/16
to weewx...@googlegroups.com
> [Sun Aug 14 03:23:35.441406 2016] [mpm_event:notice] [pid 621:tid
> 1996025856] AH00489: Apache/2.4.10 (Raspbian) configured -- resuming normal


Ah! Apache/2.4.10

Try commenting out the 2.2 line and enabling the 2.4 then restart apache2 .

ie:
config.d
alias /weewx /home/weewx/public_html
<Directory /home/weewx/public_html>
Options FollowSymlinks
AllowOverride None
# for apache 2.2
# Order allow,deny
# Allow from all
# for apache 2.4
Require all granted
</Directory>

Hopefully that will be enough (although the config.d still bothers me :-)

--

Cheers
Glenn

Jimmy r

unread,
Aug 14, 2016, 7:05:03 PM8/14/16
to weewx-user
same results page not found


Alias /weewx /home/weewx/public_html
<Directory /home/weewx/public_html>
  Options FollowSymlinks
  AllowOverride None
# for apache 2.2
# Order allow,deny
# Allow from all
# for apache 2.4
  Require all granted
</Directory>



[Sun Aug 14 23:02:11.449573 2016] [mpm_event:notice] [pid 621:tid 1996025856] AH00491: caught SIGTERM, shutting down
[Sun Aug 14 23:02:11.867279 2016] [mpm_event:notice] [pid 1543:tid 1995386880] AH00489: Apache/2.4.10 (Raspbian) configured -- resuming normal operations
[Sun Aug 14 23:02:11.867896 2016] [core:notice] [pid 1543:tid 1995386880] AH00094: Command line: '/usr/sbin/apache2'

Glenn McKechnie

unread,
Aug 14, 2016, 7:15:22 PM8/14/16
to weewx...@googlegroups.com
Hmmm,

List your apache root directory contents - probably under
/var/www/html There should be no visible link to weewx, no symlink,
no directory. If there is then move it aside (rename it) and restart

Then list your /etc/apache2 contents, in particular the
/etc/apache2/conf-enabled contents



Cheers
Glenn

Glenn McKechnie

unread,
Aug 14, 2016, 7:19:34 PM8/14/16
to weewx...@googlegroups.com
...and post those directory listings to the list. (I forgot to add /
clarify that)

It seems as though the Alias redirect is not being actioned on, either
something is in the way or it's not being read on a restart.
--

Cheers
Glenn

Jimmy r

unread,
Aug 14, 2016, 7:20:59 PM8/14/16
to weewx...@googlegroups.com
pi@raspberrypi:/var/www/html $ dir
index.html


pi@raspberrypi:/etc/apache2/conf-enabled $ dir
charset.conf                other-vhosts-access-log.conf  serve-cgi-bin.conf
localized-error-pages.conf  security.conf
pi@raspberrypi:/etc/apache2/conf-enabled $


 Glenn

--
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/Ekld1QtEgKo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.

Jimmy r

unread,
Aug 14, 2016, 7:22:09 PM8/14/16
to weewx-user
pi@raspberrypi:/var/www/html $ dir
index.html


pi@raspberrypi:/etc/apache2/conf-enabled $ dir
charset.conf                other-vhosts-access-log.conf  serve-cgi-bin.conf
localized-error-pages.conf  security.conf
pi@raspberrypi:/etc/apache2/conf-enabled $


Glenn McKechnie

unread,
Aug 14, 2016, 7:41:50 PM8/14/16
to weewx...@googlegroups.com
Okay html passes.

/etc/apache2 doesn't (make sense to me)

My understanding is that your config.d (I'm assuming it's named
config.d in your setup) is not visible to apache2...

alias /weewx /home/weewx/public_html
<Directory /home/weewx/public_html>
Options FollowSymlinks
AllowOverride None
# for apache 2.2
Order allow,deny
Allow from all
# for apache 2.4
# Require all granted
</Directory>

By convention, any of those specific config files, should live under
the /etc/apache2/conf-available directory and then be symlinked from
/etc/apache2/conf-enabled. That way apache2 knows to include it.

wherever that file is there should be a link to it from
/etc/apache2/conf-enabled, I don't see one under your listing so it
needs a symlink to it.

rename it to weewx.conf then copy it to /etc/apache2/conf-available/

then
ln -s /etc/apache2/conf-available/weewx.conf
/etc/apache2/conf-enabled/weewx.conf

then restart apache2 and fingers crossed.

p.s. use dir -al (or ls -al) I like to see it all ;-)

Jimmy r

unread,
Aug 14, 2016, 7:55:06 PM8/14/16
to weewx-user
i get:

Forbidden

You don't have permission to access /weewx on this server.


i ran the following:


 $ sudo ln -s /etc/apache2/conf-available/weewx.conf /etc/apache2/conf-enabled/weewx.conf

weewx@raspberrypi:~ $ sudo /etc/init.d/apache2 restart

[ ok ] Restarting apache2 (via systemctl): apache2.service.


weewx@raspberrypi:/etc/apache2/conf-available $ ls -al

total 32

drwxr-xr-x 2 root root 4096 Aug 14 23:53 .

drwxr-xr-x 8 root root 4096 Aug 14 01:43 ..

-rw-r--r-- 1 root root  315 Jul  5 21:22 charset.conf

-rw-r--r-- 1 root root 3224 Jul  5 21:22 localized-error-pages.conf

-rw-r--r-- 1 root root  189 Jul  5 21:22 other-vhosts-access-log.conf

-rw-r--r-- 1 root root 2190 Jul 20 06:41 security.conf

-rw-r--r-- 1 root root  455 Jul  5 21:22 serve-cgi-bin.conf

-rw-r--r-- 1 root root  225 Aug 14 23:45 weewx.conf






On Sunday, August 14, 2016 at 6:22:09 PM UTC-5, Jimmy r wrote:

Okay html passes.

/etc/apache2 doesn't (make sense to me)

My understanding is that your config.d (I'm assuming it's named
config.d in your setup) is not visible to apache2...

alias /weewx /home/weewx/public_html
<Directory /home/weewx/public_html>
  Options FollowSymlinks
  AllowOverride None
# for apache 2.2
  Order allow,deny
  Allow from all
# for apache 2.4
#  Require all granted
</Directory>

Glenn McKechnie

unread,
Aug 14, 2016, 8:08:02 PM8/14/16
to weewx...@googlegroups.com
On 15 August 2016 at 09:55, Jimmy r <jimmy...@gmail.com> wrote:
> i get:
>
> Forbidden
>
> You don't have permission to access /weewx on this server.
>

OK, Getting closer.

I copied the 2.2 config file as the example, it should have been the
2.4. So make the changes to reflect the 2.4 version

ie:

Alias /weewx /home/weewx/public_html
<Directory /home/weewx/public_html>
Options FollowSymlinks
AllowOverride None
# for apache 2.2
# Order allow,deny
# Allow from all
# for apache 2.4
Require all granted
</Directory>


> weewx@raspberrypi:/etc/apache2/conf-available $ ls -al
>
> total 32
>
> drwxr-xr-x 2 root root 4096 Aug 14 23:53 .
>
> drwxr-xr-x 8 root root 4096 Aug 14 01:43 ..
>
> -rw-r--r-- 1 root root 315 Jul 5 21:22 charset.conf
>
> -rw-r--r-- 1 root root 3224 Jul 5 21:22 localized-error-pages.conf
>
> -rw-r--r-- 1 root root 189 Jul 5 21:22 other-vhosts-access-log.conf
>
> -rw-r--r-- 1 root root 2190 Jul 20 06:41 security.conf
>
> -rw-r--r-- 1 root root 455 Jul 5 21:22 serve-cgi-bin.conf
>
> -rw-r--r-- 1 root root 225 Aug 14 23:45 weewx.conf

and as a sanity check,

ls -al /etc/apache2/conf-enabled

Tell me it now works :-) cause I'm getting near empty.

--

Cheers
Glenn

Jimmy r

unread,
Aug 14, 2016, 8:13:23 PM8/14/16
to weewx-user
page is loading now (thanks!) but the images don't show up just placeholders.

i edited the file again like you stated below
OK, Getting closer.

I copied the 2.2 config file as the example, it should have been the
2.4. So make the changes to reflect the 2.4 version

ie:

Alias /weewx /home/weewx/public_html

<Directory /home/weewx/public_html>
  Options FollowSymlinks
  AllowOverride None
# for apache 2.2
# Order allow,deny
# Allow from all
# for apache 2.4
  Require all granted
</Directory>

Glenn McKechnie

unread,
Aug 14, 2016, 8:20:33 PM8/14/16
to weewx...@googlegroups.com
Are they there?

ls -al /home/weewx/public_html

If you click on an image (to display only it in the browser page) what
does the message say, what is the link (URL) that's displayed

look in the apache logs for any relevant messages

ditto in /var/log/syslog for any weewx image specific messages (I
suspect this will be the most informative - but do all the above
beforehand ! )
Reply all
Reply to author
Forward
0 new messages