Turning The LAMP On….
First sign into root access:
su
Then Run:
yum update
Once this is completed, being the installation process:
- MySQL = MariaDB
-
yum install mariadb mariadb-server
-
systemctl start mariadb.service
-
mysql_secure_installation
- >> Follow the instructions given on the Terminal
-
- Apache
-
yum install httpd
-
systemctl enable httpd.service
-
systemctl start httpd.service
-
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
-
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
- PHP5
-
yum install php
-
systemctl restart httpd.service
-
The document root of the default web site is /var/www/html. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.
>> Use relevant text software to open – this is to use “gedit” text editor:
-
gedit /var/www/html/info.php
- Add the following to the text file:
-
<?php phpinfo(); ?>
-
Now we call that file in a browser (e.g. http://”IP Address”/info.php) >> IP Address can be found via:
ifconfig
- MySQL Support in PHP5:
- To get MySQL support in PHP, we can install the php-mysql package. It’s a good idea to install some other PHP5 modules as well as you might need them for your applications. You can search for available PHP5 modules like this:
-
yum search php
-
yum install php-mysqlnd php-mssql php-opcache
-
systemctl restart httpd.service
Now reload http://”IP Address”/info.php in your browser. Scroll down to the modules section to find lots of new modules there, including the MySQL module
- phpMyAdmin
-
yum install phpmyadmin
-
phpMyAdmin is a web interface through which you can manage your MySQL databases
To configure phpMyAdmin, change the Apache configuration so that phpMyAdmin allows connections not just from localhost (by commenting out everything in the <Directory /usr/share/phpMyAdmin/> stanza and adding the line Require all granted):
-
gedit /etc/httpd/conf.d/phpMyAdmin.conf
-
<Directory /usr/share/phpMyAdmin/> # AddDefaultCharset UTF-8 # <IfModule mod_authz_core.c> # # Apache 2.4 # <RequireAny> # Require ip 127.0.0.1 # Require ip ::1 # </RequireAny> # </IfModule> # <IfModule !mod_authz_core.c> # # Apache 2.2 # Order Deny,Allow # Deny from All # Allow from 127.0.0.1 # Allow from ::1 # </IfModule> Require all granted </Directory>
-
systemctl restart httpd.service
-
-
Afterwards, you can access phpMyAdmin under http://”IPAddress”/phpmyadmin/:
One thought on “Installing LAMP on Fedora 21”