On 12/16/2010 03:06 PM, Bill Gradwohl wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Given the following in the httpd.conf file on a development machine that
is NOT the real web server for the domains:

NameVirtualHost *:80

<VirtualHost *:80>
     ServerAdmin x...@ycc.com
     DocumentRoot /var/www/html
     ServerName _default_
     <Directory /var/www/html>
        AllowOverride Options
        XBitHack On
        Options Indexes MultiViews +Includes
        Order allow,deny
        allow from all
     </Directory>
</VirtualHost>

# Below are all the real virtual host definitions.
<VirtualHost *:80>
     ServerAdmin x...@ycc.com
     DocumentRoot /var/www/html/roatanbakery.com
     ServerName roatanbakery.com
     ServerAlias www.roatanbakery.com
     ErrorLog /var/log/httpd/roatanbakery.com-error_log
     CustomLog /var/log/httpd/roatanbakery.com-access_log common
     <Directory /var/www/html/roatanbakery.com>
        AllowOverride Options
        XBitHack On
        Options Indexes MultiViews +Includes
        Order allow,deny
        allow from all
     </Directory>
</VirtualHost>
.....
.....

When I use Firefox via http://localhost/roatanbakery.com/ , the page
comes up broken with no css and no ssi's working.

The offending html for the css is:
<link href="/common/style.css" rel="stylesheet" type="text/css" />

Similarly, for the ssi:
<!--#include virtual="/common/w3c.inc.html" -->

If I remove the leading / in each reference, everything works.

Because the ssi fails, I know its a server issue.

Here is the actual structure (extraneous items removed):
r...@box1 roatanbakery.com# pwd
/var/www/html/roatanbakery.com
r...@box1 roatanbakery.com# tree
.
├── bakery
│   └── images
......
├── common
│   └── images
......
│   ├── style.css
│   └── w3c.inc.html
└── toolbars
├── index.html

The error log shows:
File does not exist: /var/www/html/common

It successfully finds the index.html at the document root. Why does it
not find the 2 files when a leading / is used, as that also represents
the root. It apparently used the default DocumentRoot to look for these
files, and not the one specifically specified for the virtual.

How does one successfully write an ABSOLUTE reference in the HTML
against the DocumentRoot that ALWAYS works? Or, is the error in the
httpd.conf file? I don't like using relative references
(common/style.css or ../../common/style.css for example) because it
changes depending on the current level.

I need this to work, as is, when I transfer the entire structure from
the development server to the real web server in Texas.

- --
Bill Gradwohl
Roatan, Honduras
504 9 899 2652
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk0KcSgACgkQ7Orvev+eC8rNXwCaAkOIrW+pzvpXcTdN758F0RGZ
bv4An3Nuk6KfylLvPCpktUug9M0Jl/gL
=3kcy
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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-unsubscr...@httpd.apache.org
    "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org


Bill,

Best not to use overlapping DocumentRoot paths in different vhosts.

Frank.


---------------------------------------------------------------------
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-unsubscr...@httpd.apache.org
  "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to