CentOS: Firewall & LAMP Installation

There’s an iptables entry that doesn’t allow connection to the web server from an external PC.
To remove it, you need to launch iptables with flags similar to these ones:
iptables -D RH-Firewall-1-INPUT 10
Basically you need to remove the REJECT rule
Better, you can act directly on the configuration of iptables:
system-config-securitylevel
and customize the filtering rules
The configuration file is /etc/sysconfig/iptables

Alternatively (you don’t need system-config-securitylevel), you can insert in the command line manually all the rules you’d like and then save them permanently through this command:

/sbin/service iptables save

Installing PHP5
yum install php
yum install php-gd

The Mysql client is already installed, whilst the server isn’t.
yum install mysql-server
yum install php-mysql

/etc/init.d/mysqld start

Setting up MySQL root password:
mysqladmin -u root password NEWPASSWORD

Now we want the Apache Webserver and the MySQL Server to start at the boot of the machine.

Let’s find out which runlevel we are running:

runlevel

To set the services to start at the boot:

/usr/sbin/ntsysv

This entry was posted in LAMP Server Setup, Redhat / CentOS, Security. Bookmark the permalink.

Leave a Reply