install apache and php
- ref: http://articles.slicehost.com/2008/2/6/centos-installing-apache-and-php5
- install apache w/ ssl support:
sudo yum install httpd mod_ssl - launch apache:
sudo /etc/init.d/httpd start - browse to your vm’s address (run ifconfig in the vm if you don’t know the address)
- if your browser can’t find the address, write an iptable rule to allow access to port 80:
- ref: http://www.cyberciti.biz/faq/howto-rhel-linux-open-port-using-iptables/
- open the iptable definition file:
vi /etc/sysconfig/iptables - plug in the new rule:
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT - note: the leading ‘-‘ in the rule is intentional
- restart the iptables process:
/etc/init.d/iptables restart
- install php:
sudo yum install php-common php-gd php-mcrypt php-pear php-pecl-memcache php-mhash php-mysql php-xml - reload apache:
sudo /etc/init.d/httpd reload
set up mysql
- ref: http://articles.slicehost.com/2009/4/7/centos-installing-mysql-with-rails-and-php-options
- as per the article above, install mysql:
sudo yum install mysql-server mysql mysql-devel - launch the mysql daemon:
sudo /etc/init.d/mysqld start - set a root user/password:
/usr/bin/mysqladmin -u root password ‘new-password’ - confirm new account was set up correctly:
mysql -uroot -ppassword - then quit out of mysql:
mysql> quit;
upgrade beyond stock centos support so we can get php version > 5.2.2, which is required for phpmyadmin
- ref: http://www.jasonlitka.com/yum-repository/
- import his GPG key:
rpm –import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka - create a file called:
/etc/yum.repos.d/utterramblings.rep - paste the following into it:
[utterramblings]
name=Jason’s Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka - run yum update:
yum update
install phpmyadmin
- ref: http://www.phpmyadmin.net/documentation/#quick_install
- copy the distribution to your server from:
http://sourceforge.net/project/showfiles.php?group_id=23067&package_id=16462 - un-zip and -tar the package, rename it to something more convenient, e.g., “phpmyadmin”, and cd into it
- create a “config.inc.php” file by running:
cp config.sample.inc.php config.inc.php - define a random string for the “blowfish_secret” variable in config.inc.php, e.g., ‘weuriwuer9182309812iewuoriuwo’
- in the browser, navigate to yourdomain.com/phpmyadmin
- enter the mysql root username/password created above to log in
related post: running a CentOS 5.2 server using VMWare on Mac OS X 10.5