PipDenno
Posts: 5
Joined: Sun Feb 16, 2014 10:02 pm

Cannot connect to Pi via web browser

Fri Mar 07, 2014 10:23 pm

Can anyone help or point me in the right direction.

I can connect to my raspberry pi via SSH on my mac but.. can't connect via a browser i.e. '192.168.0.15:8080' or '8081'.

How do I find how to connect as I am trying to access the index.html file on my pi to view pi camera pictures. I managed to find my ip address (i am on sky wifi) via ifconfig which is how I connected via SSH.

Any help is appreciated. Please be gentle as I am a newbie to the pi and linux stuff.

Thanks.

User avatar
DougieLawson
Posts: 42213
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Cannot connect to Pi via web browser

Fri Mar 07, 2014 10:27 pm

Have a look whether there's any listener on those two ports.

netstat -tln
sudo lsof -i TCP:8080
sudo lsof -i TCP:8081
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

PipDenno
Posts: 5
Joined: Sun Feb 16, 2014 10:02 pm

Re: Cannot connect to Pi via web browser

Fri Mar 07, 2014 10:40 pm

I tried the command sudo lsif -i TCP:8080 but get the message command not found?

PipDenno
Posts: 5
Joined: Sun Feb 16, 2014 10:02 pm

Re: Cannot connect to Pi via web browser

Fri Mar 07, 2014 10:42 pm

The first command gave the following details:

Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN

User avatar
DougieLawson
Posts: 42213
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Cannot connect to Pi via web browser

Fri Mar 07, 2014 10:53 pm

So you've got sshd running. But you don't have a webserver of any description running on your RPi.

sudo apt-get install lsof # would install one of my favourite diagnostic tools.
  1. sudo apt-get install apache2 # gets Apache
  2. sudo apt-get install lightttpd # gets Lighthttpd
  3. sudo apt-get install nginx # gets NGinX
Pick 1, 2 or 3.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

User avatar
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden

Re: Cannot connect to Pi via web browser

Sat Mar 08, 2014 9:54 am

Are you using motion by any chance to create the pictures? I'm asking because motion uses the ports 8080 and 8081 you mention.
Its built-in web server does not serve content over the network by default, you have to enable that in its configuration file - /etc/motion/motion.conf
http://www.lavrsen.dk/foswiki/bin/view/ ... mLocalhost
http://www.lavrsen.dk/foswiki/bin/view/ ... lLocalhost
--
Ragnar

User avatar
DougieLawson
Posts: 42213
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Cannot connect to Pi via web browser

Sat Mar 08, 2014 11:29 am

The OP's netstat post shows nothing running other than sshd.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

User avatar
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden

Re: Cannot connect to Pi via web browser

Sat Mar 08, 2014 2:38 pm

DougieLawson wrote:The OP's netstat post shows nothing running other than sshd.
You're right, of course. That should teach me not to post before my first coffe...
--
Ragnar

PipDenno
Posts: 5
Joined: Sun Feb 16, 2014 10:02 pm

Re: Cannot connect to Pi via web browser

Sat Mar 08, 2014 4:36 pm

Thanks guys.

I installed the Apache2 and can now access via the web browser as well as SSH.

Much appreciated.

Thanks.

Return to “General discussion”