Anarchopedia:en:administration/virtual hosts configuration

From Anarchopedia
< Anarchopedia:en:administration
Revision as of 03:34, 19 November 2010 by MrDog (Talk | contribs) (Reverted edits by Yrukiny (Talk) to last version by Millosh)

Jump to: navigation, search

This is configuration for virtual hosts in Apache2 which is running Anarchopedia:

HTTPD configuration

       ServerAdmin SERVERADMIN
       DocumentRoot VHOSTROOT/langs/LANGUAGE
       <Directory />
               Options FollowSymLinks
               AllowOverride None
       <Directory VHOSTROOT/langs/LANGUAGE>
               Options Indexes FollowSymLinks MultiViews
               AllowOverride None
               Order allow,deny
               allow from all
               # This directive allows us to have apache2's default start page
               # in /apache2-default/, but still have / go to the right place
               # RedirectMatch ^/$ /apache2-default/
       ScriptAlias /cgi-bin/ VHOSTROOT/cgi-bin/LANGUAGE
       <Directory "VHOSTROOT/cgi-bin/LANGUAGE">
               AllowOverride None
               Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
               Order allow,deny
               Allow from all
       ErrorLog VHOSTROOT/logs/error-LANGUAGE.log
       # Possible values include: debug, info, notice, warn, error, crit,
       # alert, emerg.
       LogLevel warn
       CustomLog VHOSTROOT/logs/access-LANGUAGE.log combined
       ServerSignature On
       Alias /icons/ "/usr/share/apache2/icons/"
       <Directory "/usr/share/apache2/icons">
           Options Indexes MultiViews
           AllowOverride None
           Order allow,deny
           Allow from all
       php_value include_path .:./include:VHOSTROOT/include:VHOSTROOT/phplib:VHOSTROOT/include/LANGUAGE:VHOSTROOT/phplib/LANGUAGE:VHOSTROOT/langs/LANGUAGE/include
       <Files .*>
               Order Deny,Allow
               Allow From All
       # Allow rewriting URLs
       RewriteEngine on
       # The following rules are only for backwards compatibility
       # (so that old links to your site keep working). You should leave them out in a new install.
       # Redirect old /wiki/ urls
       RewriteRule ^/wiki/(.*)$$1 [R,L]
       # Redirect old /wiki.phtml?title= and index.php urls
       RewriteRule ^/wiki\.phtml\?title=(.*)$$1 [R,L]
       RewriteRule ^/index.php\?title=(.*)$$1 [R,L]
       RewriteRule ^/index.php/(.*)$$1 [R,L]
       # end backward compatibility rules, the following ones are important
       # Don't rewrite requests for files in MediaWiki subdirectories,
       # MediaWiki PHP files, HTTP error documents, favicon.ico, or robots.txt
       RewriteCond %{REQUEST_URI} !^/(stylesheets|images|skins)/
       RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php
       RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html
       RewriteCond %{REQUEST_URI} !^/favicon.ico
       RewriteCond %{REQUEST_URI} !^/robots.txt
       RewriteRule ^/(.*)$ /index.php?title=$1 [L,QSA]

Notes about rewrite rules

  1. Our rewrite rule doesn't work with amparsan sign in the article name, so don't use this. (Reference: Rewrite rules from Meta.Wikipedia.)
  2. During the process of initialization of MediaWiki rewrite rules should not exist because installation is imposible.