0

I had mediawiki installed and apache listening on port 9997 accessed via

example.com:9997/mediawiki

Mediawiki is under /var/www/html/mediawiki. So I wanted to change it to port 80. I changed /etc/apache2/ports.conf

Listen 80 #Listen 9997 

I then changed $wgServer which is under /var/www/html/mediawiki/LocalSettings.php

$wgServer = "http:/example.com:80"; 

According to the documentation, this should be all I have to do. Upon restart of apache, I can now see the default index.html of apache when I go to port 80 so I know that it's working. However, http://example.com/mediawiki results in a 404 -

The requested URL /html/mediawiki/index.php/Main_Page was not found on this server. 

This indicates to me that it is forwarding mediwiki to mediwiki/index.php and creating the Main_Page but something is going wrong. I can see in the apache access.log .

 example.com - - [05/Nov/2014:22:21:27 -0800] "GET /html/mediawiki/index.php/Main_Page HTTP/1.1" 404 528 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/" 

I'm not sure if the access file helps but I am stumped.

3
  • 2
    At first glance it appears the short URL isn't handled correctly, you may need to check if your rewrite rules still include the old port number. Commented Nov 6, 2014 at 6:52
  • Thank you. Can you help me a little more on checking if my rewrite rules include the old port number? How would I go about checking this Commented Nov 6, 2014 at 8:20
  • Either in a Apache configuration file or a .htaccess file in the wiki installation directory Commented Nov 6, 2014 at 9:29

1 Answer 1

0

Your MediaWiki directory is probably configured on a VirtualHost, which usually specify the port number. Once you changed the listening port, you should also change the VirtualHost directive to match the new port.

Example of VirtualHost directive (you can see the port number 9997 here):

<VirtualHost *:9997> DocumentRoot "/var/www/html/mediawiki" ServerName localhost # Other directives here </VirtualHost> 

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.