bindhu
Posts: 18
Joined: Sun Jun 23, 2013 4:41 pm

raspberry pi as web server error

Fri Jun 28, 2013 5:09 pm

I'm trying to make raspberry pi as a web server. Everything worked well till i logged in as root. but after i logged in as root and typed 'usermod -d /var/www pi' i'm getting following error
usermod: user 'pi' does not exist
and here's the tutorial that i've followed.
http://www.youtube.com/watch?v=WgcNBjIJNYs
I already posted this earlier, but i din't get any response. Pls help.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: raspberry pi as web server error

Fri Jun 28, 2013 5:53 pm

Sounds like you removed the pi user somewhere down the line. The only prerequisite is that the user exists and it does as default.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

ghp
Posts: 1399
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: raspberry pi as web server error

Fri Jun 28, 2013 5:56 pm

Hello,

hmm, I just had a short look on this video. Honestly, it is a bit too fast for my slow eyes.
What I understood, that they do some modifications on the user home directories in order have ftp access more simple.
I would simply omit these usermod steps. So keep user 'pi' home dir in /home/pi, and you will need to spend a few more mouse clicks in your favorite ftp-client (to /var/www) when you transfer your web page.

It is needed, that the apache process can read the web files /var/www and the cgi-dirs. On my system, the apache process is running with user www-data .
And that you as either 'pi' or 'root' can read/write the files in order to manage the pages. And for security reasons, the apache user www-data should not have any rights to read/modify any files outside its realm /var/www and the cgi-directory.

Hope this helps.
Gerhard

User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

Re: raspberry pi as web server error

Fri Jun 28, 2013 6:01 pm

try group "nobody" and user "nobody".

but first see if you can find "pi" in /etc/passwd
Antikythera

bindhu
Posts: 18
Joined: Sun Jun 23, 2013 4:41 pm

Re: raspberry pi as web server error

Sat Jun 29, 2013 6:26 am

ghp wrote:Hello,

hmm, I just had a short look on this video. Honestly, it is a bit too fast for my slow eyes.
What I understood, that they do some modifications on the user home directories in order have ftp access more simple.
I would simply omit these usermod steps. So keep user 'pi' home dir in /home/pi, and you will need to spend a few more mouse clicks in your favorite ftp-client (to /var/www) when you transfer your web page.

It is needed, that the apache process can read the web files /var/www and the cgi-dirs. On my system, the apache process is running with user www-data .
And that you as either 'pi' or 'root' can read/write the files in order to manage the pages. And for security reasons, the apache user www-data should not have any rights to read/modify any files outside its realm /var/www and the cgi-directory.

Hope this helps.
Gerhard
How to navigate to /var/www ?

bindhu
Posts: 18
Joined: Sun Jun 23, 2013 4:41 pm

Re: raspberry pi as web server error

Sat Jun 29, 2013 9:26 am

ghp wrote:Hello,

hmm, I just had a short look on this video. Honestly, it is a bit too fast for my slow eyes.
What I understood, that they do some modifications on the user home directories in order have ftp access more simple.
I would simply omit these usermod steps. So keep user 'pi' home dir in /home/pi, and you will need to spend a few more mouse clicks in your favorite ftp-client (to /var/www) when you transfer your web page.

It is needed, that the apache process can read the web files /var/www and the cgi-dirs. On my system, the apache process is running with user www-data .
And that you as either 'pi' or 'root' can read/write the files in order to manage the pages. And for security reasons, the apache user www-data should not have any rights to read/modify any files outside its realm /var/www and the cgi-directory.

Hope this helps.
Gerhard
thank you.. that was really helpful :)

Return to “Networking and servers”