Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is /var/www/html? [closed]

Tags:

var

php

cakephp

I am starting to pick up PHP / MySQL, but in all the documentation I'm reading, it mentions /var/www/html as being the folder you want to install a framework such as CakePHP, or for example /var/www/html being the folder you want to install your website on, so that everything is in root.

What exactly does /var/www/html mean?

like image 703
Jason Sherman Avatar asked Apr 24 '13 16:04

Jason Sherman


People also ask

Where is var www html located?

You need to find what the root of the server (for the virtual host if hosting multiple sites) is. This is specified with DocumentRoot - so go to the Apache config files (normally in /etc/Apache or /etc/apache2 or /etc/httpd and look for that directive. /var/www/html is the typical/default location.

Who owns var html?

Currently, one of the directories in the /var/www/html and index. php have the root as owner and group.


2 Answers

/var/www/html is just the default root folder of the web server. You can change that to be whatever folder you want by editing your apache.conf file (usually located in /etc/apache/conf) and changing the DocumentRoot attribute (see http://httpd.apache.org/docs/current/mod/core.html#documentroot for info on that)

Many hosts don't let you change these things yourself, so your mileage may vary. Some let you change them, but only with the built in admin tools (cPanel, for example) instead of via a command line or editing the raw config files.

like image 59
Stephen Fischer Avatar answered Oct 20 '22 00:10

Stephen Fischer


In the most shared hosts you can't set it.

On a VPS or dedicated server, you can set it, but everything has its price.

On shared hosts, in general you receive a Linux account, something such as /home/(your username)/, and the equivalent of /var/www/html turns to /home/(your username)/public_html/ (or something similar, such as /home/(your username)/www)

If you're accessing your account via FTP, you automatically has accessing the your */home/(your username)/ folder, just find the www or public_html and put your site in it.

If you're using absolute path in the code, bad news, you need to refactor it to use relative paths in the code, at least in a shared host.

like image 25
Fernando Jorge Mota Avatar answered Oct 19 '22 22:10

Fernando Jorge Mota