[documentation] [task] Clean URLs- moving Apache 2 on Debian specific comment to a child page

Amazon drupal-docs at drupal.org
Sun Jan 8 01:57:08 UTC 2006


Issue status update for 
http://drupal.org/node/43785
Post a follow up: 
http://drupal.org/project/comments/add/43785

 Project:      Documentation
 Version:      <none>
 Component:    Installation
 Category:     tasks
 Priority:     critical
 Assigned to:  Anonymous
 Reported by:  Amazon
 Updated by:   Amazon
 Status:       active

This comment was valuable so I am filing an issue asking the
documentation team to create a handbook page. 
http://drupal.org/node/15365#comment-50324


The comment is now a handbook page here: http://drupal.org/node/43783


If you're running Apache2 on Debian stable, in order to install the
rewrite module you simply need to:


# a2enmod rewrite


then restart the webserver:


# /etc/init.d/apache2 restart


then edit either /etc/apache2/sites-enabled/drupal or to your .htaccess
and ensure it looks something like this:
#
# Apache/PHP/site settings:
#
# Protect files and directories from prying eyes:
<Files ~
"(\.(conf|inc|module|pl|sh|sql|theme|engine|xtmpl)|Entries|Repositories|Root|scripts|updates)$">
  order deny,allow
  deny from all
</Files>
# Set some options
Options -Indexes
Options +FollowSymLinks
# Customized server error messages:
ErrorDocument 404 /index.php
# Set the default handler to index.php:
DirectoryIndex index.php
# Overload PHP variables:
<IfModule sapi_apache2.c>
   # If you are using Apache 2, you have to use <IfModule
sapi_apache2.c>
   # instead of <IfModule mod_php4.c>.
   php_value register_globals        0
   php_value track_vars              1
   php_value short_open_tag          1
   php_value magic_quotes_gpc        0
   php_value magic_quotes_runtime    0
   php_value magic_quotes_sybase     0
   php_value arg_separator.output    "&amp;"
   php_value session.cache_expire    200000
   php_value session.gc_maxlifetime  200000
   php_value session.cookie_lifetime 2000000
   php_value session.auto_start      0
   php_value session.save_handler    user
   php_value session.cache_limiter   none
   php_value allow_call_time_pass_reference  On
</IfModule>
# Various rewrite rules
<IfModule mod_rewrite.c>
  RewriteEngine on
  Options All
  # Modify the RewriteBase if you are using Drupal in a subdirectory
and the
  # rewrite rules are not working properly:
  RewriteBase /drupal
  # Rewrite old-style URLS of the form 'node.php?id=x':
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{QUERY_STRING} ^id=([^&]+)$
  RewriteRule node.php index.php?q=node/view/%1 [L]
  # Rewrite old-style URLs of the form 'module.php?mod=x':
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
  RewriteRule module.php index.php?q=%1 [L]
  # Rewrite URLs of the form 'index.php?q=x':
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
# $Id: .htaccess,v 1.58 2004/10/09 20:41:49 dries Exp $


This is because the debian package installs the drupal "sites-enabled"
virtual host, result being that drupal is accessed from
http://yourhost.com/drupal, hence the need to uncomment RewriteBase. 
Change it to the base that corresponds to your system.


ref: http://www.debian-administration.org/articles/136
http://drupal.org/node/14322


--
Sean K. O'Brien
CTO
Colley Graphics, LLC
http://www.colleygraphics.com [1]
[1] http://www.colleygraphics.com/




Amazon



More information about the documentation mailing list