logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache 2 "You are not authorized to view this page &
Author
gtsjames



Joined: 27 Mar 2007
Posts: 3

PostPosted: Wed 28 Mar '07 0:10    Post subject: Apache 2 "You are not authorized to view this page & Reply with quote

I am trying to implement apache to host a website with cgi scripts. Whenever I try to access the site I get the following error:
"You are not authorized to view this page"

The files for the site I want to host are located in C:\folder\wbdi
below is the entry I made into the httpd.conf file in
C:\Program Files\Apache Software Foundation\Apache2.2\conf

ScriptAlias /wbdi "C:/folder/WBDI/"
<Directory "C:/folder/WBDI">
AllowOverride All
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>

This is Apache 2.2.4 installed on a Win2K platform. Any assistance would be appreciated. I have already checked the permissions on the "C:\folder\wbdi" folder and "everyone" has full control.


-----
Since my previous post I have now run into some new developments.
I can access the cgi scripts by directly specifying them like below

http://151.114.16.106/wbdi/apl/config.cgi?mode=readsystem

but accessing the http://151.114.16.106/wbdi gives me the error.
Also if I change the entry in the httpd.conf file from a scriptalias to a normal alias, accessing http://151.114.16.106/wbdi does access the index.html file and redirect it to the cgi file, but it then opens the cgi file as a text file and not a webpage as expected. I am lost. Confused Confused
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Wed 28 Mar '07 9:36    Post subject: Reply with quote

You have to use the scriptalias and you have to edit the Options

Options ExecCGI

to

Options Indexes FollowSymLinks ExecCGI
Back to top
gtsjames



Joined: 27 Mar 2007
Posts: 3

PostPosted: Wed 28 Mar '07 18:05    Post subject: Reply with quote

Thanks for the input. I changed my scripthost entry to what you recommended and now the pages load as expected. What I am now running into are problems with the images loading. I get errors when trying to use css(stylesheets) and loading Gifs and JPGs. Below are some of the errors from the logs:

[Wed Mar 28 11:58:41 2007] [notice] Child 1892: Starting thread to listen on port 80.
[Wed Mar 28 11:59:22 2007] [error] [client 0.0.0.0] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
[Wed Mar 28 11:59:27 2007] [error] [client 0.0.0.0] C:/Ricoh/WBDI/apl/images/maincollage.jpg is not executable; ensure interpreted scripts have "#!" first line, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:27 2007] [error] [client 0.0.0.0] (9)Bad file descriptor: don't know how to spawn child process: C:/Ricoh/WBDI/apl/images/maincollage.jpg, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:27 2007] [error] [client 0.0.0.0] C:/Ricoh/WBDI/apl/images/WBDI-logo.gif is not executable; ensure interpreted scripts have "#!" first line, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:27 2007] [error] [client 0.0.0.0] (9)Bad file descriptor: don't know how to spawn child process: C:/Ricoh/WBDI/apl/images/WBDI-logo.gif, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:36 2007] [error] [client 0.0.0.0] C:/Ricoh/WBDI/apl/new.css is not executable; ensure interpreted scripts have "#!" first line, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:36 2007] [error] [client 0.0.0.0] (9)Bad file descriptor: don't know how to spawn child process: C:/Ricoh/WBDI/apl/new.css, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:36 2007] [error] [client 0.0.0.0] C:/Ricoh/WBDI/apl/jscript/rollovers.js is not executable; ensure interpreted scripts have "#!" first line, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:36 2007] [error] [client 0.0.0.0] (9)Bad file descriptor: don't know how to spawn child process: C:/Ricoh/WBDI/apl/jscript/rollovers.js, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:36 2007] [error] [client 0.0.0.0] C:/Ricoh/WBDI/apl/jscript/alertus.js is not executable; ensure interpreted scripts have "#!" first line, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:36 2007] [error] [client 0.0.0.0] (9)Bad file descriptor: don't know how to spawn child process: C:/Ricoh/WBDI/apl/jscript/alertus.js, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:36 2007] [error] [client 0.0.0.0] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
[Wed Mar 28 11:59:36 2007] [error] [client 0.0.0.0] C:/Ricoh/WBDI/apl/jscript/tooltip.js is not executable; ensure interpreted scripts have "#!" first line, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:36 2007] [error] [client 0.0.0.0] (9)Bad file descriptor: don't know how to spawn child process: C:/Ricoh/WBDI/apl/jscript/tooltip.js, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:36 2007] [error] [client 0.0.0.0] C:/Ricoh/WBDI/apl/images/c_header_logo.gif is not executable; ensure interpreted scripts have "#!" first line, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:36 2007] [error] [client 0.0.0.0] (9)Bad file descriptor: don't know how to spawn child process: C:/Ricoh/WBDI/apl/images/c_header_logo.gif, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:36 2007] [error] [client 0.0.0.0] C:/Ricoh/WBDI/apl/images/btl01_n.gif is not executable; ensure interpreted scripts have "#!" first line, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:36 2007] [error] [client 0.0.0.0] (9)Bad file descriptor: don't know how to spawn child process: C:/Ricoh/WBDI/apl/images/btl01_n.gif, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:37 2007] [error] [client 0.0.0.0] C:/Ricoh/WBDI/apl/images/btl02_n.gif is not executable; ensure interpreted scripts have "#!" first line, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:37 2007] [error] [client 0.0.0.0] (9)Bad file descriptor: don't know how to spawn child process: C:/Ricoh/WBDI/apl/images/btl02_n.gif, referer: http://151.114.16.106/wbdi/apl/searchdb_bt.cgi
[Wed Mar 28 11:59:37 2007] [error] [client 0.0.0.0] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
[Wed Mar 28 11:59:37 2007] [error] [client 0.0.0.0] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Thu 29 Mar '07 2:28    Post subject: Reply with quote

