[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-httpd-users
Subject:    Re: [users@httpd] Can't get access to CSS stylesheets and javascript files using Apache2.2 on window
From:       Ashish Mistry <ashish.mistry () gemsals ! com>
Date:       2015-09-07 4:35:07
Message-ID: 55ED112B.3010201 () gemsals ! com
[Download RAW message or body]

Hi Barry,

It seems you have used the absolute path of the .js and .css files. If 
your code and .js & .css file are on the same folder or in child folders 
of that then use the relative path for accessing .js and .css files.


Regards,
*Ashish Mistry*

>
> I have installed apache2.2 on my windows laptop.
>
>
> The basics are working fine. I setup my own directory structure under 
> "C:\apachedata" and modified httpd.conf to point under that directory.
>
>
> Accessing HTML pages works fine. CGI scripts that just generate HTML 
> work fine.
>
>
> However when I try to get access to CSS and JS files the apache error 
> log keeps showing me the dreaded 403 error message
>
>
> I have added the following line into httpd.conf
>
> Alias /jslib "C:/apachedata/jslib"
>
>
> Here is the "source code" generated by my CGI script which results in 
> the 403 error emssage
>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html 
> xmlns="http://www.w3.org/1999/xhtml" lang="en-US" 
> xml:lang="en-US"><head><title>Encrypted Data Management</title><link 
> rel="stylesheet" type="text/css" href="/jslib/styles.css 
> <view-source:http://127.0.0.1/jslib/styles.css>" /><link 
> rel="stylesheet" type="text/css" href="/jslib/fieldset.css 
> <view-source:http://127.0.0.1/jslib/fieldset.css>" /><script 
> src="/jslib/check_all_fields.js 
> <view-source:http://127.0.0.1/jslib/check_all_fields.js>" 
> type="text/JAVASCRIPT"></script><script 
> src="/jslib/hide_show_divider.js 
> <view-source:http://127.0.0.1/jslib/hide_show_divider.js>" 
> type="text/JAVASCRIPT"></script><meta http-equiv="Content-Type" 
> content="text/html; charset=iso-8859-1" /></head><body><h1>Encrypted 
> Data Management</h1><H4>CGI script parameters</H4><H4>No CGI script 
> parameters are defined</H4><BR><H3>Sun Sep 6 13:50:40 2015</H3><OL 
> style="line-height: 35px;"><LI><A HREF="e2.cgi?function=listall 
> <view-source:http://127.0.0.1/cgi-bin/e2.cgi?function=listall>">List 
> Data</LI><LI><A HREF="e2.cgi?function=query 
> <view-source:http://127.0.0.1/cgi-bin/e2.cgi?function=query>">Query 
> Data</LI><LI><A HREF="e2.cgi?function=add 
> <view-source:http://127.0.0.1/cgi-bin/e2.cgi?function=add>">Add New 
> Record</LI><LI><A HREF="e2.cgi?function=meta 
> <view-source:http://127.0.0.1/cgi-bin/e2.cgi?function=meta>">List 
> Metadata</LI></LI></OL></body></html> Here is the contents of the 
> jslib directory Volume in drive C is TI10673200G Volume Serial Number 
> is 5E9D-3D3F Directory of C:\apachedata\jslib 09/06/2015 01:04 PM 
> <DIR> . 09/06/2015 01:04 PM <DIR> .. 09/06/2015 01:04 PM 1,396 
> check_all_fields.js 09/06/2015 11:32 AM 3,294 fieldset.css 09/06/2015 
> 01:04 PM 1,515 hide_show_divider.js 09/06/2015 11:32 AM 5,929 
> styles.css 4 File(s) 12,134 bytes 2 Dir(s) 591,461,138,432 bytes free 
> Here is the tail end of "access.log" 127.0.0.1 - - 
> [06/Sep/2015:13:53:13 -0400] "GET /jslib/fieldset.css HTTP/1.1" 403 
> 220 127.0.0.1 - - [06/Sep/2015:13:53:13 -0400] "GET 
> /jslib/hide_show_divider.js HTTP/1.1" 403 228 127.0.0.1 - - 
> [06/Sep/2015:13:53:13 -0400] "GET /jslib/check_all_fields.js HTTP/1.1" 
> 403 227 127.0.0.1 - - [06/Sep/2015:13:53:13 -0400] "GET 
> /jslib/styles.css HTTP/1.1" 403 218 Any ideas ? What else do I need to 
> do or change to properly access my CCS and JS files ?


[Attachment #3 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#336666">
    <font face="Calibri">Hi Barry,<br>
      <br>
      It seems you have used the absolute path of the .js and .css
      files. If your code and .js &amp; .css file are on the same folder
      or in child folders of that then use the relative path for accessing
      .js and .css files.<br>
      <br>
      <br>
    </font>
    <div class="moz-signature">
      <div style="color:#336666">Regards,<br>
        <b>Ashish Mistry</b><br>
        <br>
      </div>
    </div>
    <blockquote
cite="mid:BLUPR13MB0322DEA106BCA6608EA4BE598C550@BLUPR13MB0322.namprd13.prod.outlook.com"
  type="cite">
      <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
  <p><br>
        </p>
        <p>I have installed apache2.2 on my windows laptop.</p>
        <p><br>
        </p>
        <p>The basics are working fine. I setup my own directory
          structure under "C:\apachedata" and modified httpd.conf to
          point under that directory.</p>
        <p><br>
        </p>
        <p>Accessing HTML pages works fine. CGI scripts that just
          generate HTML work fine.</p>
        <p><br>
        </p>
        <p>However when I try to get access to CSS and JS files the
          apache error log keeps showing me the dreaded 403 error
          message</p>
        <p><br>
        </p>
        <p>I have added the following line into httpd.conf</p>
        <p>Alias /jslib "C:/apachedata/jslib"</p>
        <p><br>
        </p>
        <p>Here is the "source code" generated by my CGI script which
          results in the 403 error emssage</p>
        <p><br>
        </p>
        <pre id="line1"><span></span><span title="Almost standards mode doctype. \
Expected “&lt;!DOCTYPE html&gt;”." class="error doctype">&lt;!DOCTYPE html <span \
id="line2"></span>	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <span \
id="line3"></span>	 <a class="moz-txt-link-rfc2396E" \
href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</a>&gt;</span><span>
 <span id="line4"></span></span><span>&lt;<span class="start-tag">html</span> <span \
class="attribute-name">xmlns</span>="<a moz-do-not-send="true" \
class="attribute-value">http://www.w3.org/1999/xhtml</a>" <span \
class="attribute-name">lang</span>="<a moz-do-not-send="true" \
class="attribute-value">en-US</a>" <span class="attribute-name">xml:lang</span>="<a \
moz-do-not-send="true" class="attribute-value">en-US</a>"&gt;</span><span> <span \
id="line5"></span></span><span>&lt;<span \
class="start-tag">head</span>&gt;</span><span> <span \
id="line6"></span></span><span>&lt;<span \
class="start-tag">title</span>&gt;</span><span>Encrypted Data \
Management</span><span>&lt;/<span class="end-tag">title</span>&gt;</span><span> <span \
id="line7"></span></span><span>&lt;<span class="start-tag">link</span> <span \
class="attribute-name">rel</span>="<a moz-do-not-send="true" \
class="attribute-value">stylesheet</a>" <span class="attribute-name">type</span>="<a \
moz-do-not-send="true" class="attribute-value">text/css</a>" <span \
class="attribute-name">href</span>="<a moz-do-not-send="true" \
href="view-source:http://127.0.0.1/jslib/styles.css" \
class="attribute-value">/jslib/styles.css</a>" <span>/</span>&gt;</span><span> <span \
id="line8"></span></span><span>&lt;<span class="start-tag">link</span> <span \
class="attribute-name">rel</span>="<a moz-do-not-send="true" \
class="attribute-value">stylesheet</a>" <span class="attribute-name">type</span>="<a \
moz-do-not-send="true" class="attribute-value">text/css</a>" <span \
class="attribute-name">href</span>="<a moz-do-not-send="true" \
href="view-source:http://127.0.0.1/jslib/fieldset.css" \
class="attribute-value">/jslib/fieldset.css</a>" <span>/</span>&gt;</span><span> \
<span id="line9"></span></span><span>&lt;<span class="start-tag">script</span> <span \
class="attribute-name">src</span>="<a moz-do-not-send="true" \
href="view-source:http://127.0.0.1/jslib/check_all_fields.js" \
class="attribute-value">/jslib/check_all_fields.js</a>" <span \
class="attribute-name">type</span>="<a moz-do-not-send="true" \
class="attribute-value">text/JAVASCRIPT</a>"&gt;</span><span></span><span>&lt;/<span \
class="end-tag">script</span>&gt;</span><span> <span \
id="line10"></span></span><span>&lt;<span class="start-tag">script</span> <span \
class="attribute-name">src</span>="<a moz-do-not-send="true" \
href="view-source:http://127.0.0.1/jslib/hide_show_divider.js" \
class="attribute-value">/jslib/hide_show_divider.js</a>" <span \
class="attribute-name">type</span>="<a moz-do-not-send="true" \
class="attribute-value">text/JAVASCRIPT</a>"&gt;</span><span></span><span>&lt;/<span \
class="end-tag">script</span>&gt;</span><span> <span \
id="line11"></span></span><span>&lt;<span class="start-tag">meta</span> <span \
class="attribute-name">http-equiv</span>="<a moz-do-not-send="true" \
class="attribute-value">Content-Type</a>" <span \
class="attribute-name">content</span>="<a moz-do-not-send="true" \
class="attribute-value">text/html; charset=iso-8859-1</a>" \
<span>/</span>&gt;</span><span> <span id="line12"></span></span><span>&lt;/<span \
class="end-tag">head</span>&gt;</span><span> <span \
id="line13"></span></span><span>&lt;<span \
class="start-tag">body</span>&gt;</span><span> <span \
id="line14"></span></span><span>&lt;<span \
class="start-tag">h1</span>&gt;</span><span>Encrypted Data \
Management</span><span>&lt;/<span \
class="end-tag">h1</span>&gt;</span><span></span><span>&lt;<span \
class="start-tag">H4</span>&gt;</span><span>CGI script \
parameters</span><span>&lt;/<span class="end-tag">H4</span>&gt;</span><span> <span \
id="line15"></span></span><span>&lt;<span \
class="start-tag">H4</span>&gt;</span><span>No CGI script parameters are \
defined</span><span>&lt;/<span \
class="end-tag">H4</span>&gt;</span><span></span><span>&lt;<span \
class="start-tag">BR</span>&gt;</span><span> <span id="line16"></span>
<span id="line17"></span></span><span>&lt;<span \
class="start-tag">H3</span>&gt;</span><span>Sun Sep  6 13:50:40 \
2015</span><span>&lt;/<span class="end-tag">H3</span>&gt;</span><span> <span \
id="line18"></span></span><span>&lt;<span class="start-tag">OL</span> <span \
class="attribute-name">style</span>="<a moz-do-not-send="true" \
class="attribute-value">line-height: 35px;</a>"&gt;</span><span> <span \
id="line19"></span></span><span>&lt;<span \
class="start-tag">LI</span>&gt;</span><span></span><span>&lt;<span \
class="start-tag">A</span> <span class="attribute-name">HREF</span>="<a \
moz-do-not-send="true" \
href="view-source:http://127.0.0.1/cgi-bin/e2.cgi?function=listall" \
class="attribute-value">e2.cgi?function=listall</a>"&gt;</span><span>List \
Data</span><span title="End tag “li” seen, but there were open elements." \
class="error">&lt;/<span class="end-tag">LI</span>&gt;</span><span> <span \
id="line20"></span></span><span>&lt;<span \
class="start-tag">LI</span>&gt;</span><span></span><span title="An “a” start tag seen \
but an element of the same type was already open. End tag “a” violates nesting \
rules." class="error error">&lt;<span class="start-tag">A</span> <span \
class="attribute-name">HREF</span>="<a moz-do-not-send="true" \
href="view-source:http://127.0.0.1/cgi-bin/e2.cgi?function=query" \
class="attribute-value">e2.cgi?function=query</a>"&gt;</span><span>Query \
Data</span><span title="End tag “li” seen, but there were open elements." \
class="error">&lt;/<span class="end-tag">LI</span>&gt;</span><span> <span \
id="line21"></span></span><span>&lt;<span \
class="start-tag">LI</span>&gt;</span><span></span><span title="An “a” start tag seen \
but an element of the same type was already open. End tag “a” violates nesting \
rules." class="error error">&lt;<span class="start-tag">A</span> <span \
class="attribute-name">HREF</span>="<a moz-do-not-send="true" title="Ctrl+Click or \
tap to follow the link" \
href="view-source:http://127.0.0.1/cgi-bin/e2.cgi?function=add" \
class="attribute-value">e2.cgi?function=add</a>"&gt;</span><span>Add New \
Record</span><span title="End tag “li” seen, but there were open elements." \
class="error">&lt;/<span class="end-tag">LI</span>&gt;</span><span> <span \
id="line22"></span></span><span>&lt;<span \
class="start-tag">LI</span>&gt;</span><span></span><span title="An “a” start tag seen \
but an element of the same type was already open. End tag “a” violates nesting \
rules." class="error error">&lt;<span class="start-tag">A</span> <span \
class="attribute-name">HREF</span>="<a moz-do-not-send="true" \
href="view-source:http://127.0.0.1/cgi-bin/e2.cgi?function=meta" \
class="attribute-value">e2.cgi?function=meta</a>"&gt;</span><span>List \
Metadata</span><span title="End tag “li” seen, but there were open elements." \
class="error">&lt;/<span class="end-tag">LI</span>&gt;</span><span> <span \
id="line23"></span></span><span title="No “li” element in scope but a “li” end tag \
seen." class="error">&lt;/<span class="end-tag">LI</span>&gt;</span><span> <span \
id="line24"></span></span><span title="End tag “ol” seen, but there were open \
elements." class="error">&lt;/<span class="end-tag">OL</span>&gt;</span><span> <span \
id="line25"></span> <span id="line26"></span></span><span title="End tag for “body” \
seen, but there were unclosed elements." class="error">&lt;/<span \
class="end-tag">body</span>&gt;</span><span> <span \
id="line27"></span></span><span>&lt;/<span class="end-tag">html</span>&gt;


Here is the contents of the jslib directory

 Volume in drive C is TI10673200G
 Volume Serial Number is 5E9D-3D3F

 Directory of C:\apachedata\jslib

09/06/2015  01:04 PM    &lt;DIR&gt;          .
09/06/2015  01:04 PM    &lt;DIR&gt;          ..
09/06/2015  01:04 PM             1,396 check_all_fields.js
09/06/2015  11:32 AM             3,294 fieldset.css
09/06/2015  01:04 PM             1,515 hide_show_divider.js
09/06/2015  11:32 AM             5,929 styles.css
               4 File(s)         12,134 bytes
               2 Dir(s)  591,461,138,432 bytes free


Here is the tail end of "access.log"

127.0.0.1 - - [06/Sep/2015:13:53:13 -0400] "GET /jslib/fieldset.css HTTP/1.1" 403 220
127.0.0.1 - - [06/Sep/2015:13:53:13 -0400] "GET /jslib/hide_show_divider.js HTTP/1.1" \
                403 228
127.0.0.1 - - [06/Sep/2015:13:53:13 -0400] "GET /jslib/check_all_fields.js HTTP/1.1" \
                403 227
127.0.0.1 - - [06/Sep/2015:13:53:13 -0400] "GET /jslib/styles.css HTTP/1.1" 403 218



Any ideas ? What else do I need to do or change to properly access my CCS and JS \
files ?</span><span></span></pre>  </div>
    </blockquote>
    <br>
  </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic