user
user

Reputation: 1759

/var/www Directory not found

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

Answers (4)

nmishin
nmishin

Reputation: 3044

To install Apache on Ubuntu you need to do the following:

  1. Update ubuntu package index:
sudo apt update
  1. Install the apache2 package:
sudo apt install apache2

After that, you should have the /var/www directory.

Upvotes: -1

Leo.roxy
Leo.roxy

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.

  1. cd /
  2. ls / this should list the contents of your main folder and check for var if its not there then Apache is not installed
  3. cd /var/www/html/ change the pwd to the html folder
  4. ls You should see the default index.html listed

let us know if it helps. otherwise you can just install the GUI

Upvotes: 0

Mahdi Dibaiee
Mahdi Dibaiee

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

opensource-developer
opensource-developer

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

Related Questions