Thursday 22 August 2013

Install wordpress on Redhat/CentOS like systems for development

Use CentOS as example.

When I installed CentOS virtual machine, I chose basic server rather than web server, because I'd have to do lots of extra configuration, and turn off tomcat etc. anyway. It's not a big deal to install apache and mysql. So I started clean.

-- CentOS installation

  1. During installation, use static IP address rather than DHCP dynamic IP. Because I am going to use a GUI-less server, and I am not going to bother with DNS configuration (so that hostname can be resolved to IP).
  2. Turn off SeLinux. Too much complication using selinux. So I turned it to permissive by editing /etc/selinux/config, set SELINUX=permissive.
  3. Turn off firewall. Are you good at configuring linux firewall? I am not. Leave the firewall on will cause the webpage inaccessable outsife of my linux server. So I turned it off by   sudo chkconfig --level 23456 iptables off
  4. Edit /etc/hosts, add the entry for my server, it looks like this  192.16.1.10  webbox webbox.Replace webbox with your server name. Note that I am running this linux box as an isolated test box, hence I am not putting in the FQDN. Just the hostname will do.
  5. Reboot.

-- Install Apache and MySQL.
This instruction https://www.digitalocean.com/community/articles/how-to-install-wordpress-on-centos-6--2 is pretty clear already.

Also need to install php mysql extension:
yum install php-mysql
service httpd restart

A few things to change in the /etc/httpd/conf/httpd.conf:

  1. Line #Listen 12.34.56.78:80: change the IP address to my linux box IP. (remember to un-comment it).
  2. Line ServerName www.example.com:80: change it to ServerName 192.168.1.10 (Remember to uncomment it) I chose not to specify port number. It will do the job.

Run sudo service httpd restart
Test the web server by browsing to http://192.168.1.10
You should see the welcome page of Apache. If not, trouble shoot.

I could then run the wordpress installation by opening http://<ip address>/wordpress/wp-admin/install.php

-- Install phpMyAdmin

  • Add EPEL repository the system.



CentOS/RHEL 6, 32 Bit (i386):
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

CentOS/RHEL 6, 64 Bit x86_64):
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
  • Install phpMyAdmin.
# yum install phpMyAdmin
  • Configure phpMyAdmin for remote access.
Edit /etc/httpd/conf.d/phpMyAdmin.conf and update all 127.0.0.1 with my IP.
  • Access phpMyAdmin in a browser.
URL: http://192.168.1.10/phpMyAdmin



No comments:

Post a Comment