You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by ar...@keropa.com on 2002/01/25 16:42:19 UTC

DocumentRoot and ServerName

Hello,

Can you help me with some doubts I have regarding virtualhost and
documentroot?

I have some  websites that share the same images, and in order to not copy
the same images for each web, I have distributed them in the following
manner:

                                              |---- web1
                                              |---- web2
(/data/webmaster/websites)----- |---- images
                                              |---- web4

The configuration of one virtual host is similar to the following:

<VirtualHost xxx.xxx.xxx.xx>
ServerAdmin root@xxx.com
DocumentRoot /data/webmaster/websites/web1
ServerName www.web1.com
</VirtualHost>

The problem is that I can´t use the images from the Images directory, since
the DocumentRoot doesn´t allow me to go down to level web1.  If I  add
"DocumentRoot /data/webmaster/websites" I wont be able to access the page
with www.web1.com anymore and I will have to do it by www.web1.com/web1.
This is obviously not an ideal solution.

Do you know a solution for this problem?

Thank you much,

Yours faithfully,

Joan



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: DocumentRoot and ServerName

Posted by Mike Arrison <ar...@gnostech.com>.
Well, if you're on a unix of some sort, then this is definitely solved by
linking.

Keep web1,2,3,4 wherever you like (for this example:
/data/webmaster/websites/webX), and then put the images directory somewhere
else (for this example: /data/webmaster/websites/images).

Then in each of the web roots perform the following command:
ln -s /data/webmaster/websites/images images

That will make a link between the docroot and the images directory.  Just
make sure the permissions are world readable on the images directory, and
that symlinks are enabled in your conf file.

     -Mike Arrison
      arrison@gnostech.com
      Systems Engineer
      Gnostech, Inc.
      http://www.gnostech.com
      (215) 443-8660

-----Original Message-----
From: areatecnica@keropa.com [mailto:areatecnica@keropa.com]
Sent: Friday, January 25, 2002 10:42 AM
To: users@httpd.apache.org
Subject: DocumentRoot and ServerName


Hello,

Can you help me with some doubts I have regarding virtualhost and
documentroot?

I have some  websites that share the same images, and in order to not copy
the same images for each web, I have distributed them in the following
manner:

                                              |---- web1
                                              |---- web2
(/data/webmaster/websites)----- |---- images
                                              |---- web4

The configuration of one virtual host is similar to the following:

<VirtualHost xxx.xxx.xxx.xx>
ServerAdmin root@xxx.com
DocumentRoot /data/webmaster/websites/web1
ServerName www.web1.com
</VirtualHost>

The problem is that I can´t use the images from the Images directory, since
the DocumentRoot doesn´t allow me to go down to level web1.  If I  add
"DocumentRoot /data/webmaster/websites" I wont be able to access the page
with www.web1.com anymore and I will have to do it by www.web1.com/web1.
This is obviously not an ideal solution.

Do you know a solution for this problem?

Thank you much,

Yours faithfully,

Joan



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org