Skip to content

Instantly share code, notes, and snippets.

@mettamatt
Created October 4, 2010 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mettamatt/609158 to your computer and use it in GitHub Desktop.
Save mettamatt/609158 to your computer and use it in GitHub Desktop.
Firewall
Note that in some versions of CentOS, a firewall is installed by default which will block access to port 80, on which Apache runs. The following command will open this port and save the rule to iptables.
iptables -I RH-Firewall-1-INPUT -p tcp --dport http -j ACCEPT
service iptables save
PHP5 Install
Drupal is written in PHP. Let's move on to the PHP5 install. As before, due to using yum to install PHP5, any dependencies are taken care of:
CentOS/RHEL doesn't support a version of PHP we can use, so we have to use an alternate repository. The current leading repository for PHP 5.2 on CentOS is the jasonlitka.com repository. We use this repository because most others have moved on to PHP 5.3.x
rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
then create the file /etc/yum.repos.d/jasonlitka.repo with these contents (the last line says use it only for php):
[utterramblings]
name=JasonLitka Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
includepkgs=php* mysql=*
Now install the php pieces we need:
yum install php php-common php-cli php-gd php-mcrypt php-pear php-mhash php-mysql php-xml php-mbstring
Once done, do a quick Apache restart:
service httpd restart
Test that PHP is working by creating a test page.
echo "<?php phpinfo();" > /var/www/html/phpinfo.php
chmod 644 /var/www/html/phpinfo.php
Navigate to your new index.php page, you will see the PHP info screen.
http://<hostname_or_ip>/phpinfo.php
PhpMyAdmin
Installation: We need EPEL
To install phpMyAdmin using yum we will need to include the EPEL (Extra Packages for Enterprise Linux) repository. This repository was developed by the Fedora community to provide extra add-on packages for Fedora-based Redhat Enterprise Linux and it's other compatible offspring such as CentOS.
One thing to keep in mind when adding extra repositories is that many include newer versions of packages that are readily available through the standard channels. This can cause problems as packages can be automatically upgraded and cease to function as expected.
I want to make it clear that the EPEL repository is purely complimentary and only provides additional packages that are otherwise unavailable through the default repositories.
Let's begin by installing the EPEL repository:
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5Server/x86_64/epel-release-5-4.noarch.rpm
TIP: If for some reason you need to deleted a repository, run: rpm -e epel-release-5-4.noarch.rpm
Install phpMyAdmin
yum install phpmyadmin
Edit /etc/httpd/conf.d/phpMyAdmin.conf to allow access from non-localhost clients.
Edit /etc/phpMyAdmin/config.inc.php to add additional servers and use the "mysqli" driver for connections.
@rfay
Copy link

rfay commented Oct 4, 2010

This is a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment