# How to Install Linux, Apache, MySQL and PHP (LAMP) on a Fedora 20 Cloud Server

> URL: https://www.atlantic.net/vps-hosting/how-to-install-lamp-fedora-20/ | Published: 2015-04-17 | Updated: 2024-06-06 | Author: Jose Velazquez

##### Verified and Tested 02/27/15

### Introduction

In this How-To, we will walk you through the install LAMP on your Fedora 20 Cloud Server. LAMP is simply a software bundle that consists of 4 components. L (Linux) is the core of the platform, which will sustain the other components. A(Apache)will be used for the web service. M(MySQL)will be used for database management, and P(PHP) will be the programming language. It is making the platform a LAMP.

## Install Lamp on Fedora 20

To install lamp, the first thing we need to do is install Apache with the following command:

```
yum install httpd
```

Start Apache with the following command:

```
systemctl start httpd.service
```

You will want the Apache service to start on start-up/reboot with the following command:

```
systemctl enable httpd.service
```

Add the following commands in Apache to override in Firewall-cmd as follows:

```
firewall-cmd --set-default-zone=public
```

```
firewall-cmd --permanent --zone=public --add-service=http
```

```
firewall-cmd --permanent --zone=public --add-service=https
```

```
firewall-cmd --reload
```

You can now verify that Apache is installed correctly by typing http:// and your IP on your browser.

http:// YOUR.IP.ADD.RESS

You should see the following screenshot in your browser:

![Default apache test page](https://www.atlantic.net/wp-content/uploads/2018/01/cloud1.jpg)

Default apache test page

You can edit the main configuration file to your preference for one or many websites with the following commands:

```
vi /etc/httpd/conf/httpd.conf
```

or

```
nano /etc/httpd/conf/httpd.conf
```

Un-comment the line containing the text **NameVirtualHost *:80**and edit accordingly****

Save the file

Restart the Apache HTTP

```
systemctl restart httpd.service
```

Install MySQL with the following command to begin the install:

```
yum install mysql mysql-server
```

Start the service with the following command:

```
systemctl start mysqld.service
```

Enable MySQL to start upon a reboot with the following command:

```
systemctl enable mysqld.service
```

Secure MySQL with the following command:

```
mysql_secure_installation
```

Note: When prompted with “Enter current password for root,” hit enter for none then Y(Yes) to set the MYSQL password. You will be prompted with a series of questions. Type Y for yes on all of them; see the screenshot below:

![Follow the on screen prompts and respond accordingly.](https://www.atlantic.net/wp-content/uploads/2018/01/cloud2.jpg)

Mysql Secure Installation

Install PHP with the following command to begin the install:

```
yum install php
```

Restart apache to take all the changes:

```
systemctl restart httpd.service
```

Create a test PHP file in the following directory with the following command:

```
sudo vi /var/www/html/info.php
```

Insert the following code in the space, then save and exit:

```
<?php
phpinfo();
?>
```

Restart Apache, so all the changes take effect:

```
sudo service httpd restart
```

![Sample info.php output.](https://www.atlantic.net/wp-content/uploads/2018/01/cloud3.jpg)

info.php

Test your page in your browser with the following hyperlink changed with your IP address:
 http:// YOUR.IP.ADD.RESS/info.php

Congratulations! You have just installed LAMP on your Fedora 20 Cloud Server. Thank you for following along in this How-To, and check back with us for any new updates.

Learn more about our [VPS hosting](https://www.atlantic.net/vps-hosting/) services and V[PS hosting price](https://www.atlantic.net/vps-hosting/pricing/).
