Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: 403 Forbidden  (Read 5244 times)

petemac

  • Newbie
  • *
  • Karma: 1
  • Posts: 8
403 Forbidden
« on: September 15, 2007, 03:02:59 pm »

Hi everyone,

I have a problem getting v1.6 MU to function. I get an error message when I try to access the page as follows:
---------------------------------------------------------------------------------------------------
Forbidden

You don't have permission to access /snews/ on this server.
Apache/2.0.59 (Win32) DAV/2 PHP/5.2.3 Server at localhost Port 80
---------------------------------------------------------------------------------------------------

That's all there is on the page!!!

Everything else on my server works fine. I know it's something to do with the .htaccess but what it is I don't know!

I've checked everything and read all the previous problems and I still can't get it to work. If I delete the .htaccess file then I can access the page and it shows up as normal but without rewrite module I can't go any further. If I click on LOGIN I get a message that "The requested URL /snews/login/ was not found on this server."

I have installed the script in the snews directory off my root directory.

My .htaccess file looks like this:

--------------------------------------------------------------------------------------------------------------------------------------
<IfModule mod_php4.c>
    php_value session.use_trans_sid 0
</IfModule>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
RewriteEngine On
RewriteBase /snews
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+) index.php?category=$1&title=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+)/([^/]+)/ index.php?category=$1&title=$2&commentspage=$3 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9_-]+)/([0-9]+)/ index.php?category=$1&nbsp;articlespage=$2 [L]
--------------------------------------------------------------------------------------------------------------------------------------

In my httpd.conf file the following line exists:

LoadModule rewrite_module modules/mod_rewrite.so and it is not commented out.

The database was installed correctly and the following lines are at the start of the snewsMU.php file:

   $db['website'] = 'http://localhost/snews/';
   $db['dbhost'] = 'localhost'; //MySQL Host
   $db['dbname'] = 'snews'; //Database Name
   $db['dbuname'] = 'xxxxxxxx'; //Database Username
   $db['dbpass'] = 'xxxxxxxx'; //Database password
   $db['prefix'] = ''; //Database prefix


I have not included my username or password above.

Can anyone help me here. I would really love to get this up and running soon. The problem is driving me crazy!!!

Many thanks in advanced to all of the thousands who will rush to help me -  ???
Logged

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Re: 403 Forbidden
« Reply #1 on: September 15, 2007, 03:14:49 pm »

ok,not sure if this will help, but it may be worth a try.
firstly, try commenting out the first 2 blocks, one at a time.
Code: [Select]
#<IfModule mod_php4.c>
#    php_value session.use_trans_sid 0
#</IfModule>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
then
Code: [Select]
<IfModule mod_php4.c>
    php_value session.use_trans_sid 0
</IfModule>
#<IfModule mod_security.c>
#SecFilterEngine Off
#SecFilterScanPOST Off
#</IfModule>
and see either that makes a difference...
Logged
Of all the things I have lost, it is my mind that I miss the most.

petemac

  • Newbie
  • *
  • Karma: 1
  • Posts: 8
Re: 403 Forbidden
« Reply #2 on: September 15, 2007, 03:39:00 pm »

Thanks for the speedy response but neither worked. It seems the only way I can see the index.php file is when .htaccess does NOT exist - but then nothing else works - ie login.
Logged

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Re: 403 Forbidden
« Reply #3 on: September 15, 2007, 04:24:27 pm »

hang on... permissions
if this is on a host, make sure perms for snews directory ( /snews/ ) is set to 777 or similar (use ftp)
If windows, make sure it isn't set as read only.
Logged
Of all the things I have lost, it is my mind that I miss the most.

petemac

  • Newbie
  • *
  • Karma: 1
  • Posts: 8
Re: 403 Forbidden
« Reply #4 on: September 15, 2007, 04:48:15 pm »

No, it's on my local computer. I want to make sure everything works OK and that I am familiar with it before I use it live. I do this with everything I use before going live!
Logged

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Re: 403 Forbidden
« Reply #5 on: September 15, 2007, 05:01:55 pm »

