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.

Jenny D
  • 27,780
  • 21
  • 75
  • 114
jwillis0720
  • 155
  • 10
  • 2
    At first glance it appears the [short URL](http://m.mediawiki.org/wiki/Manual:Short_URL/Apache) isn't handled correctly, you may need to check if your rewrite rules still include the old port number. – HBruijn Nov 06 '14 at 06: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 – jwillis0720 Nov 06 '14 at 08:20
  • Either in a Apache configuration file or a .htaccess file in the wiki installation directory – HBruijn Nov 06 '14 at 09:29

1 Answers1

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>
ciencia
  • 101
  • 2