1

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?

David Foerster
  • 36,264
  • 56
  • 94
  • 147
  • 1
    So 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 Answers2

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
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