2011-06-27 14:55:56     Error 403 with boa

Document created by Aaronwu Employee on Aug 27, 2013
Version 1Show Document
  • View in full screen mode

2011-06-27 14:55:56     Error 403 with boa

Wojtek Skulski (UNITED STATES)

Message: 101718   

 

I am asking this question here because I did not find any hint on the web. I know this is not the boa help forum, but let me ask anyway...

 

I am getting the following error with boa running a plain vanilla boa.conf (attached). I click on the file link and I am getting

 

403 Forbidden

 

Your client does not have permission to get URL /cgi-bin/wave.txt_70.101.110.175 from this server.

 

The file link in the dynamic web page is <a href="wave.txt_70.101.110.175">Waveform</a>. It is expanded to   70.101.110.175/cgi-bin/wave.txt_70.101.110.175 by the web browser. This link is refused by boa.

 

The file does exist in the directory. The permissions are -rw-r----- . When I chmod these to "all can read", the error still persists.

 

root:/home/httpd/cgi-bin> ls -l

-rw-r-----    1 root     root          296 Jun 27 14:18 gnu.plt_70.101.110.175

-rwxr--r--    1 root     root        53676 Jun 27 12:04 ndso.cgi

-rw-r-----    1 root     root        59537 Jun 27 14:18 wave.txt_70.101.110.175

 

 

Any hint which option to change in boa.conf to make these links work? They used to work under the httpd server. So it must be a boa config problem, I think.

 

boa.conf

QuoteReplyEditDelete

 

 

2011-06-27 15:00:27     Re: Error 403 with boa

Mike Frysinger (UNITED STATES)

Message: 101720   

 

i would make sure the file is `chmod a+r` and all parent dirs are `chmod a+rx`

 

otherwise, my guess would be that boa does not allow non-cgi files to be loaded out of the cgi-bin dir since that is a special "execute the things in here and return the output" dir

QuoteReplyEditDelete

 

 

2011-06-27 15:09:37     Re: Error 403 with boa

Wojtek Skulski (UNITED STATES)

Message: 101721   

 

> i would make sure the file is `chmod a+r` and all parent dirs are `chmod a+rx`

 

I changed all files to a+r and the cgi-bin directory is a+rx. It does not help.

 

>otherwise, my guess would be that boa does not allow non-cgi files to be loaded out of the cgi-bin dir since that is a special "execute the things in here and return the output" dir

 

OK, I will try changing the logic of ndso.cgi to move the files one level up. Thank you for the hint.

QuoteReplyEditDelete

 

 

2011-06-27 20:14:50     Re: Error 403 with boa

Wojtek Skulski (UNITED STATES)

Message: 101731   

 

Mike:

 

Error 403 is getting interesting. I moved the plot folder from /home/httpd/cgi-bin to /home/httpd/plots. It was a matter of changing one #define which gets prepended to file names. I recompiled the ndso.cgi. It is now saving the data files in the new "plots" directory and then fetching them from there for plotting. So far, so good.

 

But then the web browser is refusing to serve these files as files. The interesting part is, that the application is dynamically generating the menu of file names without any directory prepended. (The example is below.) The web browser then prepends the /cgi-bin/ completely on its own. And then the file is refused to be served.

 

Here is the dynamically generated file list. Note that href= is not a full path. I am now trying to figure out how the **** web browser knows to prepend the ../cgi-bin/ to it, which then leads to the Error 403.

 

<HTML><HEAD><TITLE>List of gnuplot files</TITLE></HEAD>

<BODY>

<hr>

<menu>

<li><font face="Arial Black"><a href="gnu.plt_192.168.1.2">Gnuplot file</a></font></li>

<li><font face="Arial Black"><a href="wave.txt_192.168.1.2">Waveform</a></font></li>

</menu>

<hr>

</BODY></HTML>

 

I tried to force the full path names here, but then I am getting Error 404, File not found. Boa cannot find the file which is clearly there on disk in the "plots" folder.

 

Looks like Catch-22 to me. I keep investigating. Any suggestions are welcome.

QuoteReplyEditDelete

 

 

2011-06-27 20:20:03     Re: Error 403 with boa

Mike Frysinger (UNITED STATES)

Message: 101732   

 

that's how it's supposed to work.  if you dont specify a path, everything is relative to the current page.

 

so if you're fetching /cgi-bin/foo, any relative links from that will go to /cgi-bin/<file>.

 

if you want to fetch from somewhere else, you'll need to specify the paths to it; either absolute or relative.

QuoteReplyEditDelete

 

 

2011-06-27 20:57:24     Re: Error 403 with boa

Wojtek Skulski (UNITED STATES)

Message: 101733   

 

Mike:

 

thank you for the info. I figured it out. When my file name in the menu was "plots/gnu.plt_192.168.1.2", then the web browser prepended "URL/cgi-bin/". But when the file name in the menu is "/plots/gnu.plt_192.168.1.2", then the web browser prepends just the URL without the "cgi-bin", which is a legal location for boa to serve.

 

One slash "/" makes the difference. So now it is working...

 

Thank you for your help. I appreciate it very much!

QuoteReplyEditDelete

Attachments

Outcomes