Real life problems solved

Advert

Install Apache, MySql and PHP on Rackspace Cloud Fedora Server

To install a suite of Apache, MySql and PHP on a new instance of Fedora 13 on Rackspace cloud perform the following steps:

1. Using PuTTY log in as root using the password send to you via email when starting the server

2. Run the following command:

yum update

3. Once it has finished updating run the following:

yum install httpd mysql mysql-server php php-devel php-mysql

4. Once this has finished installing run the following:

/etc/init.d/mysqld start
/usr/bin/mysql_secure_installation

5. When asked for current password just press enter. Then set a root password (make it secure), remove anonymous users, disallow root login remotely and remove the test database. Finally reload the privilege tables. Congratulations, you have secured MySql.

6. To make sure MySQL always loads on restart run the following:

chkconfig --levels 235 mysqld on

7. We also want to do similar for Apache so run the following:

/etc/init.d/httpd start
chkconfig --levels 235 httpd on

This will start the web server, however if you go to the IP address of the server in your browser it will say there is a problem loading the page, what is happening is that the Rackspace images have a very restrictive firewall to start, we need to allow some traffic through. To do this perform the following commands:

/sbin/iptables -I INPUT 1 -p tcp --dport http -j ACCEPT
/sbin/iptables -I INPUT 1 -p tcp --dport mysql -j ACCEPT
/sbin/service iptables save
service iptables restart

Once this has done you will be able to see the Apache welcome page on your server IP

  • Bradleyt

    Used this on a RackSpace Cloud server with CentOS 5.6 and it worked perfectly.  Thanks!

Adsense