Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 5388  / 1 Year ago, thu, january 26, 2023, 6:35:48

I successfully installed xampp-linux-x64-1.8.3-4 in my ubuntu 14.04. The XAMPP is installed in /opt/lampp.
I get an 403 Forbidden Error message after I copied a HTML project in htdocs Folder.



What I did and tried:




  1. I copied the project by gksudo nautilus /opt/lampp/htdocs

  2. I tried to change the ownership of the /opt/lampp/htdocs/ to me.

  3. I changed the folder's permissions.


More From » 14.04

 Answers
3

About the error



The 403 Forbidden Error means that the web server (httpd daemon) cannot access the public documents (the web pages) that need to be served.



Possible results of what you did:




  1. All actions in 1 done by the root user resulting all files owned by root so the httpd daemon cannot access them.


  2. You now have the ownership of /opt/lampp/htdocs/ and this has the same results as number 1 above.


  3. You did not mentioned how the permissions are set now thus it is unclear what is accessible right now.




Possible solution:



In my server, I host all public documents at /srv/www/ but the solution will be the same.



Give the ownership to the httpd daemon (Apache, Nginx, etc), that is:



sudo chown -R www-data:www-data /opt/lampp/htdocs/


Assuming that the httpd daemon is named www-data and belongs to the www-data group, else you will have to adapt it accordingly.



In general when setting a web server you want the server user to be the owner of what will be served. Note this is not the case with languages such like Python where say a Django based project must not live inside the public directory.


[#25639] Saturday, January 28, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ainubt

Total Points: 496
Total Questions: 98
Total Answers: 126

Location: Sao Tome and Principe
Member since Wed, Dec 21, 2022
1 Year ago
;