XAMPP on linux / ProFTP and best soltuion for permission

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

XAMPP on linux / ProFTP and best soltuion for permission

Postby alain.roger » 12. May 2016 21:24

Hi,

in order to develop websites on my laptop, i install XAMPP on Kubuntu 16.04.
Now i'm facing a strategic choice in order to make synchronization with my other computer easy and a clear way to work.

i know that /opt/lampp is only accessible to root user.
However, i do not want to always work with root user so i know i can create a symbolic link from /opt/lampp/htdocs to my /home/alain/www/myproject directory for example.
in this case it allows me to create and edit file and directory in my home as user 'alain' without any problem.

let's take an example. if i want to install wordpress, due to write access and permission it can not modify/create a wp-config.php file even if it's in my home/alain/www/project folder.

therefore i wonder if this is the best approach to work.
Using proftp with daemon user does not have write access anyway to /opt/lampp/htdocs directory.

So i want to have a flexible way to work and to make synchronization fo /opt/lampp (and why not or /home/alain) as easy as possible between my 2 computers.

So any idea what should be the best approach ?
thx
What does not kill you, makes you stronger

RogTek, Web agency: htttp://www.rogtek.com
facebook: http://www.facebook.com/rogtek
User avatar
alain.roger
 
Posts: 13
Joined: 03. February 2012 22:14
Operating System: Kubuntu 15.10

Re: XAMPP on linux / ProFTP and best soltuion for permission

Postby Nobbie » 13. May 2016 10:36

I decided to run everything under one UserID, either my own ID (in your case "alain") or to keep it as clean as possible, create a new User "xampp" and run everything as User xampp. You may also create a new group "xamppusers" and put "alain" and/or "xampp" to that group.

That means:

a) edit httpd.conf and apply "xampp" (or "alain") as User for the Apache process, also apply "xamppusers" as Group.

b) also change DocumentRoot from /opt/lampp/htdocs to /home/xampp/htdocs (or simply /home/xampp or similar)

c) chgrp/chmod on that folder, so that "xamppusers" gets access to all files beyond htdocs

d) login to ProFFTP as "xampp" (or "alain")

This is the cleanest solution in my mind, as all tools can read/write thru the same User to all files.

Last not least: this is not an Xampp issue, it is a plain Linux issue, but i decided to answer anyway.
Nobbie
 
Posts: 8770
Joined: 09. March 2008 13:04

Re: XAMPP on linux / ProFTP and best soltuion for permission

Postby alain.roger » 13. May 2016 18:02

thx Nobbie,

this is what i did to make it work as it is on my laptop but i wanted to modify as minimum as possible the httpd.conf so to let www-data as user and group.
i've already changed permission on /opt/lampp/htdocs to www-data:www-data

my main isue was to make an alias on proFTPd to use my username alain as alias to www-data (even if alain is in www-data group) i always had only 755 as permission so i was not able to write any data using FTP in /opt/lampp/htdocs directory.
What does not kill you, makes you stronger

RogTek, Web agency: htttp://www.rogtek.com
facebook: http://www.facebook.com/rogtek
User avatar
alain.roger
 
Posts: 13
Joined: 03. February 2012 22:14
Operating System: Kubuntu 15.10


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 4 guests