Setting the right permissions

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

Setting the right permissions

Postby josf » 11. February 2020 03:16

Gents, I have a real big problem getting Xampp to work after a crash. I work on Ubuntu 18.04. I used this tutorial to install Xampp:
http://www.codebind.com/linux-tutorials/install-xampp-ubuntu-18-04]tutorial.
Problem are the user rights and privileges. If you follow this tutorial, it won't work. So I used this tutorial to get the permissions right:
https://www.computernetworkingnotes.com/linux-tutorials/xampp-htdocs-permission-issue-and-fix-in-ubuntu.html

I set my user (!'m the only one using this pc) to chmod -R 777 /opt/lampp/htdocs. 755 is better, but doesn't work for me.

Privileges on a joomla folder are:
Owner: Me (create and delete)
Group: jos (create and delete)
Others: (access files)

I'm still not there. When in stalling Joomla I have to manually remove the installation folder. Before I get that far, I have to set the FTP configuration in Joomla, which I never had to do before the crash. I have to manually create a configuration.php file as well.

Everything works, it's the privileges that cause the hick-ups. Who can help get these privileges in order?
josf
 
Posts: 7
Joined: 11. February 2020 02:23
XAMPP version: 7.4.2
Operating System: Ubuntu 18.04

Re: Setting the right permissions

Postby Nobbie » 11. February 2020 11:21

1) You dont need an FTP server for a local installation -> choose "No" for FTP Server.

2) Repeat "chmod 777 ." in a terminal inside the Joomla root folder before creating configuration.php and deleting installation folder.
Nobbie
 
Posts: 11664
Joined: 09. March 2008 13:04

Re: Setting the right permissions

Postby josf » 12. February 2020 01:34

Thanks for your help. I'm having permission issues. I've installed Xampp in the past and never had to do these kind of things. Normally, I hit the remove installation button to finish the installation process. Likewise, I normally never have to write a configuration file or setup FTP connections. At the moment I remove the installation folder manually, and I set the privileges for all files and folders to create and delete. If I don't, I can't install software in the Jooma installation.

But that isn't right. I know it's a permission issue. I just don't know how to solve it.
josf
 
Posts: 7
Joined: 11. February 2020 02:23
XAMPP version: 7.4.2
Operating System: Ubuntu 18.04

Re: Setting the right permissions

Postby Nobbie » 12. February 2020 09:47

josf wrote:I know it's a permission issue. I just don't know how to solve it.


If you did not read my second hint, i cannot help you any further.
Nobbie
 
Posts: 11664
Joined: 09. March 2008 13:04

Re: Setting the right permissions

Postby josf » 13. February 2020 01:26

Joomla creates the configuration file. I normally won't have to do that. Deleting the installation folder is clicking on the button - but no more. As i said: it's a permission issue.
josf
 
Posts: 7
Joined: 11. February 2020 02:23
XAMPP version: 7.4.2
Operating System: Ubuntu 18.04

Re: Setting the right permissions

Postby Nobbie » 13. February 2020 10:24

josf wrote:Joomla creates the configuration file.


Yes, so it does for me.

josf wrote:As i said: it's a permission issue.


And as i said, my second hint solves that issue. Why dont you simply do what i tell you? Why are you asking, if you dont want to follow the solution?

I downloaded the same Xampp version as yours, and the newest Joomla and run a full installtion ONLY TO HELP YOU. And you cannot simply follow my advice? How poor. I give up at this point.
Nobbie
 
Posts: 11664
Joined: 09. March 2008 13:04

Re: Setting the right permissions

Postby josf » 17. February 2020 03:18

I did. The biggest problem is that applications are installed by the user/group daemon. It takes ownership. Each and every time I install something i have to chmod 777 to get it back. That's not good.

I tried to get around this by adding my user (jos) to the group daemon, and daemon to the group jos. But that doesn't help much.
josf
 
Posts: 7
Joined: 11. February 2020 02:23
XAMPP version: 7.4.2
Operating System: Ubuntu 18.04

Re: Setting the right permissions

Postby Nobbie » 17. February 2020 12:13

josf wrote:The biggest problem is that applications are installed by the user/group daemon.


Which applications? And what do you mean by "user/group daemon"? Never heard about such a daemon. Do you mean, your applications (which?) are installed with UserID "daemon" und Group "daemon"? If so - that is YOUR linux configuration.

Actually, i dont really understand the problem. Linux comes with certain rights management and files belong to Users and Groups. And you should have root priviliges in order to install system wide software tools (like Xampp), as this is a typically administrative task. And yes, you have to modify Users/Groups and rights to your needs. Xampp does not know anything about your Users and its on you to configure Joomla, WordPress etc. properly (with the help of root priviliges of course) in order to run smoothly. Thats how it is on Linux. Linux is not Windows.
Nobbie
 
