Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

Does the Document Root Point to the Location of your Files?

Another consideration is whether your web server is pointed at the correct file location.

Each virtual server in Apache or server block in Nginx is configured to point to a specific directory. If this is configured incorrectly, the server will throw an error message when you try to access the page.

In Apache, the document root is configured through the DocumentRoot directive:

    DocumentRoot /var/www/html
. . .
This line tells Apache that it should look for the files for this domain in the /var/www/html directory. If your files are kept elsewhere, you'll have to modify this line to point to the correct location.

In Nginx, the root directive configures the same thing:

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;
    root /usr/share/nginx/html;
    index index.html index.htm;
. . .
In this configuration, Nginx looks for files for this domain in the /usr/share/nginx/html directory.

asked Jun 9, 2015 in LINUX by rajesh
0 votes

Related Hot Questions

Government Jobs Opening