Mercurial repos with Apache on RHEL

July 16, 2013

This is an update of Mercurial repos with Apache on Fedora 11 for Red Hat Enterprise Linux.

Mercurial

The version of Mercurial in the RHEL repository is 1.4 - three years ago when I did this on Fedora 11 version 1.5.4 was available. Lots of progress!

I installed Mercurial 2.2.2 using an RPM:

# rpm -i http://pkgs.repoforge.org/mercurial/mercurial-2.2.2-1.el6.rfx.x86_64.rpm

Apache IPTables

I was denied access to the running Apache process remotely, though it worked locally. This is because the iptables firewall was blocking access.

To get this to work I had to edit /etc/sysconfig and add a new line for port 80:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

Apache Forbidden

Apache was continually giving me a (13)Permission denied error in the logs. This is because I'd installed the repositories into /var/hg/repos and SELinux was preventing access to the files.

For this server, I was content to turn off SELinux - this may not be an option for you.

You can see if SELinux is enabled for you by doing:

# getenforce
Enforcing

Enforcing means it's on, Disabled means it's off, Permissive means it's on but it'll only warn rather than prevent access.

To turn off edit /etc/selinux/config and change the SELINUX value to be disabled:

SELINUX=disabled

I rebooted to get this to take effect.

References