I'm new to Ubuntu.
I have installed LAMP on Ubuntu and everything is OK but while I copy a folder into /var/www
it is not accessible via URL. I have tried following commands:
sudo cp -r Desktop/site /var/www
sudo chown myuser /var/www -R
sudo chmod 755 /var/www -R
Also:
sudo chown myuser /var/www/site -R
sudo chmod 755 /var/www/site -R
I event don't see the folder while try list directories (http://localhost/
). However, it's ok while I create a folder manually using sudoo mkdir
command.
What should I do and what's the matter ?
You have your syntax wrong. Try:
or:
but the most correct way would be:
With some changes to Timo's helpful answer and a little more search, I solved it finally as below:
Then re-login and now it's working!
You should change the ownership like this:
sudo chown -R $USER:$USER /var/www/site
And then, change the directory permission like this:
sudo chmod -R 755 /var/www
Hope these help.