installing Apache MySQL PHP on a CentOS 5.2 VMWare image

install apache and php

  • ref:
  • 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:
    • 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

upgrade beyond stock centos support so we can get php version > 5.2.2, which is required for phpmyadmin

install phpmyadmin

related post: running a CentOS 5.2 server using VMWare on Mac OS X 10.5

running a CentOS 5.2 server using VMWare Fusion on Mac OS X 10.5


  • An installation of VMWare Fusion Version 1.1 (62573)
  • A Mac w/ OS X 10.5.2 installed


  1. get CentOS
    a) Go to CentOS’s site and navigate to a download of this first install disk, e.g., “Downloads” -> “CentOS-5 ISOs” -> “i386” -> “” -> “CentOS-5.3-i386-bin-1of6.iso”.  I downloaded the torrent “CentOS-5.3-i386-bin-1to6.torrent”, but deselected all except the torrent for disk 1, i.e., it says “1to6”, but you can specify any or all of them, and we only need the first one.
  2. Once the iso is downloaded, launch VMware and create a new virtual machine
    a) Launch the wizard by clicking “File” -> “New…”
    b) Select “Linux” and “Red Hat Enterprise Linux 5” for the operating system and version, respectively, and click “Continue”
    c) Accept the defaults for name and location and continue
    d) Accept the default size for the virtual hard disk, e.g., 8GB, and continue
    e) Leave “Start virtual machine and install …” checked, select “Use operating system installation disk image file”, browse to the location of the iso you downoaded in step 1, and click “Finish”
  3. VMWare will now boot CentOS off the install disk.  Follow this guide ( ) regarding the configuration details of a bare-bones server installation.  Once the installation is complete, you’ll be prompted to reboot and, ba-boom, you’ll have a CentOS virtual machine running on your Mac.

possible next steps