Re: [Dorset] nginx Setup / Configuration

2017-02-18 Thread Ralph Corderoy
Hi Terry,

> > What's the user, group, and permissions on /var/www, e.g. `ls -ld
> > /var/www'?
>
> The content is in /var/www/html.  Is it the permissions of that
> directory or the higher one?

That one, sorry.  I took the `html directory at /var/www' as a
description of /var/www.  :-)

Cheers, Ralph.

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] nginx Setup / Configuration

2017-02-18 Thread John Carlyle-Clarke
Hi Terry. It's probably file permissions. Check what user the nginx server
runs as, and make sure they have access to the files. They will need rx
permission at least to every directory down to them from / as well, I
believe.

To check, switch to root then do:

 sudo -i -u nginx

(Replace nginx with the actual user name)

Then make sure you can read one of the files.

If you can't get a shell that way, try:

sudo -u nginx bash


On 18 Feb 2017 5:14 pm, "Terry Coles"  wrote:

> Hi,
>
> Back in August we had some discussion about setting up a webserver to run
> in a walled
> garden (literally :-) ) at the Wimborne Model Town.  As a proof of
> concept, I created two
> simple pages (Audio Guide and Kiddies Quiz, see below) and put them onto a
> Raspberry Pi
> running nginx.  At the time they worked perfectly when I connected the Pi
> to a Wireless AP
> mounted on a pole in the corner of the site.  (I was able to use both
> functions from my
> phone.)
>
> Since then, we've pretty much concentrated on the bells project and I've
> only picked this
> up again in the last few days.  The problem is, that I can't get access to
> the two pages
> anymore ;-(  I can connect to the nginx landing page at the root of the
> server, but anything
> else gives me an error 403 (do not have permission to view the page).
>
> Quite a few things have changed since then and I confess that I never
> tested the original
> SD Card before I copied it and went through a full upgrade + installation
> of the code for
> the UPS Pico that we are using.
>
> The problem seems to come down to the fact that I can no longer access the
> content that
> I've copied into the html directory at /var/www.  Worse, I've just plugged
> the original SD
> Card into my old Pi 2 (not the Pi 3 we are using for the WMT) and I'm
> getting the same
> problem.
>
> The only other thing that has changed since then is the router (I'm not
> even trying to
> access the Pi from an independent AP yet), but since I can get to the
> nginx landing page, I
> can't see that that is relevant.
>
> Any ideas what could be going on here?
>
> The latest pages are working on my website at:
>
> http://hadrian-way.co.uk/Audio_Guide/audio_guide.html
>
> and
>
> http://hadrian-way.co.uk/Kiddies_Quiz/index.html[1]
>
> --
>
>
>
> Terry Coles
>
> 
> [1] http://hadrian-way.co.uk/Kiddies_Quiz/index.html
> --
> Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
> Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
> New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
> Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR
-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] nginx Setup / Configuration

2017-02-18 Thread Terry Coles
On Saturday, 18 February 2017 17:47:32 GMT Ralph Corderoy wrote:
Ralph,

I've got a few things to do tonight, so won't get onto this until tomorrow.  
In the meantime:

> Does your nginx set-up have /etc/nginx/sites-{available,enabled}?  Are
> symlinks in the latter pointing at configuration files in the former?
> Might just be `default' unless you've added others.

Just the default is enabled.  I think that is needed to get the nginx landing 
page to work anyway.

> What's the user, group, and permissions on /var/www, e.g. `ls -ld
> /var/www'?

The content is in /var/www/html.  Is it the permissions of that directory or 
the higher one?

> Create a simple file in there.
> 
> sudo sh -c 'date >/var/www/now.txt'
> sudo chmod 444 /var/www/now.txt

Again.  Should this be in /var/www/html?

> And then attempt to fetch that with curl(1) so the complicted browser
> isn't involved.  What `hostname' are you using in the URL?
> 
> curl -sS http://127.1/now.txt   # On the Pi.
> curl -sS http://FIXME/now.txt   # Elsewhere.

I'll report back tomorrow.

Thanks.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] nginx Setup / Configuration

2017-02-18 Thread Ralph Corderoy
Hi Terry,

> The problem is, that I can't get access to the two pages anymore ;-( I
> can connect to the nginx landing page at the root of the server, but
> anything else gives me an error 403 (do not have permission to view
> the page).
...
> The problem seems to come down to the fact that I can no longer access
> the content that I've copied into the html directory at /var/www.

If you stop nginx, e.g. `sudo systemctl stop nginx', does the browser
now fail to connect?  You might have to Shift-Reload to persuade it to
try again.  That will suggest you are talking to the correct server.

Is nginx writing to log files, e.g. /var/log/nginx/*.log?  Anything
useful at the end of those?  You can watch them with `tail -F *.log'
during your attempts.  Hit Enter a few times to get some blank lines so
you can see what's new.

