ftp promission problem

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

ftp promission problem

Postby coffeecup » 21. August 2014 04:16

sudo /opt/lampp/lampp start
[sudo] password for cafe:
Starting XAMPP for Linux 1.8.3-4...

XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.

With proftpd default user daemon & pw xampp, client machine login to xampp server, directory is /opt/lampp/htdocs/ only, through the ftp, I can't create directory, also can't upload any file, it says:

550 /drupal/greeting.php: Permission denied

Then I did a ssh login to the server, sudo created the directory, and chmod to 777, then I can upload, read, write and delete files, but, 777 is not what I want. And I found the directory owner is root:root, but uploaded files into it becoming daemon:daemon. I created a soft link of the directory into a user's home (/home/cafe/), cd into it and created a php file, then found the file owner bacome cafe:cafe, the new created php file can be shown on the browser, these above progresses were all done on the server side.

I'm wonder how to do create directories & files, upload & delete processes via ftp and avoid 777 permission?
coffeecup
 
Posts: 5
Joined: 18. August 2014 07:48
Operating System: wndows 7

Re: ftp promission problem

Postby Nobbie » 21. August 2014 13:59

coffeecup wrote:I'm wonder how to do create directories & files, upload & delete processes via ftp and avoid 777 permission?


Either use a different UserID & Password for FTP (usualley every user of the System will work), or change owner of htdocs to User "daemon".

I would create a new user on your system, lets call it "www" or similar, then:

a) change httpd.conf and apply "www" to "User = ..." (so that Apache is executed by this new user)

b) change Ownership of /opt/lampp/htdocs to "www"

c) make /opt/lampp/htdocs the Home Directory of "www"

d) for FTP also use "www" (plus Password)

If you do it correctly, all future files will have UserId "www", no matter if it is created by Apache/PHP or by FTP.
Nobbie
 
Posts: 8768
Joined: 09. March 2008 13:04


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 5 guests