Raspberry Pi webserver, can anyone help?

Permabanned
Joined
21 Sep 2013
Posts
1,336
My boyfriend is rubbish so can someone help me please.

I have a new pi, 32GB SD Card class 10. Installed 2013-09-25-wheezy-raspbian. On the config page I expanded the file system, overclocked, enabled ssh

The I went onto do -

Code:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apache2

I'm able to see the welcome page via local ip (192.168.1.3)

It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.

I'm also able to see this externally as have setup port 80 and ssh via port 22 on my router with a dns.

My issue is trying to log into the pi using Winscp I'm able to log in but can not change anything as I get error code 3. Does anyone have any advice or have I missed a step? Google is confusing me a little. I did this all once but I've lost my notes and the boyfriend is not helping me.

Thanks
 
Apache uses the 'www-data' group so make sure the group has been setup correctly (use Putty or similar) -
Code:
cat /etc/group
If not then add the group -
Code:
sudo groupadd www-data

And then you want to add 'pi' user to the group -
Code:
sudo gpasswd -a pi www-data
and change directory own and assign correct permissions -
Code:
chown www-data:www-data /var/www
chmod 775 /var/www

This should get you going. However, there's a fair few tutorials around on setting up various web-servers under Raspbian (and hundreds if you search around Debian and web-servers) - so have a good read of a few.

Also depending on what you're planning to do with it, it might be worth looking at one of lighter (and generally offer better performance over Apache) web-servers like Nginx - it's no more harder to setup than Apache tbh.

I tried and i'm lost

Code:
login as: pi
[email protected]'s password:
Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Oct 22 12:35:30 2013 from peteslimbook-pc
pi@raspberrypi ~ $ cat /etc/group
root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:pi
tty:x:5:
disk:x:6:
lp:x:7:
mail:x:8:
news:x:9:
uucp:x:10:
man:x:12:
proxy:x:13:
kmem:x:15:
dialout:x:20:pi
fax:x:21:
voice:x:22:
cdrom:x:24:pi
floppy:x:25:
tape:x:26:
sudo:x:27:pi
audio:x:29:pi
dip:x:30:
www-data:x:33:pi
backup:x:34:
operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
gnats:x:41:
shadow:x:42:
utmp:x:43:
video:x:44:pi
sasl:x:45:
plugdev:x:46:pi
staff:x:50:
games:x:60:pi
users:x:100:pi
nogroup:x:65534:
libuuid:x:101:
crontab:x:102:
pi:x:1000:
ssh:x:103:
ntp:x:104:
netdev:x:105:pi
input:x:999:pi
messagebus:x:106:
lpadmin:x:107:
fuse:x:108:
lightdm:x:109:
indiecity:x:1001:root
spi:x:1002:pi
gpio:x:1003:pi
ssl-cert:x:110:

Code:
pi@raspberrypi ~ $ sudo gpasswd -a pi www-data
Adding user pi to group www-data
pi@raspberrypi ~ $ chown www-data:www-data /var/www
chown: changing ownership of `/var/www': Operation not permitted
pi@raspberrypi ~ $ chmod 775 /var/www
chmod: changing permissions of `/var/www': Operation not permitted
 
Back
Top Bottom