LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-31-2006, 09:39 AM   #1
Gyper
LQ Newbie
 
Registered: May 2003
Posts: 5

Rep: Reputation: 0
Apache virtual hosts and mod_rewrite problem


Hi to all,

I want to test mod_rewrite in my debian box. I have browsed through the net but still not able to make mod_rewrite to work. Below are the steps that I have followed:
---
1. I have enabled mod_rewrite module in Apache2 using a2enmod command.
2. I have created a file "www.mine.org" in /etc/apache2/sites-available with the following entries:
###
<VirtualHost *>
ServerName www.mine.org
DocumentRoot /var/www/mine
ServerAdmin mine@mine.org
ErrorLog /var/log/apache2/www.mine.org-error_log
CustomLog /var/log/apache2/www.mine.org-access_log common
DirectoryIndex index.php

<Directory />
Order Deny,Allow
Allow from all
# Don't show indexes for directories
Options Indexes FollowSymLinks MultiViews
RewriteEngine On
RewriteRule ^/articles/([0-9]+)$ /?article=$1 [PT]

</Directory>
</VirtualHost>

###

3. I have enabled the site through the a2ensite command.
4. I have also have this entry in /etc/hosts:

###
127.0.0.1 localhost.localdomain localhost www.mine.org

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

###

---
I have entered "http://www.mine.org/articles/6" in my browser, I still got a 404 not found error I'm stumped on what to do next. Please help.

Thanks in advance.
 
Old 07-31-2006, 12:57 PM   #2
ckin2001
LQ Newbie
 
Registered: Jul 2006
Location: Chambana
Distribution: debian
Posts: 17

Rep: Reputation: 0
looking at the access/error logs is always a good start - /var/log/apache2/

The only thing that jumps out at me is the [PT]. If you don't have another handler down the line, there is no need for passthrough. The article at debian-administration.com uses it for their cgi scripting - is that where you found this?
 
Old 07-31-2006, 07:43 PM   #3
Gyper
LQ Newbie
 
Registered: May 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ckin2001
looking at the access/error logs is always a good start - /var/log/apache2/

The only thing that jumps out at me is the [PT]. If you don't have another handler down the line, there is no need for passthrough. The article at debian-administration.com uses it for their cgi scripting - is that where you found this?

Yes, you're right, I copied the line from debian-administration.com . I have googled the problem and visited many sites to look for the solution for this problem. I'll try later at home to disable the default virtual host site and also delete the [PT] (actually I have no idea what it does). If it still doesn't work and I'm fresh out of ideas, I'll try the one Apache releases.

Any more ideas guys?
 
Old 07-31-2006, 11:22 PM   #4
ckin2001
LQ Newbie
 
Registered: Jul 2006
Location: Chambana
Distribution: debian
Posts: 17

Rep: Reputation: 0
The official mod_rewrite reference for rewrite rules is at http://httpd.apache.org/docs/2.0/mod...ml#rewriterule . I would have linked it before, as well as http://www.debian-administration.org/articles/136 - but I hadn't posted enough to be allowed to post URLs.

Good luck
 
  


Reply

Tags
apache2, debian, host, modrewrite, software, virtual



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 06:29 AM
Virtual VirtualHosts in apache with mod_rewrite - help! mrjamin Linux - Software 1 01-30-2006 09:16 AM
Problem with Apache Virtual Hosts jaberwooky Linux - Software 4 09-23-2003 01:37 PM
Apache virtual hosts Mil0 Linux - Software 5 06-01-2003 11:58 PM
Apache Virtual Hosts (again) scatcat Linux - General 1 10-17-2002 09:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration