Lamp Install In Centos 5.10 Download Free UPDATED
Lamp Install In Centos 5.10 Download Free
Introduction
A "LAMP" stack is a grouping of open source software that is typically installed together to enable a server to host dynamic websites and spider web apps. This term is actually an acronym which represents the Linux operating system, with the Apache spider web server. The site data is stored in a YardySQL database (using MariaDB), and dynamic content is candy by PHP.
In this guide, we'll get a LAMP stack installed on an CentOS 7 VPS. CentOS will fulfill our first requirement: a Linux operating system.
Note: The LAMP stack can be installed automatically on your Droplet by calculation this script to its User Information when launching it. Cheque out this tutorial to larn more about Droplet User Data.
Prerequisites
Before you brainstorm with this guide, you should take a separate, non-root user business relationship ready on your server. You can learn how to do this by completing steps 1-4 in the initial server setup for CentOS 7.
Step Ane — Install Apache
The Apache web server is currently the most pop spider web server in the earth, which makes it a great default choice for hosting a website.
We can install Apache easily using CentOS's bundle managing director, yum. A package managing director allows usa to install most software pain-complimentary from a repository maintained by CentOS. You can learn more about how to use yum here.
For our purposes, we tin go started by typing these commands:
sudo yum install httpd Since we are using a sudo command, these operations get executed with root privileges. Information technology will ask y'all for your regular user's password to verify your intentions.
Afterwards, your spider web server is installed.
Once it installs, you tin start Apache on your VPS:
sudo systemctl start httpd.service Y'all can do a spot bank check right abroad to verify that everything went as planned past visiting your server'southward public IP address in your web browser (encounter the note under the adjacent heading to find out what your public IP address is if you do not have this information already):
http://your_server_IP_address/ Y'all will run into the default CentOS 7 Apache spider web folio, which is there for informational and testing purposes. Information technology should look something like this:
If you see this folio, then your web server is now correctly installed.
The final thing you volition want to exercise is enable Apache to start on boot. Use the following command to do so:
sudo systemctl enable httpd.service How To Find your Server's Public IP Address
If you lot do not know what your server'south public IP accost is, at that place are a number of ways you can find it. Usually, this is the accost yous use to connect to your server through SSH.
From the command line, you lot can discover this a few ways. Beginning, you tin use the iproute2 tools to get your address by typing this:
ip addr show eth0 | grep inet | awk '{ print $two; }' | sed 'due south/\/.*$//' This will give you lot 1 or two lines dorsum. They are both correct addresses, but your computer may only be able to use one of them, so feel free to try each i.
An alternative method is to use an outside party to tell you lot how information technology sees your server. You lot tin can practise this by asking a specific server what your IP address is:
gyre http://icanhazip.com Regardless of the method you use to get your IP address, you can type information technology into your web browser'due south address bar to get to your server.
Stride Ii — Install MySQL (MariaDB)
Now that we have our web server up and running, it is time to install MariaDB, a MySQL drop-in replacement. MariaDB is a customs-developed fork of the MySQL relational database direction system. Basically, it volition organize and provide access to databases where our site can store information.
Once more, we can utilise yum to acquire and install our software. This fourth dimension, we'll also install some other "helper" packages that will assist u.s.a. in getting our components to communicate with each other:
sudo yum install mariadb-server mariadb When the installation is complete, nosotros need to showtime MariaDB with the following command:
sudo systemctl get-go mariadb Now that our MySQL database is running, nosotros want to run a elementary security script that will remove some dangerous defaults and lock down access to our database organization a fiddling chip. Start the interactive script by running:
sudo mysql_secure_installation The prompt will ask you for your current root password. Since y'all merely installed MySQL, y'all most likely won't have one, so leave information technology blank by pressing enter. Then the prompt will inquire you if you want to set a root password. Become ahead and enter Y, and follow the instructions:
Enter electric current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorization. New countersign: countersign Re-enter new password: password Password updated successfully! Reloading privilege tables.. ... Success! For the rest of the questions, you should simply hit the "ENTER" key through each prompt to accept the default values. This will remove some sample users and databases, disable remote root logins, and load these new rules and so that MySQL immediately respects the changes nosotros have made.
The last thing you volition want to do is enable MariaDB to start on kick. Apply the following control to do and then:
sudo systemctl enable mariadb.service At this point, your database system is now set upward and nosotros can move on.
Step Iii — Install PHP
PHP is the component of our setup that will process code to display dynamic content. It can run scripts, connect to our MySQL databases to get data, and hand the processed content over to our web server to display.
Nosotros tin can once again leverage the yum system to install our components. Nosotros're going to include the php-mysql packet every bit well:
sudo yum install php php-mysql This should install PHP without whatever problems. Nosotros need to restart the Apache web server in order for information technology to work with PHP. You tin can do this by typing this:
sudo systemctl restart httpd.service Install PHP Modules
To enhance the functionality of PHP, nosotros can optionally install some additional modules.
To see the available options for PHP modules and libraries, you lot can type this into your organisation:
yum search php- The results are all optional components that you tin can install. It will give you a short clarification for each:
php-bcmath.x86_64 : A module for PHP applications for using the bcmath library 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 edifice PHP extensions php-embedded.x86_64 : PHP library for embedding in applications php-enchant.x86_64 : Enchant spelling extension for PHP applications php-fpm.x86_64 : PHP FastCGI Process Manager php-gd.x86_64 : A module for PHP applications for using the gd graphics library . . . To go more information near what each module does, you tin either search the net, or you can look at the long description in the package by typing:
yum info package_name There will exist a lot of output, with one field chosen Description which will have a longer caption of the functionality that the module provides.
For example, to observe out what the php-fpm module does, we could blazon this:
yum info php-fpm Forth with a large amount of other information, you'll find something that looks like this:
. . . Summary : PHP FastCGI Process Manager URL : http://www.php.net/ License : PHP and Zend and BSD Clarification : PHP-FPM (FastCGI Process Managing director) is an alternative PHP FastCGI : implementation with some boosted features useful for sites of : any size, especially busier sites. If, after researching, yous decide you would like to install a bundle, you can exercise and so by using the yum install command like nosotros take been doing for our other software.
If we decided that php-fpm is something that we need, we could blazon:
sudo yum install php-fpm If you lot want to install more than one module, you lot can do that by list each one, separated past a infinite, following the yum install command, similar this:
sudo yum install package1 package2 ... At this point, your LAMP stack is installed and configured. Nosotros should still test out our PHP though.
Step Four — Exam PHP Processing on your Web Server
In order to exam that our organisation is configured properly for PHP, we tin can create a very basic PHP script.
We will call this script info.php. In order for Apache to discover the file and serve it correctly, it must be saved to a very specific directory, which is chosen the "spider web root".
In CentOS 7, this directory is located at /var/www/html/. Nosotros tin can create the file at that location by typing:
sudo 6 /var/world wide web/html/info.php This will open a bare file. We want to put the following text, which is valid PHP code, within the file:
<?php phpinfo(); ?> When you lot are finished, save and close the file.
If you lot are running a firewall, run the following commands to allow HTTP and HTTPS traffic:
sudo firewall-cmd --permanent --zone=public --add-service=http sudo firewall-cmd --permanent --zone=public --add-service=https sudo firewall-cmd --reload Now we can test whether our web server can correctly display content generated past a PHP script. To try this out, we just accept to visit this page in our web browser. Y'all'll need your server'due south public IP address once again.
The address you want to visit will be:
http://your_server_IP_address/info.php The page that you come to should look something like this:
This page basically gives you information about your server from the perspective of PHP. Information technology is useful for debugging and to ensure that your settings are existence applied correctly.
If this was successful, and so your PHP is working every bit expected.
You probably want to remove this file after this examination because it could really requite information near your server to unauthorized users. To do this, yous can type this:
sudo rm /var/www/html/info.php You tin can ever recreate this page if you need to access the information again later.
Determination
Now that you lot have a LAMP stack installed, you have many choices for what to do side by side. Basically, yous've installed a platform that will permit you to install nigh kinds of websites and web software on your server.
DOWNLOAD HERE
Posted by: lisarearach38.blogspot.com