Does your nginx set-up have /etc/nginx/sites-{available,enabled}?  Are
symlinks in the latter pointing at configuration files in the former?
Might just be `default' unless you've added others.

What's the user, group, and permissions on /var/www, e.g. `ls -ld
/var/www'?

Create a simple file in there.

sudo sh -c 'date >/var/www/now.txt'
sudo chmod 444 /var/www/now.txt

And then attempt to fetch that with curl(1) so the complicted browser
isn't involved.  What `hostname' are you using in the URL?

curl -sS http://127.1/now.txt   # On the Pi.
curl -sS http://FIXME/now.txt   # Elsewhere.

Cheers, Ralph.

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Fwd: SSH into Raspberry Pi Problems

2017-02-18 Thread PeterMerchant via dorset
For the last little while, I have not been able to access my R-Pi 
software after creating new SD cards. I thought it was something that I 
have done wrong.


Now I find out it isn't

www.raspberrypi.org/documentation/remote-access/ssh/


   3. ENABLE SSH

As of the November 2016 release, Raspbian has the SSH server disabled by 
default. You will have to enable it manually. This is done 
usingraspi-config 
:


There is a workaround apparently.

For headless setup, SSH can be enabled by placing a file named 'ssh', 
without any extension, onto the boot partition of the SD card.



Because I don't have another means of connecting to my R-Pi.

*Bah*

Peter

--
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] SSH into Raspberry Pi Problems

2017-02-18 Thread Terry Coles
On Saturday, 18 February 2017 10:09:42 GMT PeterM wrote:
> For the last little while, I have not been able to access my R-Pi
> software after creating new SD cards. I thought it was something that I
> have done wrong.
> 
> Now I find out it isn't
> 
> www.raspberrypi.org/documentation/remote-access/ssh/
> 
> 
> 3. ENABLE SSH
> 
> As of the November 2016 release, Raspbian has the SSH server disabled by
> default. You will have to enable it manually. This is done
> usingraspi-config
> :
> 
> There is a workaround apparently.
> 
> For headless setup, SSH can be enabled by placing a file named 'ssh',
> without any extension, onto the boot partition of the SD card.
> 
> 
> Because I don't have another means of connecting to my R-Pi.
> 
> *Bah*

Peter,

The change was not unreasonable, because the device was wide open otherwise, 
with SSH on by default, with login to a default username and password.

Do you really not have any means to access the Pi other than SSH?  I bought a 
cheap HDMI to VGA adapter off amazon and an almost equally cheap mouse and 
keyboard.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] nginx Setup / Configuration

2017-02-18 Thread Terry Coles
Hi,

Back in August we had some discussion about setting up a webserver to run in a 
walled 
garden (literally :-) ) at the Wimborne Model Town.  As a proof of concept, I 
created two 
simple pages (Audio Guide and Kiddies Quiz, see below) and put them onto a 
Raspberry Pi 
running nginx.  At the time they worked perfectly when I connected the Pi to a 
Wireless AP 
mounted on a pole in the corner of the site.  (I was able to use both functions 
from my 
phone.)

Since then, we've pretty much concentrated on the bells project and I've only 
picked this 
up again in the last few days.  The problem is, that I can't get access to the 
two pages 
anymore ;-(  I can connect to the nginx landing page at the root of the server, 
but anything 
else gives me an error 403 (do not have permission to view the page).

Quite a few things have changed since then and I confess that I never tested 
the original 
SD Card before I copied it and went through a full upgrade + installation of 
the code for 
the UPS Pico that we are using.

The problem seems to come down to the fact that I can no longer access the 
content that 
I've copied into the html directory at /var/www.  Worse, I've just plugged the 
original SD 
Card into my old Pi 2 (not the Pi 3 we are using for the WMT) and I'm getting 
the same 
problem.

The only other thing that has changed since then is the router (I'm not even 
trying to 
access the Pi from an independent AP yet), but since I can get to the nginx 
landing page, I 
can't see that that is relevant.

Any ideas what could be going on here?

The latest pages are working on my website at:

http://hadrian-way.co.uk/Audio_Guide/audio_guide.html

and

http://hadrian-way.co.uk/Kiddies_Quiz/index.html[1] 

-- 



Terry Coles


[1] http://hadrian-way.co.uk/Kiddies_Quiz/index.html
-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] SSH into Raspberry Pi Problems

2017-02-18 Thread PeterM
For the last little while, I have not been able to access my R-Pi 
software after creating new SD cards. I thought it was something that I 
have done wrong.


Now I find out it isn't

www.raspberrypi.org/documentation/remote-access/ssh/


   3. ENABLE SSH

As of the November 2016 release, Raspbian has the SSH server disabled by 
default. You will have to enable it manually. This is done 
usingraspi-config 
:


There is a workaround apparently.

For headless setup, SSH can be enabled by placing a file named 'ssh', 
without any extension, onto the boot partition of the SD card.



Because I don't have another means of connecting to my R-Pi.

*Bah*

Peter

--
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR