Newbie permissions question

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Newbie permissions question

Postby KarmaFarmer » 15. August 2011 17:01

Hi, I've been trying to get XAMPP on my Linux box, I've run it for years on Windows no problem. I was just wondering if anybody could help?

I'm running Mint 9 and XAMPP for Linux 1.7.4.

I tried installing as per instruction on my 64bit, but recieved an error saying I needed the 32bit layer. Sounded a bit too complicated for me, so I just installed 32bit Mint 9 and the install went without a fuss. Tried starting, but my user wasn't set to be able to sudo, so I changed the user to be able to administer PC. Once that was done, I had localhost up and running.

I couldn't drag and drop my php files, so I had to log in as root and change the folder permissions, but I'm working in a GUI and I'm not sure about Linux permissions. I could now drag and drop and edit, but going to localhost gave me a permission denied in my browser (402).

I can't help thinking there's an easier way. I understand the basics of Linux permissions to get my files working online, but all the groups and users on my own Linux box are confusing. I haven't attempted to connect to databases yet.

What permissions command could I run to enable XAMPP to run properly after install? This isn't a live server, just development, so it's not served external to localhost (and my router isn't set up to allow it out of my home network) so security isn't an issue, but I don't want to have to sudo every time I edit and test a website.

Thanks for the great product, and I hope I can get it sorted on Linux as easily as I have on Windows all these years!
KarmaFarmer
 
Posts: 3
Joined: 15. August 2011 16:40

Re: Newbie permissions question

Postby JonB » 15. August 2011 17:24

AFAIK - after editing you should chown any files under /opt/lampp/htdocs to nobody:root for things to work properly with the server. I'm working on a new framework, and that seems to be the only way to get things sorted. 'nobody' is a special user, and root is the group in this context. This is as it was when XAMPP installed itself. You can read through the files (the bash scripts, and readme's) left by 'Oswald' in the root of /opt/lampp to see how it all works.

I'm working on a work-around for that, BUT I haven't found anything quicker and dirtier than CHOWN'ing the files.

su
password
chown -R nobody:root /opt/lampp/htdocs

You may also need to disable SELinux or place it in permissive mode to get some things to work, particularly if you write to folders that are in or below the htdocs folder.

http://www.crypt.gen.nz/selinux/disable_selinux.html

If you are 'going public' you will need to fix or disable iptables as well.

Good Luck
8)

P.S. I'm about to check my facts on that machine to make sure I didn't miss anything. :shock:
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Newbie permissions question

Postby KarmaFarmer » 15. August 2011 21:46

Fantastic! Now I've got my PHP running, thanks.

Except now I can't edit or create files. Well, I can if I run sudo geany, but I need to have a terminal open to run geany, and having to use sudo just to develop websites on seems a bit overkill. Is there a way of setting it up so that I can edit the files in htdocs without su-ing?

Also, will I encounter the same sort of problems when I fire up the databases?

Thanks for the help

Karl
KarmaFarmer
 
Posts: 3
Joined: 15. August 2011 16:40

Re: Newbie permissions question

Postby JonB » 16. August 2011 00:06

Is there a way of setting it up so that I can edit the files in htdocs without su-ing?


gee I thought I said that:

I'm working on a work-around for that, BUT I haven't found anything quicker and dirtier than CHOWN'ing the files


I'm going to explain why it is that way briefly - LAMPP was designed for servers, not desktop workstations.

Read the ProFTPD config -- it explains what the deal is.

nobody is a special user (AND) the default FTP user. So 'nobody' uploading the files creates the correct permissions and ownership when someone FTP's in.

Get it???
:shock:

I actually chown the files to jonb:root while I'm working, and when I'm ready to test, I just change them back. it couldn't take 1/2 a second/

sudo geany-
I use just use gedit from a file manager, as I have ownership when I'm editing...

Also, will I encounter the same sort of problems when I fire up the databases?


No - because you will be using MySQL credentials to authenticate - its not the same as file ownership or location.

8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Newbie permissions question

Postby KarmaFarmer » 16. August 2011 13:28

Hi, JonB, thanks for this information, and the excellent explanation :)

I've set up a link in my start menu to sudo geany - if it's been run once as admin it'll open up again with just a click. I use gedit for system files so the only ones saved as tabs in geany are my php files. With the sudo chown in my terminal history it's no problem to flick between the two when I need to drag and drop - thanks for the tip!

Problem solved - thanks again...

Karl
KarmaFarmer
 
Posts: 3
Joined: 15. August 2011 16:40

Re: Newbie permissions question

Postby JonB » 16. August 2011 19:10

thanks for the tip on geany, cool little tool.

8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 15 guests