PDA

View Full Version : LAMPP setup


ViperStrike
2008-09-01, 03:23 PM CDT
So, I've gone and installed LAMPP in my /opt directory as suggested, but that creates a slight problem.
Since that directory is root owned, I can't move any of my files into the htdocs folder to run them off the server. So, I was wondering, how do I go about changing the directory that apache looks at to, for example, /home/account/Web
Thanks

zeroelixis
2008-09-01, 03:28 PM CDT
why not move the files as root:

sudo cp -Rf /*stuff*/ /opt/lampp/htdocs/

ViperStrike
2008-09-01, 03:48 PM CDT
Yeah, I could, but then I'd still have to be root to work on any of them. I use the server as a test before I push my PHP files live, so that folder would be where all my sites would live during development.

pete_1967
2008-09-01, 03:57 PM CDT
Sounds like you installed you server from sources, not from packages.

Same thing applies though:
It's safer to have those files owned by root and allow Apache user/ group minimal rights to them (read only unless there's reason to exec/ write).

Even if you just use the server for testing and development, it is better to keep the environment right than create shortcuts which weaken the security and so easily carry over to production.

Anyways, after all that, you can allow others to write to your directories in two ways, first the worst way:
chmod them to be writable by world (chmod -R 777 [directory]) <--- VERY BAD thing to do
chown them to Apache user/ group (chown -R user:group [directory])

ViperStrike
2008-09-01, 06:45 PM CDT
Yeah, I downloaded the .tar and did the extract.
So, I tried the group thing, but that didn't go over so well:
drwxrwxr-x 4 root web 4096 2007-11-14 06:43 htdocs

And: [root@localhost lampp]# groups cjmaynar
cjmaynar web
But when called not as root: [cjmaynar@localhost /]$ groups
cjmaynar

Obviously my main account isn't registering that it's supposed to be in an extra group, any idea why?

JohnVV
2008-09-01, 08:55 PM CDT
su -
chown -R cjmaynar:cjmaynar /opt/lampp/htdocs/
-- or better yet ----
chown -R apache:apache /opt/lampp/htdocs/