Give user permissions to htdocs in Ubuntu

49,998

Solution 1

To change ownership of htdocs folder run following command. [Replace username with your own username]

sudo chown -R username:username /opt/lampp/htdocs

enter image description here

We also need to update httpd.conf file. Run following command to open apache configuration file: sudo gedit /opt/lampp/etc/httpd.conf

Find following lines:

 User nobody
 Group nogroup

The Complete answer with picutres is in this article

Solution 2

For easy accessing htdocs directory:

sudo chown -R youruser:youruser /opt/lampp/htdocs

Also you can make changes in httpd.conf file: sudo gedit /opt/lampp/etc/httpd.conf

    173 User youruser
    174 Group youruser

Solution 3

set USER Permission

sudo chmod 755 -R /opt/lampp/htdocs

Proper way to install XAMPP in ubuntu is as below. open your terminal

Official document

COMMANDS

1.) mkdir xampp
2.) cd xampp/
3.) wget https://www.apachefriends.org/xampp-files/5.6.20/xampp-linux-x64-5.6.20-0-installer.run
4.) chmod +x xampp-linux-x64-5.6.20-0-installer.run
5.) sudo ./xampp-linux-x64-5.6.20-0-installer.run

ACCESS phpMyAdmin

6.) sudo vim /opt/lampp/etc/extra/httpd-xampp.conf

AND COMMENT OUT THE FOLLOWING LINE

Require local

EX.

#Require local

Save and quit the file and restart XAMPP service

7.) sudo /opt/lampp/lampp restart

OVER COME THE SECURITY OPTION

8.) sudo /opt/lampp/lampp security

And follow the instruction

Share:
49,998
Sajith Herath
Author by

Sajith Herath

Updated on November 09, 2020

Comments

  • Sajith Herath
    Sajith Herath over 3 years

    I installed xampp with root permission to opt/lampp folder in Ubuntu.but i cant access htdocs folder and unable to start apache server since the lampp folder has only root permission.How can i solve this and are there any proper way to install xampp in Ubuntu

    • Deepak Dixit
      Deepak Dixit almost 7 years
      Can you show the permission of htdocs ?