hmm, well,
what about case???

sNews
snews
Logged
Of all the things I have lost, it is my mind that I miss the most.

petemac

  • Newbie
  • *
  • Karma: 1
  • Posts: 8
Re: 403 Forbidden
« Reply #6 on: September 15, 2007, 05:40:38 pm »

I have installed the script to http://localhost/snews and as far as I know everything points there. I'd love to get this this up and running tonight and have a restful sleep (I'm one of those guys that cannot let go of a problem until it's solved - yeah I know that's not good for my health but for me it works).

I've tried for 3 days on my own because I could not register for the forum (and then only by telling lies - but that's another story - I'll explain later when I've got this sorted out as I don't want to be kicked out!!!). So it would be nice to go to bed tonight and not think or dream about sNews.
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: 403 Forbidden
« Reply #7 on: September 15, 2007, 08:35:03 pm »

Pete, have you tried using a server package like WAMP/XAMPP (Windows), LAMP (Linux) or MAMP (Mac)? It seems that it's easier to get things running properly when using a server package rather than using the built-in or added on bits "raw" on your system. As a Mac user I know that it is much much much easier to use MAMP than the built-in bits.

Also, can you copy the first lines of your index.php code and post here -- there may be something there that gets f***ed up and causing the 403. Grab the stuff from <?php include('snews.php') ... down to and including the line <?php title(); ?>. Your .htaccess seems correct as does the db variables in snews.php so ... something else is obviously afoot.
Logged

brauck

  • Hero Member
  • *****
  • Karma: 18
  • Posts: 556
    • http://www.hbw-webdesign.nl/
Re: 403 Forbidden
« Reply #8 on: September 15, 2007, 10:44:55 pm »

This error can also occur if you have a category with the same name as a folder. e.g.
if you have a folder called: css
and you have a category named css.
and you point your browser to this category then you get a 403.
maybe this helps
Logged
Confidence is reduced complexity.
brauck.nl for free css templates

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: 403 Forbidden
« Reply #9 on: September 16, 2007, 03:34:54 am »

@ Pete...
You didn't note what OS you have on your computer. If you are running on a Mac, then Agentsmith is our Mac-agent. However... if you are running "localhost" on a WinXP2 machine... then I suggest you remove whatever you have for server apps and install the XAMPP package. I am using the full package on my home machine, and the latest xampplite package on my laptop with XP-Pro, both without any hitches. The only change I had to make with both was enabling the mod_rewrite string, after installing, before enabling.

I install all of my projects in separate folders in the htdocs directory which is... essentially... the server root. localhost replaces the www in the URL. If you install your package in a folder called snews within the htdocs folder (in xampp)... then the path setting you already had in your database variables array is correct. You do not, however, need to alter the .htaccess file at all. If you leave it exactly as it was in the un-zipped package... and you have your database settings correct... the site WILL run. So, comment out that line shown below in red:

Quote
<IfModule mod_php4.c>
    php_value session.use_trans_sid 0
</IfModule>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
RewriteEngine On
# RewriteBase /snews

« Last Edit: September 16, 2007, 03:36:54 am by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

petemac

  • Newbie
  • *
  • Karma: 1
  • Posts: 8
Re: 403 Forbidden
« Reply #10 on: September 16, 2007, 11:11:18 am »

Hello again,

OK I'll reply to all overnight sugestions here in the one post.

I am using the Uniform Server package which I've been using for the last 5 years. It includes Apache/2.0.59 (Win32) DAV/2 PHP/5.2.3 and can be run by a beginner immediately after unpacking. I don't think my problem lies here. In the uniform server folder there is a folder called www which is where all my programs and packages run, usually immediately after installing. There's a lot of talk here about using WAMP and XAMPP and about changing but I really don't want to as my package has been running well. I don't think it's anything to do with the server

I'm using Windows XP which is completely up to date wth service packs etc.

