"[TUTORIAL] HOW TO SET UP LAMP SERVER ON FEDORA 20"

Published: Fri 18 July 2014

In content.

WHAT IS LAMP?

LAMP is an acronym for Linux, Apache, MySQL (or MariaDB) and PHP/Perl/Python. It is a software bundle composed entirely of free and open source software used for building dynamic websites and acts as local web server on your PC. On Windows system, WAMP is used instead.

This post assumes that user is working on a Linux environment. For this tutorial , I will be using Fedora 20.

First we are going to set up Apache

"[root@localhost vravichandran]# yum install httpd"

"[root@localhost vravichandran]# systemctl enable httpd.service"

"[root@localhost vravichandran]# systemctl start httpd.service"

Once you're done with steps above, open up your favorite browser, type localhost / your ip-address . You should see Fedora Test Page.

TAKENOTE:

Apache’s default document root is /var/www/html on Fedora, and the configuration file is /etc/httpd/conf/httpd.conf. Additional configurations are stored in the /etc/httpd/conf.d/ directory.

Second, we are going to set up PHP5

"[root@localhost vravichandran]# yum install php"

"[root@localhost vravichandran]# systemctl restart httpd.service"

To make sure php installation is successful, try this

"[root@localhost vravichandran]# vim /var/www/html/info.php"

Once you have opened the file, put this into the file, save and quit

"<?php

phpinfo();

?>"

Now open your favorite browser, type localhost/info.php and press enter. You should be able to see a page with php information.

Third, we are going to set up MySQL Database

"[root@localhost vravichandran]# yum install mysql mysql-server"

"[root@localhost vravichandran]# systemctl enable mariadb.service"

TAKENOTE:

MySQL is now replaced by MariaDB. Make sure you're aware of what you're installing, if mariadb.service throws error, try mysqld.service.

Next, we are going to configure MySQL Database

"[root@localhost vravichandran]# mysql_secure_installation"

"Enter current password for root (enter for none):" // if you haven't set any root password

"Set root password? [Y/n] Y"

"New password: [enter your desired password]"

"Re-enter new password:"

"Remove anonymous users? [Y/n] Y"

"Disallow root login remotely? [Y/n] Y"

"Remove test database and access to it? [Y/n] Y"

"Reload privilege tables now? [Y/n] Y"

Next we are going to set up PHP Modules

"[root@localhost src]# yum install php-mysqlnd php-mssql php-opcache"

Forth, we are going to set up phpMyAdmin

"[root@localhost src]# yum install phpmyadmin"

Next, we are going to configure phpMyAdmin

"[root@localhost vravichandran]# vim /etc/httpd/conf.d/phpMyAdmin.conf "

comment out according to the text below [Has to be exactly the same]

*************************************************************

# phpMyAdmin - Web based MySQL browser written in php # # Allows only localhost by default # # But allowing phpMyAdmin to anyone other than localhost should be considered # dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin Alias /phpmyadmin /usr/share/phpMyAdmin

# # # Apache 2.4 # # Require ip 127.0.0.1 # Require ip ::1 # # # # # Apache 2.2 # Order Deny,Allow # Deny from All # Allow from 127.0.0.1 # Allow from ::1 # Require all granted

*************************************************************

Once you're done with the editing , restart your apache

"[root@localhost vravichandran]# systemctl restart httpd.service"

Now, open your favorite browser, type localhost / [your machine ip-addr]/phpmyadmin/ , a small box will pop up asking for username and password, enter according to what you have entered during mysql_secure_installation .

Voila! You have successfully installed LAMP STACK! Enjoy!

P.S: This guide is based on Fedora 20 .

social