# connection to localhost refused - mediawiki install/config

## slackline

Hi All,

I've just installed MediaWiki (and the appropriate dependencies), after following http://meta.wikimedia.org/wiki/Help:Running_MediaWiki_on_Gentoo_Linux, and the instructions given after emerging mediawiki....

```

=================================================================

POST-INSTALL INSTRUCTIONS

=================================================================

Completing setup:

To complete installation cd into the MediaWiki install location, but

make sure to start mysql first with:

$ /etc/init.d/mysql start

$ cd /var/www/localhost/htdocs/mediawiki/

The host directory, localhost, may change depending on your installation.

Then temporarily make the MediaWiki /config directory writable

to the  user the web server is running as. The quickest way is 

to make  the directory world writable.  For example:

$ chmod a+w config

 

Then access it, for example:

lynx http://localhost/mediawiki/config/

 

After setup move the newly created LocalSettings.php from the config/

directory to the main mediawiki directory, for example:

  

$ mv config/LocalSettings.php .

    Remember to restore safe permissions to the MediaWiki config/ and

    LocalSettings.php (which contains clear-text passwords).

    chmod a-w config

    chmod ug=r,o=  LocalSettings.php

    chown root:apache LocalSettings.php

After these steps MediaWiki should be accesable at

http://localhost/mediawiki/

 

Enabling Optional Features:

If you wish to enable image uploads then you must manually edit the

LocalSettings.php file to uncomment the $wgDisableUploads line.  

If MediaWiki was built with the imagemagick USE-flag the directory

permissions are correct, otherwise you must install ImageMagick and

also adjust permissions on the images directory to allow the server

to write.  For example:

 

$ chown apache:apache /var/www/localhost/htdocs/mediawiki/images

Math Support:

If you wish to enable the math support then you must manually edit" 

the LocalSettings.php file to uncomment the $wgUseTeX line.

MediaWiki must have been built with the math USE-flag enabled or the

necessary support executable will not be present.

You may also have to execute

$ texconfig dvips printcmd -

if you have not configured tetex before.

=================================================================

```

All was fine, I went to the config page and set everything up there, however when I tried to view the Front page by visiting http://localhost/mediawiki// I recieve an error message telling me the connection to fisher.home was refused (fisher is the entry in /etc/hostname, and the domain I configured to be .home).

Can anyone suggest why this might be?  The loopback interface is up...

```

 ifconfig lo

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:1144 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1144 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:163178 (159.3 Kb)  TX bytes:163178 (159.3 Kb)

```

Is it possible that ports need to be explicitly open fir the lo interface?

Thank in advance for any pointers,

slack

----------

## PaulBredbury

Does your Linux firewall block local access? It is common to have an iptables rule at the start, which says:

```
iptables -A INPUT -s 127.0.0.1 -i lo -j ACCEPT
```

----------

## slackline

I've not played with the iptables at all, I've left them as per install (and updates after dispatch-conf), I have a router that I've configured for security (although I should probably also lock down the comp as well).

There is no mention of the loopback interface in /etc/init.d/iptables under any guise at all (no reference to 127.0.0.1/loopback/lo).

Let me know if I should post any more info.

Thanks,

Slack

----------

## PaulBredbury

What is the output of this, which shows the current iptables ruleset:

```
iptables -L -n
```

----------

## slackline

Hiya PaulBredbury,

Thanks for replying.  The output is...

```

# iptables -L -n

Chain INPUT (policy ACCEPT)

target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)

target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)

target     prot opt source               destination         

```

So I'm guesing I don't really have any iptables in place?

slack

----------

## PaulBredbury

At least iptables isn't the problem. But the problem could be any of apache, mediawiki or mysql I suppose.

----------

