0

I want to move my web content from Window 7 to Ubuntu 12.04. So I copy my web content and move it to my /opt/lampp/htdocs folder, then I have change the folder permission using:

sudo -s 
cd /opt/lampp/htdocs
sudo chmod 777 -R myWebContent

Then folder permission is changed. But still I can not access my php file, because it only change the folder's access permission, not a single php file's permission. How can I solve this?

David Foerster
  • 36,890
  • 56
  • 97
  • 151
sabbir
  • 223

2 Answers2

4

instead of chmod 777 you should better to change the owner to www:www and keep 644 or 755 security. Under www user the apache is running and will have read-write-execute access, but other users will have just read or read-execute only access. Try this:

sudo chmod -R 755 /opt/lampp/htdocs
sudo chown -R www-data:www-data  /opt/lampp/htdocs
Dee
  • 1,986
1

I know this question is super old but for anyone reading out there... you probably don't need to do that if all you want is to be able to freely change and add files that use the lamp stack.

You could always change the httpd-vhosts.conf file, add the port and the path to a more suitable directory and that's it.

<VirtualHost *:80> 
 DocumentRoot "/path/to/dir"        
 ServerName DevEnv
 Other directives here
 </VirtualHost>

I personally rather :

Opt/Lampp/htdocs Sudo .nautilus 

Then you can do whatever you want in there and open the htdocs with your code editor and all that.

no messing with permissions and stuff.

Kam
  • 11