LAMP stack is a group of open source software used to get web servers up and running. The acronym stands for Linux, Apache, MySQL, and PHP. Since the server is already running CentOS, the linux part is taken care of. Here is how to install the rest.
Step One: Install Apache
To install Apache, run the following commands:
1. sudo yum install httpd
Once installed, you can start the web server by running:
2.. sudo service httpd start
To confirm that your webserver is working, you can navigate to your floating IP address within a browser, and the Apache default web page should display.
Step Two: Install MySQL
MySQL is a powerful database management system used for organizing and retrieving data on a server.
1. sudo yum install mysql-server
Once installed, you can start the MySQL server by running:
2. sudo service mysqld start
You will need to setup MySQL now:
3. sudo /usr/bin/mysql_secure_installation
Follow the prompts provided by the MySQL installation.
Step Three: Install PHP
PHP is an open source web scripting language that is widely used to build dynamic webpages.
1. sudo yum install php php-mysql
PHP also has a variety of useful libraries and modules that you can add onto your server. You can see the libraries that are available by typing:
2. yum search php-
Terminal then will display the list of possible modules, such as below:
php-bcmath.x86_64 : A module for PHP applications for using the bcmath librar
php-cli.x86_64 : Command-line interface for PHP
php-common.x86_64 : Common files for PHP
php-dba.x86_64 : A database abstraction layer module for PHP applications
php-devel.x86_64 : Files needed for building PHP extensions
php-embedded.x86_64 : PHP library for embedding in applications
php-enchant.x86_64 : Human Language and Character Encoding Support
php-gd.x86_64 : A module for PHP applications for using the gd graphics library
php-imap.x86_64 : A module for PHP applications that use IMAP
To install libraries, you can use the following command:
3. sudo yum install name of the module
Congratulations! You now have LAMP stack on your Storage Bucket instance.
We should also set the processes to run automatically when the server boots (php will run automatically once Apache starts):
1. sudo chkconfig httpd on
2. sudo chkconfig mysqld on