httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Penner <stevepenner1...@gmail.com>
Subject [users@httpd] Public Vs. Development (Private) URL to Document: Not Same Document Roots For Absolute URLs of Supporting Documents
Date Mon, 07 Oct 2013 12:12:01 GMT
Apache/2.4.3 (Win32) OpenSSL/0.9.8x PHP/5.4.8

The (Windows) filesystem for my server this Windows path:

     Z:\service.web.opinions

The tree under Z:\service.web.opinions is:

Z:\service.web.opinions
   * developing
   * _content
      ++ opinionDocs.js
      ** culture
        +++elections.html
      ** politics
      ** groups

Note that
   "**" is a directory/folder within the directory/folder "_content"
   "++" is an file in the directory "_content"
   "+++" is a file in the directory "culture"

Finally two more very important bits of information as to the server config:

In my *httpd.conf* file, I have

     Alias /opinion    "Z:/service.web.opinions/_content"

In my *httpd-**vhosts.conf* file, I have:

<VirtualHost *:80 *:8080 *:8008>
    ServerAdmin bigopinions@yahoo.com
    DocumentRoot "Z:/service.web.opinions/_content"
    ServerName truth-and-opinion.org
    ServerAlias www.truth-and-opinion.org
    ErrorLog "|\"C:/_Windows Uninstalled
Applications/Apache24/bin/rotatelogs.exe\"
\"D:/WebServerConfig/httpd/logs/truth-and-opinion.org-error%Y%b%d.log\" 7776000"
    CustomLog "|bin/rotatelogs.exe
D:/WebServerConfig/httpd/logs/truth-and-opinion.org-access%Y%b%d.log 5M"
combined env=!image-request
    Options Indexes FollowSymLinks
</VirtualHost>

In this configuration, I have an HTML document "elections.html" in the Windows
path Z:\service.web.opinions\_content\culture\elections.html.
This is accessed by the public as "http://my.opinions.org/culture/elections.html"

HERE IS THE PROBLEM

I personally/privately (as a developer?) want to access the site content using a
*localhost* or *127.0.0.1* url, namely "http://localhost/opinion/"

The document "elections.html" contains the HTML markup:

    <script type="text/javascript" src="/opinionDocs.js"></script>

That JavaScript file is in the path 
"Z:\service.web.opinions\_content\opinionDocs.js"

The public access is okay, because the DocumentRoot for the public access
"Z:\service.web.opinions\_content\"  and so the "src" attribute points to the
root "/" where opinion docs is located.

But when I use "http://localhost/opinion/culture/elections.html" (or
"http://127.0.0.1/opinion/culture/elections.html",  I will get a 404 Not Found
error.   The error will be that "http://localhost/opinionDocs.js" (or
"http://127.0.0.1/opinionDocs.js") was not found.

Obviously the "Alias" feature is the wrong feature to use, and it should
probably be another <VirtualHost> directive, right?



Mime
View raw message