Online Courses
Free Tutorials  Go to Your University  Placement Preparation 
Artificial Intelligence(AI) & Machine Learning(ML) Training in Jaipur
Online Training - Youtube Live Class Link
0 like 0 dislike
in Tutorial & Interview questions by Goeduhub's Expert (8.2k points)

Goeduhub's Online Courses @Udemy

For Indian Students- INR 570/- || For International Students- $12.99/-


Course Name

Apply Coupon


Tensorflow 2 & Keras:Deep Learning & Artificial Intelligence

Apply Coupon


Computer Vision with OpenCV | Deep Learning CNN Projects

Apply Coupon


Complete Machine Learning & Data Science with Python Apply Coupon


Natural Language Processing-NLP with Deep Learning in Python Apply Coupon


Computer Vision OpenCV Python | YOLO| Deep Learning in Colab Apply Coupon


Complete Python Programming from scratch with Projects Apply Coupon

1 Answer

0 like 0 dislike
by Goeduhub's Expert (8.2k points)
Best answer

LAMP (Linux Apache MySQL PHP) consists of the Linux operating system as development environment, the Apache HTTP Server as web server, the MySQL relational database management system (RDBMS) as DB (Data Base) system, and the PHP programming language as Server side (Back End) programming language.

LAMP is used as a Open Source stack of technologies solution to web development area. Windows version of this stack is called WAMP (Windows Apache MySQL PHP)

Installing LAMP on Arch Linux

With this line we will install all the necessary packages in one step, and the last update:
pacman -Syu apache php php-apache mariadb




Change ServerAdmin as you need.

The folder of the WEB Pages by default is ServerRoot "/etc/httpd". Directory must be set to the same folder, so

change the line

<Directory "/etc/httpd">

This folder must have read and execution access, so

chmod o+x /etc/httpd

Change AllowOverride from none (default) to All so .htaccess will works.

Now you need the ~/public_html folder for each user. (to get the root page of each user as

http://localhost/~yourusername/. Unremark this line:

Include conf/extra/httpd-userdir.conf

Now as root you need to create the ~/public_html for each user and change the access to (755) of each one.

chmod 755 /home

chmod 755 /home/username

chmod 755 /home/username/public_html

You can comment out this line if you want to use SSL:

LoadModule ssl_module modules/

If you need to use virtual domains, uncomment the line:

Include conf/extra/httpd-vhosts.conf

and in /etc/httpd/conf/extra/httpd-vhosts.conf you must to add all the virtual domains. (plus into /etc/hosts

if you want to test those virtuals domains)

Edit /etc/httpd/conf/extra/httpd-default.conf and change ServerSignature to Off and ServerToken to Prod for hiding critical data 


Edit: /etc/httpd/conf/httpd.conf

Comment out: LoadModule mpm_event_module modules/

Uncomment: LoadModule mpm_prefork_module modules/

As last item in the LoadModule list, add LoadModule php7_module modules/

As last item in the include list, add Include conf/extra/php7_module.conf

Edit /etc/php/php.ini

Uncomment and

Change the timezone as you need, for example:

date.timezone = America/Argentina/Buenos_Aires, date.default_latitude = 0.0, date.default_longitude= 0.0


Run as root:

mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

Now you have the root of the MySQL Server.

Start MySQL daemon:

systemctl enable mysqld

systemctl start mysqld

At last, run:

sh /usr/bin/mysql_secure_installation

That all to get a web server ready to be customized as you need.

Installing LAMP on Ubuntu

Install apache:
sudo apt-get install apache2
Install MySql:
sudo apt-get install mysql-server
Install PHP:
sudo apt-get install php5 libapache2-mod-php5
Restart system:
sudo systemctl restart apache2
Check PHP installation:
php -r 'echo "\n\nYour PHP installation is working fine.\n\n\n";'

Installing LAMP stack on CentoOS 

Install Apache Web Server
First step is to install web server Apache.
sudo yum -y install httpd
Once it is installed, enable (to run on startup) and start Apache web server service.
sudo systemctl enable --now httpd
Point your browser to:
You will see the default Apache web server page.
Install MariaDB Server
Second step is to install MariaDB:
sudo yum -y install mariadb-server

Then start and enable (on startup) the MariaDB server:

sudo systemctl enable --now mariadb

As needed, use mysql_secure_installation to secure your database.

This script will allow you to do the following:

Change the root user's password

Remove test databases

Disable remote access

Install PHP

sudo yum -y install php php-common

Then restart Apache's httpd service.

sudo systemctl restart httpd

To test PHP, create a file called index.php in /var/www/html.

Then add the following line to the file:

Then point your browser to:


You should see information related to your server. If you do not, ensure that php is for sure installed correctly by running the following command:

php --version

If you receive something like:

PHP 5.4.16 (cli) (built: Nov 6 2016 00:29:02) Copyright (c) 1997-2013 The PHP Group

Then PHP is installed correctly. If this is the case, please ensure that you've restarted your web server. 

Our Mentors(For AI-ML)

Sharda Godara Chaudhary

Mrs. Sharda Godara Chaudhary

An alumna of MNIT-Jaipur and ACCENTURE, Pune


Ms. Nisha

An alumna of IIT-BHU

Related questions

0 like 0 dislike
1 answer 53 views
asked Nov 2, 2019 in Tutorial & Interview questions by Goeduhub Goeduhub's Expert (8.2k points)
0 like 0 dislike
1 answer 87 views
0 like 0 dislike
1 answer 94 views
0 like 0 dislike
1 answer 64 views
asked Nov 2, 2019 in Tutorial & Interview questions by Goeduhub Goeduhub's Expert (8.2k points)
0 like 0 dislike
1 answer 77 views


About Us | Contact Us || Terms & Conditions | Privacy Policy || Youtube Channel || Telegram Channel © Social::   |  |