The ScriptAlias directive indicates that everything in the WBDI directory and below is a cgi script.

That doesn't appear to be what you have - since there are .gif and .js files too.

Perhaps you just want to use a regular Alias directive, and allow .cgi files in WBDI - but not require everything under WBDI to be treated as a cgi.

Code:
Alias /wbdi/ "C:/folder/WBDI/"
<Directory "C:/folder/WBDI">
    AllowOverride All
    Options +ExecCGI
    AddHandler cgi-script .cgi
    Order allow,deny
    Allow from all
</Directory>


-tom-

p.s. The favicon.ico file is a small image file you can put in your web root to appear in the address bar in browsers - like the little red feather you probably see now in your address bar for Apache Lounge. Typically 32x32 pixels. It's not a problem if you don't have one, but the "File does not exist" messages clutter up your error log.

p.p.s. It looks like you are running Apache 2.2.4 on Windows 2000, and suffer from Apache/APR bug 41321 which causes all client IP addresses to be 0.0.0.0.
You can work around this bug by putting a Win32DisableAcceptEx directive in your httpd.conf file.

-t-
Back to top
gtsjames



Joined: 27 Mar 2007
Posts: 3

PostPosted: Sat 31 Mar '07 1:53    Post subject: Reply with quote

Thanks for the reply again. I did see the error with the client IP address to be 0.0.0.0, but I am using this as a test bed so it does not worry me so much.
I ended up having to use a modified version of you recommendation:

ScriptAlias /wbdi/apl "C:/Ricoh/WBDI/apl"
<Directory "C:/Ricoh/WBDI">
AllowOverride All
Options Indexes FollowSymLinks ExecCGI
AddHandler default-handler .jpg .gif .js .txt .bat .css
Order allow,deny
Allow from all
</Directory>

Alias /wbdi/ "C:/Ricoh/WBDI/"
<Directory "C:/Ricoh/WBDI">
AllowOverride All
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

I am not sure why I had to have the Alias and ScriptAlias. I will try again and see what happens. thanks again.
-gt
Back to top


Reply to topic   Topic: Apache 2 "You are not authorized to view this page & View previous topic :: View next topic
Post new topic   Forum Index -> Apache