Posts: 11664
Joined: 09. March 2008 13:04

Re: Setting the right permissions

Postby josf » 19. February 2020 03:57

I installed Xampp with default settings.
After that I set ownership of the htdocs folder only to sudo chmod -R 755 /opt/lampp/htdocs
The owner to sudo chown –R jos: jos /opt/lampp/htdocs
That works fine.
I checked what installs the programs (Joomla, WP) that's daemon.
When I install Joomla or WP, deamon owns most anything.

That's okay by me, all I need is to be able to work on a few files. Mainly on the templates/themes. Changing to su all the time to make the changes is not a good idea. I need my own user to do that.

I set up the Bitnami WordPress and Joomla modules. Same problem there. In /lampp/apps/wordpress/htdocs the owner is root and the group is daemon.

What I need to know is how I can give the user access to work.
josf
 
Posts: 7
Joined: 11. February 2020 02:23
XAMPP version: 7.4.2
Operating System: Ubuntu 18.04

Re: Setting the right permissions

Postby Nobbie » 19. February 2020 13:01

josf wrote:I checked what installs the programs (Joomla, WP) that's daemon.
When I install Joomla or WP, deamon owns most anything.


How do you install these programs?? Thats really weird. What i do:

1) I download the ZIP Package from WordPress (for example) from the internet (wordpress.org) into my home Downloads folder. Then i unzip that folder. This results in a wordpress folder under my Downloads folder. BUT: this wordpress folder (and all files within) belong TO ME of course (in your case, they belong to "jos"). Finally i move/copy the whole folder to the htdocs folder (with the help of "sudo"), which still keeps the ownership to my UserID. No "daemon" at all. And finally i start the installation in a browser (simply entering the URL for the new installation i.e. http://localhost/wordpress).

If you are the only user of Xampp (what of course is the standard case), you should install all files (WordPress, Joomla) as I showed above. That keeps the ownership of all files to "jos".

You already changed ownership of htdocs to User "jos", what is Ok.

Last not least, edit httpd.conf (/opt/lampp/etc/httpd.conf) and watch out for "User" and "Group". Change at least the value for User to "jos" - then restart Apache. That makes Apache running with YOUR UserID (you may also change the Group value, but its not that important), that enables Joomla, WordPress (which are running under Apache) to create/modify/delete files under htdocs (as this belongs to "jos" already).

P.S.: I think, you downloaded and installed the packages (Joomla, WordPress) from Bitnami. I do not recommend that. You always get the latest versions directly from the developers (wordpress.org, joomla.org) and these are quite easy to install. No hassle about daemon Users, simply unzip the files to the htdocs folder, finally enter the appropriate URL into your browser which starts the installation. You might create MySQL Databases and Users before starting the installation, simply run localhost/phpmyadmin and create everything you need. Apply the new User and Database to the installation form of WordPress, Joomla etc.

In order to avoid a collision between the Bitnami Apps and the original WordPress/Joomla Scripts, i recommend to start from scratch. Remove the whole lampp folder from/opt, then run xampp Installer again. Then install WordPress, Joomla etc. as shown above. You will get used very quickly in this way of installing and it has a HUGE advantage: it is exactly the same way to proceed when you are running an internet server!
Nobbie
 
Posts: 11664
Joined: 09. March 2008 13:04

Re: Setting the right permissions

Postby josf » 23. February 2020 03:03

Hi Noble, we're getting somewhere! That's exactly what I wanted to do. But... changing the User and Group in httpd.conf gives me an error on phpmyadmin:
Code: Select all
phpMyAdmin - Error

Error during session start; please check your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser.

session_start(): open(SESSION_FILE, O_RDWR) failed: Permission denied (13)

session_start(): Failed to read session data: files (path: /opt/lampp/temp/)

I tried nobody nobody - phpmyadmin won't mind, but the server does. jos - daemon or daemon - jos makes no difference. I can get it only running with User daemon and Group daemon.
josf
 
Posts: 7
Joined: 11. February 2020 02:23
XAMPP version: 7.4.2
Operating System: Ubuntu 18.04

Re: Setting the right permissions

Postby josf » 23. February 2020 06:03

I'm VERY happy to report I got it worked out. I got advice about the error. it was the permission on /lamp/temp. Once I set that I could rename User, restart the server and everything works as expected. Thanks again for your help!
josf
 
Posts: 7
Joined: 11. February 2020 02:23
XAMPP version: 7.4.2
Operating System: Ubuntu 18.04


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 10 guests