nl2ttl
Posts: 5
Joined: Wed Sep 19, 2012 9:34 pm

LAMP Server setup problem

Wed Sep 19, 2012 9:39 pm

I try to setup a Apache webserver with MYSQL.
Because I'm a beginner I follow a online howto.

Now I'm facing the following problem.

- Howto say:

"sudo -i"
"passwd root"
Type in any password (this is only temporary)
"exit"
"exit"
Start a new SSH session
Username: root
Password (the one you just set)
"nano /etc/passwd"
find the line "pi:x;1000:1000:Raspberry Pi User,,,:home/pi:/bin/bash" and change it to "#pi:x;1000:1000:Raspberry Pi User,,,:home/pi:/bin/bash".
Then hold the Ctrl key and press "x", then release Ctrl and press "y" then hit Return / Enter.
"usermod -d /var/www pi"

When I do this it say: User PI does not exist

(SSH terminal)
[email protected]:~# sudo usermod -d /var/www pi
usermod: user 'pi' does not exist

Can somebody please help me with this problem?

wh1p
Posts: 29
Joined: Tue Jul 03, 2012 11:00 pm
Location: South East UK
Contact: Website

Re: LAMP Server setup problem

Thu Sep 20, 2012 12:45 am

no 1. what exactly are you trying to achieve?

and

no 2. if you are new 2 linux are you sure you want to be using the root account?

nl2ttl
Posts: 5
Joined: Wed Sep 19, 2012 9:34 pm

Re: LAMP Server setup problem

Thu Sep 20, 2012 7:24 am

What I try to do, is setting up a webserver and mysql database. (LAMP)

The biggest issue is that when I upload a new folder / file to the www directory there is always a permission error.

I try to change the file / folder permission to 755 and 777 only this was not successful.

ChrisEnglish
Posts: 13
Joined: Thu Sep 20, 2012 8:38 am

Re: LAMP Server setup problem

Thu Sep 20, 2012 8:40 am

Yes, the pi user doesnt exist... by putting a hash(#) infront of it you have basically deleted it.
Why would you need to do this? try using chmod from sudo command line.

nl2ttl
Posts: 5
Joined: Wed Sep 19, 2012 9:34 pm

Re: LAMP Server setup problem

Thu Sep 20, 2012 9:38 am

Well, like I told before I'm new and try to follow a HowTo to understand everything a little bit more.
I Will try to chmod the complete directory using chmod from commandline.

nl2ttl
Posts: 5
Joined: Wed Sep 19, 2012 9:34 pm

Re: LAMP Server setup problem

Thu Sep 20, 2012 8:17 pm

chmod 755 www -R does the job.
I only have to do it every time I upload a file to the www dir. Is there a way to enable it automatically when I upload a file.

saif
Posts: 74
Joined: Sun Apr 15, 2012 8:15 pm
Contact: Website

Re: LAMP Server setup problem

Thu Sep 20, 2012 8:24 pm

I think I see what you are trying to do (I think).
Essentially Linux, (like may modern operating systems) allows multiple users with different levels of privileges.
You have with your steps
1) changed the password for root, then
2) Became root and disabled the user pi (the # just makes the system ignore the line, so it now does not know that user pi exists)
3) Then you tried to modify the user pi (which no longer exists http://linux.die.net/man/8/usermod ) using usermod

What I would do is 1) remove the # and pi should come back again
Tell me how far you have got with installing Apache and what you done so far

saif
Posts: 74
Joined: Sun Apr 15, 2012 8:15 pm
Contact: Website

Re: LAMP Server setup problem

Thu Sep 20, 2012 8:34 pm

nl2ttl wrote:chmod 755 www -R does the job.
I only have to do it every time I upload a file to the www dir. Is there a way to enable it automatically when I upload a file.
Ok this means that only the owner has read and write permission to the directory. If you set the directory, say as root, then root is the owner, then only root can write to the directory.
If you upload as a different user (sometimes using programs like ftp clients appear to the system as a different user, or "nobody"), this will be blocked, unless you revert to being the owner again.
The way I would do it is to have www directory permission as 775. This means that root and anybody in the right group (say www-data) has permission to write to the directory.... then make sure that all users and programs that need to have write access belong to this group....Does that help?

nl2ttl
Posts: 5
Joined: Wed Sep 19, 2012 9:34 pm

Re: LAMP Server setup problem

Sun Sep 23, 2012 6:00 pm

Great solution and thank you for the great support

geg1978
Posts: 1
Joined: Mon Feb 25, 2013 3:33 am

Re: LAMP Server setup problem

Mon Feb 25, 2013 3:35 am

hi
What was the solution?

User avatar
tonyhughes
Posts: 951
Joined: Wed Dec 26, 2012 3:46 am

Re: LAMP Server setup problem

Mon Feb 25, 2013 6:37 am

For those playing along at home:

No need to activate the root account on Raspbian. It is just not needed. Even people who live in command line servers, and need elevated privileges often use 'sudo'.

LAMP is super easy to set up on Raspbian. Many good howtos around - find one, read it and understand it before you start doing it. You can also refer to Debian and Ubuntu Server howtos - Raspbian & Ubuntu are genetic brothers, and Debian is their daddy.

If you are struggling to get it right, you can get Apache2, MySQL, and PHP installed on Raspbian with zero fuss by using Baked Raspberry Pi Mod. There's even a cute little tool to create MySQL databases using a handy menu driven utility.

samapples
Posts: 1
Joined: Wed Nov 20, 2013 3:45 pm

Re: LAMP Server setup problem

Wed Nov 20, 2013 3:48 pm

It's probably because you're using Debian Weezy (Wheezy?) instead of the older Debian Squeeze. Easiest solution: don't comment out the pi line in /etc/passwd - just leave it as it is and continue with the tutorial.

Return to “Networking and servers”