Jump to content

access denied when trying to view web pages.


DeathfireD

Recommended Posts

Hello, I've been trying to get apache to run on my windows 2000 server and for some reason no matter what I do I cannot visit any sites within my web root folder. I've tryed using Apache 2.0, the old Apache and Xamp and I get all the same results.

From reading Apache's faq the error means that its somthing to do with permissions. So my only guess is that I have to set permissions for each folder?

So I'm here asking if anyone knows what I really need to do before I go ripping my windows security settings to hell.

Much thanks in advanced.
Link to comment
Share on other sites

Have you a html page or file in that folder?

Apache might not give a Directory/Folder listing.
Therefore you will have to go:
http://ipaddress/index.html
instead of simply:
http://ipaddress

This is only 1 of many many possible problems.
If you post your httpd.conf here we might be able to spot a problem.

Rgds,
Steve
Link to comment
Share on other sites

Well I tryed pointing it to a folder that had index.php ( I added it to the config) and I ended up getting a new error.

Forbidden
You don't have permission to access /php/php-5.1.2-Win32/php-cgi.exe/sitename/index.php on this server.

So I guess we are getting closer. Here is my config file.
http://www.freefileupload.net/file.php?file=files/041206/1165269920/https.conf
Link to comment
Share on other sites

hmm interesting enough after I restarted it and the computer server 5 times I now see everything thats in the root web folder. Yes, it does run a plain html/htm file. However any page that needs php it gives off
[b]Forbidden
You don't have permission to access /php/php-5.1.2-Win32/php-cgi.exe/sitename/index.php on this server.[/b]

Any ideas now? If you open my config file thats attached and search for php-5.1.2-Win32 you should find where I tried to add it. I'm not sure if I did it right though.

Also on a side note how would I add aliases?
Link to comment
Share on other sites

OK - I have taken a look at your httpd.conf.

Now I could be wrong, (ive apache2 here) but I dont think you have php tied in correctly with apache.
I think you need to Load a php module:
LoadModule php5_module c:/php5/php5apache2.dll
This loads php cli version.

From your config - you are using the cgi version. The cgi version is different and runs with apache configurations and has different permissions IMO.

You are going:
    AddType application/x-httpd-php .php .php5
    Action application/x-httpd-php "/php/php-5.1.2-Win32/php-cgi.exe"
    SetEnv PHPRC "c:/php/php-5.1.2-Win32"
Your above lines maybe correct - but obviously it aint working.

Also - you need to look in your apache ERROR.LOG !!!!!!!!!!!!
This will tell you whats wrong.

As for alias:
Alias /name/ "C:/name/"

You are doing it:
  Alias /otservnews "C:/Dans/otservnews"
but I think your forgetting the final slash.

Check the error logs. Make sure you have php tied in correctly with apache. The php-cli version is better than the php-cgi version IMO.

-steve
Link to comment
Share on other sites

error log is fulled with "client denied by server configuration C:/php/php-5.1.2-Win32/php-5.1.2-Win32, referer: http://mysite:5122 "

This is weird since in the config I don't have php-5.1.2-Win32 back to back like that. Anyway what do you guys suggest I do? change it from the cgi version to just php.exe? The only reason I used cgi was due to other web server software in the past that required me to use it. I wasn't sure what one to use on apache.

Also on a side note when I try and load the dll file apache wont start. I get service starting and then an error saying apache service could not be started. So when I comment out the load module apache starts fine. Here the load module line.

LoadModule php5_module c:/php/php-5.1.2-Win32/php5apache2.dll

Link to comment
Share on other sites

So there would definatly seem to be somthing funky going on with in the config.  Swapping out the cgi part to see what happens could posibly provide some usefull explinations.  Do you need cgi for anything specific? or forsee needing it again?  it could be that the php stuff is corupt (something went wrong from install, faulty download etc) and it might be worth trying to replace this from a diffrent source.


[code] I don't have php-5.1.2-Win32 back to back like that[/code]

To be honest it might be best in the long run just to start the config file again from new.  Or perhaps see if someone has put an example of a working vertion on the web.
Link to comment
Share on other sites

Hmm well php isn't corrupt since it works fine on any other server software I run. I didn't use an installer for it.

I tried changing the cgi to just php.exe and I get a page is missing (not the exact error).

Like I said in the first post i've tried several different versions of apache all with their own config and they all do the same thing. They either don't allow me to few contents in folders or they give off that php error as posted above. So I have started with a fresh config file before.

Any other ideas? This is frustrating as hell lol.
Link to comment
Share on other sites

damn it i've tryed everything and still get errors or apache wont start. It dosnt seem to be abail to find the module anywhere I put it :(.

When I comment out the module and just run it and then visit a php file I get this error:
Not Found
The requested URL /mysite/index.php was not found on this server.
Link to comment
Share on other sites

hmm ive been connecting to it via my DNS name myname:5122 when I do that I still get access to html files and whatnot its just php thats not loading. So are you saying in the settings I have php set to only run for local use? If so can you check my config file (its attacked to one of my posts before this one).
Link to comment
Share on other sites

I don't know if it's there for a reason but if it isn't

---------
look under this line
[quote]DocumentRoot "C:/Dans"[/quote]
.........you'll see this
[quote]
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    [b]Satisfy[/b] all
</Directory>
[/quote]
but perhaps Satisfy is keeping you from getting in

change the word "Satisfy" to "Allow from"



and then secondly....your httpd.conf file is called http[b]s[/b].conf
never worked with one of those before don't even know if they exist
Link to comment
Share on other sites

that was there when I downloaded apache.

As for the name of the config file. Sorry I changed the name when I was uploading it. It really is httpd.conf on my server too.

I made the change and still got the error "missing file".

Can someone send me a fresh apache2 httpd.conf  with php 5 installed in it correctly. Have it so php is located in the c:/php/php folder and the module is located in the same php folder. Make sure php5 works on your server then just attack the config here. Much thanks in advanced.
Link to comment
Share on other sites

[quote author=steviewdr link=topic=117256.msg479642#msg479642 date=1165396244]
Download wamp server etc. if you cant install php correctly; it will do it for you. Installing php on windows *is* tricky.

0steve
[/quote]
Is not tricky... Dont know why other people find it hard. I get setup alright.
Link to comment
Share on other sites

wildteen - if its not tricky - why is this thread so long?!  Also - can you easily explain the 2 versions of php there? cgi and cli - like whats all that to a noob?!! (of course I know). Setting up php can be tricky, and I wont even mention setting it up with IIS!

-steve
Link to comment
Share on other sites

well i'm no noob to installing php to IIS or any other windows server software its just for some reason php5 does not want to work with apache2 for me. Even when I install Wamp or Xamp like I've already mentioned. This is kinda why I made the thread since the config file makes perfect sense, its just not working.

As for php cgi and php cli. Its true I'm not exactly sure what each one is for. I'm guessing from the looks of it the cgi one is used to treat php files as programs (ie. #! in linux) and the php.exe is used to just read it as a script. If I'm wrong someone please correct me and explain.

Right now I plan to do as steviewdr said and try installing a fresh copy of apache2 and php5 on my laptop to see how that goes. If it works then theirs definitely something wrong with my windows 2k server.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.