How to install LAMP Server on Manjaro Linux 0.8.10

This tutorial is going to show you how to install LAMP Server on Manjaro 0.8.10. LAMP Server is the package we need to turn Manjaro into a powerful web server with MariaDB or MySQL as the database backend, PHP, and Apache2 web server. Installing LAMP Server on Manjaro 0.8.10 is pretty easy. Please follow these steps to install LAMP Server on Manjaro 0.8.10.

This is a quick how to tutorial. For more information about LAMP or Manjaro, please visit the official website of those packages or distribution. Other version of Manjaro Linux also can use this tutorial to get LAMP Server up and running.

A. Install Apache2

First, we will install Apache2 on Manjaro 0.8.10. Open Terminal and login as root

su

Paste these commands to install Apache2

pacman -Sy
pacman -S apache

Output:

[root@manjaro fitri]# pacman -S apache
resolving dependencies...
looking for conflicting packages...
Packages (1) apache-2.4.10-1
Total Download Size: 1.26 MiB
Total Installed Size: 5.03 MiB
:: Proceed with installation? [Y/n] y
:: Retrieving packages ...
 apache-2.4.10-1-x86_64

Now restart Apache2 server with this command

systemctl restart httpd

Next we will create a test page for the web server. Create a new file /srv/http/index.html.

nano /srv/http/index.html

Paste these lines to the new file:

<html>
<title>Install LAMP Server on Manjaro</title>
<body>
<h2>This is the test page</h2>
</body>
</html>

Now open your web browser and type: http://localhost. You should see the following page displayed.

install apache on manjaro

 

B. Install MariaDB

Now we need to install MariaDB as the database backend. Use the following command to install MariaDB on Manjaro

pacman -S mariadb

C. Install PHP and PHP-Apache

Use the following command to install PHP and PHP-Apache package

pacman -S php php-apache

Next, we need to edit httpd.conf file

nano /etc/httpd/conf/httpd.conf

Add the following lines to it

LoadModule php5_module modules/libphp5.so
AddHandler php5-script php
Include conf/extra/php5_module.conf
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

Now we need to test if php is working correctly

nano /srv/http/info.php

Add the following lines

<?php
phpinfo();
?>

Restart apache

systemctl restart httpd

Now open web browser and type http://localhost/info.php

install php on manjaro

OK Now you have LAMP Server up and running on Manjaro Linux. Enjoy

Admin

One Comment

  1. Before the command:
    systemctl restart httpd

    I had to run the command:
    systemctl enable httpd

    Otherwise I got trouble (errors)

Leave a Reply

Your email address will not be published. Required fields are marked *