What is the difference between the 'www' folder and 'htdocs' folder?
Solution 1
There is no difference. You can configure Apache httpd to use any folder with appropriate permissions as the root server directory. www is just a conventional directory to use.
Solution 2
Depending on the configuration of the server or the system, you can use the folder where the files of your web application are copied (.html, .php, etc.). This folder have different names, but basically it is a folder with "permits public access".
The folder can be called this on Linux systems:
- htdocs
- public_html
- www
In OS X (Apple), this folder is called "Sites", and in Windows Server it is called "WWWroot".
Solution 3
It really all depends on the server configuration. Sometimes hosts will configure www to be document root, sometimes htdocs will be for other applications (this is just an example).
Either way, both are public and there is no difference as far as standard configuration goes.
Like I said though, it really depends on the server configuration.
All of your configured settings can be found in httpd.conf
Solution 4
This folder is the so-called Document-Root
of the server. It will be defined via the DocumentRoot-Directive.
Solution 5
Apache will use whatever folder it's configured to use: you could call it whatever you want. Common conventions include htdocs, httpdocs, and www, but you could also make up your own if you felt like it.
Comments
-
Bernard almost 2 years
After I installed Apache on my web server there was created a folder called www. Whatever files like HTML and PHP files I put there it will be on my website.
However, I followed one of the tutorial on YouTube and also even my own XAMPP folder has a htdocs folder which is the same as the www folder. When I put a file inside I can see it if I type its name after localhost. Is there any difference between these two? How have we defined these directories as a container of our files?
-
trincot over 3 yearsIt is not very useful to essentially repeat what was already answered 7 years ago in several answers.
-
Peter Mortensen almost 3 yearsRe "...in httpd.conf": For Apache only(?).