Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Linux/Apache issue - Server throwing an internal Server error  (Read 3709 times)

jlhaslip

  • Sr. Member
  • ****
  • Karma: 16
  • Posts: 374
    • My snews with AEF Forum site
Linux/Apache issue - Server throwing an internal Server error
« on: September 22, 2008, 02:50:42 pm »

running on Ubuntu 8.04 with an XAMPP - php5.2.5, Apache 2., etc

Getting this error when I try to access an sNews installed locally:
Code: [Select]
[Mon Sep 22 05:46:00 2008] [notice] Apache/2.2.8 (Unix) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8e PHP/5.2.5 mod_apreq2-20051231/2.6.0 mod_perl/2.0.2 Perl/v5.10.0 configured -- resuming normal operations
[Mon Sep 22 06:15:29 2008] [alert] [client 127.0.0.1] /opt/lampp/htdocs/jim/snews/.htaccess: RewriteBase: argument is not a valid URL
[Mon Sep 22 06:20:43 2008] [alert] [client 127.0.0.1] /opt/lampp/htdocs/jim/snews/.htaccess: RewriteBase: argument is not a valid URL

Using this link: http://localhost/jim/snews/snews16_email/ with an .htaccess is as follows:
Code: [Select]
<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/snews16_email

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]
I have tried all combinations of the rewriteBase imaginable, but still can't get the Internal Error to go away. Combinations from home/jim/www/snews/snews16_email to snews/snews16_email
The folder being used to contain the files is not in the htdocs folder, I have a symbolic link (short-cut) pointing to a User account folder instead. Is this the issue? and how do I overcome this problem so that I can test locally? The Server works flawlessly for applications not requiring the mod-rewrite, so it seems to be an issue in the handling of the short-cut, I think.

Thanks for having a look.
Logged
Yes! I have no siggy.

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Linux/Apache issue - Server throwing an internal Server error
« Reply #1 on: September 22, 2008, 03:49:46 pm »

you fogot jim....
Rewritebase /jim/snews/......

With a simlink in htdocs but having it in a user account is working but not tried with mod_rewrite active... I will try ...
« Last Edit: September 22, 2008, 03:54:04 pm by funlw65 »
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Linux/Apache issue - Server throwing an internal Server error
« Reply #2 on: September 22, 2008, 04:58:28 pm »

Jlhaslip, is working. But you must do like this:

So, your linux home directory is /home/jim .  Good. And you have a subdirectory named snews where you have another subdirectory named snews16_email. Good. The secret is: in your "htdocs" directory (you don't have htdocs in your Ubuntu 8.04 ... right?) must have a symlink to snews16_email . So, you will have /var/www/snews16_email symlink which point to /home/jim/snews/snews16_email .

In your snews16_email directory (at your home zone, not in /var/www) must have a .htaccess file with RewriteBase /snews16_email line... and is working.

Tell me if I must tell this in another way...
« Last Edit: September 22, 2008, 05:00:00 pm by funlw65 »
Logged

jlhaslip

  • Sr. Member
  • ****
  • Karma: 16
  • Posts: 374
    • My snews with AEF Forum site
Re: Linux/Apache issue - Server throwing an internal Server error
« Reply #3 on: September 22, 2008, 05:00:07 pm »

tried that. failed with the same error.
Quote
I have tried all combinations of the rewriteBase imaginable
used /jim/www/snews/snews_email,  /www/snews/snews_email, /snews/snews_email, /jim/snews/snews_email and all the combinations thereof I could possibly imagine... including /home/jim/desktop/link to www as per the symlink title on the desktop

all give the Internal Server Error
Logged
Yes! I have no siggy.

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Linux/Apache issue - Server throwing an internal Server error
« Reply #4 on: September 22, 2008, 05:06:49 pm »

Why you not use Apache 2 package from standard Ubuntu 8.04? You have a manually installed  one?

I'm using the "default" one and is working perfectly. Plus, is updated by Canonical periodically to cover all possible security holes....

-------------------------
The original have this signature (Ubuntu 8.04 for LinuxPPC):
Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.3 with Suhosin-Patch Server at localhost Port 80
« Last Edit: September 22, 2008, 05:09:27 pm by funlw65 »
Logged

jlhaslip

  • Sr. Member
  • ****
  • Karma: 16
  • Posts: 374
    • My snews with AEF Forum site
Re: Linux/Apache issue - Server throwing an internal Server error
« Reply #5 on: September 22, 2008, 09:06:03 pm »

I used XAMPP as a one-click installer, then added the symbolic link to the folder in my user's account.
Until today, I have never had any issues with using the Apache or php, as long as the files are in the www folder of my user account. But this is the first time I have had to test an sNews locally. The sNews works great on my Hosting Account, but not on my laptop.
Logged
Yes! I have no siggy.

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Linux/Apache issue - Server throwing an internal Server error
« Reply #6 on: September 22, 2008, 09:22:41 pm »

Ok, try to put it right in your htdocs.
First, install Midnight Commander (is like Total COmmander in Win. but in text mode). Second, open a terminal (Gnome terminal).
Then, type this:

 sudo mc

You must provide your user password and mc will start with root rights. "Open" in left panel your directory destination  /opt/lampp/htdocs/ and in right panel /home/jim/snews . Select snews16_email directory and copy it to destination directory. Open it and type :
 
 gedit snews.php or whatever you want to edit. While you are in mc, you have root rights...

Good luck!

----------------
for installing Midnight Commander:
   sudo apt-get install mc

Also, I suggest to use Quanta for editing (many useful things you have inside):
  sudo apt-get install quanta


EDIT:
____________________________________
Very possible that you don't have mod rewrite enabled...
« Last Edit: September 22, 2008, 09:31:05 pm by funlw65 »
Logged

jlhaslip

  • Sr. Member
  • ****
  • Karma: 16
  • Posts: 374
    • My snews with AEF Forum site
Re: Linux/Apache issue - Server throwing an internal Server error
« Reply #8 on: September 22, 2008, 10:44:42 pm »

Yes, mod-rewrite was enabled, and when I tell you what the problem was, you'll be thinking "Oh! this would never happen to me...".
That is exactly what I thought, too...  ;D

Seems there was a stray .htaccess file in the folder (/snews/) above the snews install I was working with (/snews/snews16_email/). It had a mod-rewrite rules in it , of course, and the server was having trouble determining the hierarchy of the conflicting rules... so, it threw an Internal Server Error. Removed the top-level .htaccess and it works great now...

And thank you for the assistance. I think I had read all those links (or ones very similar to them), but they helped me focus on what the problem might have been.
« Last Edit: September 22, 2008, 10:46:24 pm by jlhaslip »
Logged
Yes! I have no siggy.

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Linux/Apache issue - Server throwing an internal Server error
« Reply #9 on: September 23, 2008, 12:41:03 am »

;D no, is not only your case ;D

I have one too, in /var/www/ as backup from an old project, orphaned... :P and when I type localhost/ in browser it give me "his rules" :P . But the projects works good, I have no site directly in "root web directory - /var/www" so it bother me only accidentally . I must remember it when I will begin to have weird problems..

Now, your case will help me ...
Logged