What is the difference between the 'www' folder and 'htdocs' folder?
Asked Answered
S

7

41

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?

Splatter answered 22/2, 2014 at 0:58 Comment(1)
htdocs is a symlink of www in this case.Septum
O
35

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.

Orlantha answered 22/2, 2014 at 1:2 Comment(0)
A
14

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

Alkalinity answered 22/2, 2014 at 1:12 Comment(0)
C
6

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

Chadwick answered 22/2, 2014 at 1:7 Comment(1)
Re "...in httpd.conf": For Apache only(?).Jakob
B
3

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.

Berberidaceous answered 22/2, 2014 at 0:58 Comment(0)
T
3

This folder is the so-called Document-Root of the server. It will be defined via the DocumentRoot-Directive.

Tarrel answered 22/2, 2014 at 1:2 Comment(0)
S
0

Based on your server configuration, it depends.

Those are the default folders that are assigned to upload web related files into server.

If you want to set another folder for that purpose, follow below steps.

  1. Find and open httpd.conf file inside the xampp/apache/conf folder. (in xampp)
  2. Then change ( DocumentRoot “C:/xampp/htdocs” ) into what you want.
  3. Also, next line ( <Directory "C:/xampp/htdocs"> )

Now, you can use your own folder to upload files into server.

Thank You.

Suppositive answered 11/2 at 14:36 Comment(0)
S
-2

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 by yourself.

Subaquatic answered 26/1, 2021 at 11:38 Comment(1)
It is not very useful to essentially repeat what was already answered 7 years ago in several answers.Alisaalisan

© 2022 - 2024 — McMap. All rights reserved.