As requested here are the lines from index.php from the include to the title. Nothing strange there. It's straight from the zip file!

<?php session_start(); include('snewsMU.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <?php title(); ?>
--------------------------------------------------------------------

As for categories and folders with the same name I can't answer as I've not been able to get into the program. I don't know what categories exist but it's the default installation straight from the zip file.

--------------------------------------------------------------------

Here is a quote from the readme.html file:

If you are using sNews in another folder than the root of your site, please, edit the ".htaccess"
and remove the # at the begining of the RewriteBase /sNewsMU if your folder is sNewsMU (change this name to your needs)


As I'm running the program from a folder in my www folder called snews I uncommented the line in .htaccess and changed it to snews as follows:

RewriteBase /snews

OK thanks to everyone for all the suggestions but I still think that the problem is with .htaccess

As I said in my original post I receive only the 403 forbidden error when the .htaccess file exists in the snews folder - and nothing else - the rest of my screen is white. When I remove the .htaccess file I get the normal sNews start page which looks like this:

--------------------------------------------------------------------------------

sNews 1.6 MU (Multiple Users)                                                                   Home    Archive    Contact    Site Map    Register

Home

Categories:                                                                   Content not found

Home                                                                                                                                                                                 Search

New Articles:

No articles at the moment

New comments:

No comments at the moment




Barbecued by sNews Login                                                                                                      RSS Articles    RSS Comments

Registered users online: 0
Guests online: 1

----------------------------------------------------------------------

Great, but nothing else functions without the rewrites needed and found in the .htaccess

I like the idea of everything running from only one file and from what I've seen of sNews it looks great. Compared with commercial scripts like Article Live which contains over 4500 files and folders and takes up over 22MB with a new installation sNews is ideal - when it works. I don't usually give up on a project but there comes a time when one must say "enough time wasted - move on". I think I'll work at it today (Sunday) and then ....

Logged

brauck

  • Hero Member
  • *****
  • Karma: 18
  • Posts: 556
    • http://www.hbw-webdesign.nl/
Re: 403 Forbidden
« Reply #11 on: September 16, 2007, 02:43:36 pm »

Pete, forget about my suggestion, I see you haven't created any categorie, so this can't be the cause.
Logged
Confidence is reduced complexity.
brauck.nl for free css templates

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: 403 Forbidden
« Reply #12 on: September 16, 2007, 03:19:28 pm »

I am using the Uniform Server package... There's a lot of talk here about using WAMP and XAMPP and about changing but I really don't want to as my package has been running well. I don't think it's anything to do with the server.
@ Pete... well we didn't know what you were using for a server package so we (Agent and I) suggested using something we had good experience with and knew was working for us. The Uniform Server package... for anyone else interested in trying it out...is a WAMP package configured to run with any Microsoft OS. So that would not appear to create a problem as you suggest.

You've noted that you've tried using the existing .htaccess file with the RewriteBase string enabled... but have you tried it without the string enabled yet? sNews is a really easy CMS to set up and run... it would be a shame if you gave up before getting it to work.  :)
« Last Edit: September 17, 2007, 12:44:17 am by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

petemac

  • Newbie
  • *
  • Karma: 1
  • Posts: 8
Re: 403 Forbidden
« Reply #13 on: September 16, 2007, 07:23:30 pm »

Yes I've tried with the RewriteBase string disabled but still no luck. Today I even tried runnning it on an older version of the server using PHP 4.? in case it was a problem with PHP 5 but it still didn't run. That was also on my laptop which uses Windows XP Pro. I did this to see if it was a problem with my main computer.

I'm all out with this one. Usually I enjoy a bit of a challenge but...

Many thanks to all who have tried to help me. I won't give up though!!!
Logged

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Re: 403 Forbidden
« Reply #14 on: September 16, 2007, 08:44:29 pm »

firewall?
would that interfere with htaccess??

just a question for any who might know .
Logged
Of all the things I have lost, it is my mind that I miss the most.
Pages: [1] 2