1

I am working from Manual:Short URL/Apache guide to set up a wiki with a shortened url on a Debian server running Apache2.

I want the directory /var/www/currienet/w/ to be accessible on currienet/wiki/ (local network address)

I have the following in httpd.conf file:

<VirtualHost *:80> ServerName http://currienet # !!! Be sure to point DocumentRoot to 'public'! DocumentRoot /var/www/currienet/root/ <Directory /var/www/currienet/root> Allow from all </Directory> <Directory /var/www/currienet/w/> </Directory> # Alias /wiki '/var/www/currienet/w' LogLevel debug # Enable the rewrite engine RewriteEngine On # Short url for wiki pages RewriteRule ^/?wiki(/.*)?$ /var/www/currienet/w/index.php [L] </VirtualHost> 

And the following settings in the LocalSettings.php

$wgScriptPath = "/w"; $wgArticlePath = "/wiki/$1"; 

When I try and access currienet/wiki I get the main page displaying, but none of the images, stylesheets etc are loaded and I get the following in the Apache error log (ip's blocked out for security):

[Tue Oct ***.***.***.*** 2012] [notice] Apache/2.2.22 (Debian) Phusion_Passenger/3.0.17 PHP/5.4.4-2 configured -- resuming normal operations [Tue Oct ***.***.***.*** 2012] [error] [client ***.***.***.***] File does not exist: /var/www/currienet/root/w, referer: http://currienet/wiki/Main_Page [Tue Oct ***.***.***.*** 2012] [debug] mod_deflate.c(615): [client ***.***.***.***] Zlib: Compressed 283 to 216 : URL /w/load.php, referer: http://currienet/wiki/Main_Page [Tue Oct ***.***.***.*** 2012] [error] [client ***.***.***.***] File does not exist: /var/www/currienet/root/w, referer: http://currienet/wiki/Main_Page [Tue Oct ***.***.***.*** 2012] [debug] mod_deflate.c(615): [client ***.***.***.***] Zlib: Compressed 283 to 216 : URL /w/load.php, referer: http://currienet/wiki/Main_Page [Tue Oct ***.***.***.*** 2012] [error] [client ***.***.***.***] File does not exist: /var/www/currienet/root/w, referer: http://currienet/wiki/Main_Page [Tue Oct ***.***.***.*** 2012] [debug] mod_deflate.c(615): [client ***.***.***.***] Zlib: Compressed 283 to 216 : URL /w/load.php, referer: http://currienet/wiki/Main_Page [Tue Oct ***.***.***.*** 2012] [error] [client ***.***.***.***] File does not exist: /var/www/currienet/root/w, referer: http://currienet/wiki/Main_Page [Tue Oct ***.***.***.*** 2012] [debug] mod_deflate.c(615): [client ***.***.***.***] Zlib: Compressed 324 to 248 : URL /w/skins/common/images/poweredby_mediawiki_88x31.png, referer: http://currienet/wiki/Main_Page [Tue Oct ***.***.***.*** 2012] [debug] mod_deflate.c(615): [client ***.***.***.***] Zlib: Compressed 0 to 2 : URL /wiki/images/swan.png, referer: http://currienet/wiki/Main_Page [Tue Oct ***.***.***.*** 2012] [debug] mod_deflate.c(615): [client ***.***.***.***] Zlib: Compressed 11292 to 3748 : URL /wiki/Images/swan.png, referer: http://currienet/wiki/Main_Page 

And the following in other_vhosts_access.log:

currienet:***.***.***.***.96 - - [02/Oct/2***.***.***.*** +0800] "GET /wiki/Main_Page HTTP/1.1" 304 276 "http://currienet/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1" currienet:***.***.***.***.96 - - [02/Oct/2***.***.***.*** +0800] "GET /w/load.php?debug=false&lang=en-gb&modules=mediawiki.legacy.commonPrint%2Cshared%7Cskins.vector&only=styles&skin=vector&* HTTP/1.1" 404 497 "http://currienet/wiki/Main_Page" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1" currienet:***.***.***.***.96 - - [02/Oct/2***.***.***.*** +0800] "GET /w/load.php?debug=false&lang=en-gb&modules=startup&only=scripts&skin=vector&* HTTP/1.1" 404 498 "http://currienet/wiki/Main_Page" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1" currienet:***.***.***.***.96 - - [02/Oct/2***.***.***.*** +0800] "GET /w/load.php?debug=false&lang=en-gb&modules=skins.vector&only=scripts&skin=vector&* HTTP/1.1" 404 498 "http://currienet/wiki/Main_Page" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1" currienet:***.***.***.***.96 - - [02/Oct/2***.***.***.*** +0800] "GET /w/skins/common/images/poweredby_mediawiki_88x31.png HTTP/1.1" 404 530 "http://currienet/wiki/Main_Page" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1" currienet:***.***.***.***.96 - - [02/Oct/2***.***.***.*** +0800] "GET /wiki/images/swan.png HTTP/1.1" 301 539 "http://currienet/wiki/Main_Page" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1" currienet:***.***.***.***.96 - - [02/Oct/2***.***.***.*** +0800] "GET /wiki/Images/swan.png HTTP/1.1" 404 4209 "http://currienet/wiki/Main_Page" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1" currienet:80 ::1 - - [02/Oct/2***.***.***.*** +0800] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Debian) (internal dummy connection)" currienet:80 ::1 - - [02/Oct/2***.***.***.*** +0800] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Debian) (internal dummy connection)" 

1 Answer 1

1

You've got a few things wrong with your Apache config.

ServerName http://currienet 

This should be the domain name of the site without the http://

ServerName currienet.blah.com 

This directory block should explicitly state its options and access.

<Directory /var/www/currienet/w/> Order Allow,Deny Allow from all </Directory> 

You have commented out the one line that you need:

# Alias /wiki '/var/www/currienet/w' 

Also, you should have an Alias line with an ending / on the wiki.

Alias /wiki/ '/var/www/currienet/w/' 

Now, rewrites. Rewrite rules are for mapping one url to another- not mapping a url to a directory.

 # Short url for wiki pages RewriteRule ^/?wiki(/.*)?$ /var/www/currienet/w/index.php [L] 

This is not going to do what you expect (it will attempt to serve the page http://YOURSITE/var/www/currienet/w/index.php which probably doesn't exist). If you've put the Alias directive in place and have properly set the Directory options for that dir then you don't need any rewrite rules.

1
  • Thank you so much for your response. This cleared up a number of semantic details I wasn't grasping or I had confused. Unfortunately, I followed your instructions and am now getting the error The requested URL /wiki/Main_Page was not found on this server. when I try and view currienet/wiki/ Commented Oct 2, 2012 at 7:54

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.