I am new to Ubuntu as of yesterday and trying to upload a new site. When I was attempting to delete everything from /var/www
I accidentally deleted the www
directory as well. What steps do I need to take to rebuild/recover the directory with all of the appropriate permissions?
Asked
Active
Viewed 1,416 times
1

David Foerster
- 36,264
- 56
- 94
- 147

tuckerv77
- 13
-
1So you want to restore the directory even if it's empty, rather than wanting to recover the files? "recreate a directory" vs "recover deleted files" are quite different things. – roadmr Apr 02 '15 at 20:37
2 Answers
4
Taking the recommended permissions from https://askubuntu.com/a/51337/175814, as super-user run:
mkdir -m 0775 /var/www
chown www-data:www-data /var/www

David Foerster
- 36,264
- 56
- 94
- 147
-
-
I don't understand, how this would affect the issue at hand. (I'm hearing that for the first time.) – David Foerster Apr 02 '15 at 23:19
-
Well, if he wants to reproduce the original layout, I think it should include /var/www/html. Not a big deal by any means, I just thought I'd mention it. – Jo-Erlend Schinstad Apr 03 '15 at 10:29
0
If you haven't yet tried reinstalling Apache, try that. You can do so by running:
sudo apt-get install --reinstall apache2

Eliah Kagan
- 117,780