Reputation: 1759
I do not have a /var/www directory in my ubuntu. Isn't it a default directory which comes with os installation.
I am sorry if the question is silly or has already been asked. I ended up asking here after not getting any solution elsewhere.
Upvotes: 8
Views: 25954
Reputation: 3044
To install Apache on Ubuntu you need to do the following:
sudo apt update
sudo apt install apache2
After that, you should have the /var/www
directory.
Upvotes: -1
Reputation: 63
The /var/www/html directory comes with the Apache installation. Make sure you have Apache installed and to verify, run sudo systemctl status apache2
it should show running.
if you still cant find the folders do the following in your ubuntu terminal.
cd /
ls /
this should list the contents of your main folder and check for var if its not there then Apache is not installedcd /var/www/html/
change the pwd to the html folderls
You should see the default index.html listedlet us know if it helps. otherwise you can just install the GUI
Upvotes: 0
Reputation: 925
/var/www
is Apache's default root and not Linux / Ubuntu's.
Other Webservers might use different directories aswell, e.g. NGINX uses /usr/share/nginx/html
by default.
If you want to create that directory, simply run:
mkdir /var/www
Upvotes: 4
Reputation: 3058
Shravya,
www directory is the web root for applications, you need to **install apache**
on your ubuntu in order to get the www directory.
it in not there by default.
Upvotes: 5