print Creating a Scorpio development environment

Variations in setting up a system

This tutorial is based on using Fedora 7+ but was actually tested using CentOS 5.2. CentOS (and therefore Redhat Enterprise 5+) require some additional work as Redhat decided to use PHP 5.1.6 as their stable PHP. Unfortunately this is too old for Scorpio which requires at least 5.2.0.

CentOS 5 and Redhat Enterprise 5

Fortunately it is possible to add in some additional repositories and to install a more recent PHP 5 without too much trouble. So for CentOS 5+ and Redhat 5+ follow these additional steps:

Install Apache, MySQL and SubVersion like normal:

yum install httpd mod_ssl mysql mysql-server subversion

And then download the following RPM files which will install additional repositories.

wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release5-2.noarch.rpm
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rpm
wget http://rpms.famillecollet.com/el5.i386/remi-release-5-4.el5.remi.noarch.rpm

Now install the rpm files by issuing:

rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm

Now install PHP5 and the remaining packages by using:

yum --enablerepo=remi install php php-cli php-common php-pdo php-pdo-mysql php-mcrypt \
php-soap php-xmlrpc php-mbstring php-mysql php-gd php-bcmath php-pecl-apc \
php-pecl-imagick phpMyAdmin php-xml

This should install PHP 5.2.6 (at the time of writing). Test by calling php -i on the CLI and checking the version reported. If all is good, you can then following the rest of the guide.

Debian based systems

Debian based systems use APT for package management. For the most part the package names are the same (or very similar) so you can substitute:

 apt-get install 

In place of 'yum'. If you are using Ubuntu 8.10 (confirmed to work) you can use tab completion of package names to help make it a little easier. So long as you have PHP 5.2.6 that is all that really matters.

The other thing to bare in mind with Debian systems is that they do not put config files in the same places as Fedora / Redhat and (up until Ubuntu 8.10) they do not use "service" for manipulating running processes.

For Debian systems you can find the Apache files in the following locations:

vhosts.conf in Debian contains the main vhosts settings and NOT specific site configurations. Instead sites-available entries contain just the virtual host sections and need to be symlinked to /etc/apache2/sites-enabled/ to enable them (kinda crazy but it does make some amount of sense).

MySQL config is similarly located in: /etc/mysqld/

PHP config files are again relocated to: /etc/php/ and are split down further into apache and cli and the various extensions.

The hosts file is un-affected.

One more note: if you find you are getting database connection errors because PHP cannot locate the "MySQL socket", add to the config.xml file in /libraries an option for host and set this to 127.0.0.1 which will override the socket connection. This usually happens if you change either the MySQL config or the PHP config. Best option is to not change and just use the Debian defaults.

There may be other differences, but these are the ones I have noted (and can remember).

One last thing...

Don't forget to update your firewall settings to allow connections on ports 80 and 443 (if using SSL). On Fedora you can do these by running system-config-firewall-tui which is a command line interface to iptables.

Alternatively, if you know your iptables inside out, or have an aversion to using a GUI for this; add the config manually. The config that was used for this tutorial was the following:

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

The iptables config file can be located under /etc/sysconfig/iptables.