Menu

CentOS 5.5 + LAMP + Webmin Installation Tutorial

3 min read October 6, 2012 at 7:55pm on Tutorials

The goal here is to setup Apache, MySQL and PHP which is commonly referred to as a “LAMP” stack. Everyone’s requirements are different but this tutorial will give you an easy way to get started. You will need a server with a fresh, clean installation of CentOS 5.5 x8 or x86-64 to begin.

Installing Apache

You will want to utilize the yum repository for easy installation:

yum install httpd httpd-devel

Wait for the installation to complete then start up Apache:

/etc/init.d/httpd start

The location of the Apache configuration file should be located here: /etc/httpd/conf/httpd.conf

If not you can run the following command and SSH which should output the location:

whereis httpd.conf

Be sure to add the Apache daemon into start up so it runs automatically after a reboot:

chkconfig httpd on

Installing MySQL 5

Utilize the yum repository again for quick and easy installation:

yum install mysql mysql-server mysql-devel

Then run the MySQL daemon:

/etc/init.d/mysqld start

Add the MySQL daemon into start-up so it runs automatically after a reboot:

chkconfig mysqld on

If you want to make sure MySQL is running, run the following command:

ps aux | grep mysql

For security purposes, you will want to change the MySQL root password through the MySQL console:

mysql

The console should open, then run the following:

mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('password') WHERE user='root';
mysql> FLUSH PRIVILEGES;:

NOTE: Be sure to change the ‘password’ to your liking.

To login into MySQL as root run:

mysql -u root -p

Once you are logged in you can create a database. I am going to use “blog” as the database name and add the user “john” with full privileges:

mysql > create database blog
mysql > GRANT ALL PRIVILEGES ON blog.* TO 'guest'@'localhost' IDENTIFIED BY 'john' WITH GRANT OPTION;
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('password') WHERE user='john';

Installing PHP 5

Install PHP through yum with some common modules. These can be changed to meet your requirements but should be sufficient for most setups:

yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml

By restarting Apache, PHP should fire up:

/etc/init.d/httpd restart

Your “public_html” folder or “www” folder is located in the /var/www/html/ directory. To test and see if PHP is working, you will want to create a PHP file with the following code:

<?php phpinfo(); ?>

Installing Webmin

First download the RPM:

wget http://prdownloads.sourceforge.net/webadmin/webmin-1.580-1.noarch.rpm

Then run the following command:

rpm -U webmin-1.580-1.noarch.rpm

(latest RPM can be found here: http://www.webmin.com/rpm.html)

The rest of the install will be done automatically to the directory /usr/libexec/webmin, the administration username set to root and the password to your current root password. You should now be able to login to Webmin at the URL http://localhost:10000/

Get started today. SIGN UP

Services

Client

Copyright Kazila 2017 © All Rights Reserved