Automated Installation and Configurations – Apache/Nginx, MySQL ,PHP or PHP-FPM on Linux/UNIX

lamp-automated-installation
mm
Written By:- Santosh Prasad

In this tutorial I am going to explain how we can install Apache/Nginx, MySQL , PHP or PHP-FPM automatically on Linux system. To do this we will use a script. This script will ask about virtual host domain name during installation and during MySQL database installation it will ask about MySQL root password, New database name, new username and password for the new user.

Requirements:

  • Centos 6.7 or Higher.
  • Python 2.7 installed on your Linux machine.
  • Download all files to the Linux server and execute ap-ng-vhost.py script.

ap-ng-vhost.py is the main script.

For testing purpose, add your virtual domain name and server IP in ” c:\windows\system32\drivers\etc\hosts ” file for Windows or for Linux use “/etc/hosts“file like below

# vim /etc/hosts
192.168.0.6 looklinux.com

Now follow the below steps to install LAMP using script.

Select 1 for Apache MySQL PHP

[[email protected] download]# ./ap-ng-vhost.py
 Select menu:
 1. For install LAMP and configure virtual host write 1 and click to Enter button.
 2. For install Nginx, PHP-FPM, MySQL and configure virtual host write 2 and click to Enter button.
 3. For exit from script write 3 and click to Enter button.
 Please write number: 1

Now write virtual domain name called “looklinux.com

Script require domain name.
 Please enter domain name: looklinux.com

Now select 1 for MySQL and PHP

################################################################
 1. For install and configure PHP and MySQL please write 1 and click to ENTER button.
 2. For exit from script, plase write 2 and click the ENTER button.
 Please select your choise: 1

Select 2 for Nginx MySQL PHP-FPM

[[email protected] download] ./up-ng-vhosL.py
Select menu:
 1. For install LAMP and configure virtual host write 1 and click to Enter button.
 2. For install Nginx, PHP-FPM, MySQL and configure virtual host write 2 and click to Enter button.
 3. For exit from script write 3 and click to Enter button.
 Please write number: 2

Now write virtual domain name called “looklinux.com

Script require domain name.
 Please enter domain name: looklinux.com

Now select 1 for MySQL and PHP-FPM

################################################################
 1. For install and configure PHP-FPM and MySQL please write 1 and click to ENTER button.
 2. For exit from script, plase write 2 and click the ENTER button.
 Please select your choise: 1

That’s it.

If you want to clean everything just use ./cleaner.sh script.

I hope this article will help to install automatically Apache, Nginx, MySQL, PHP or PHP-FPM . If you have any queries and problem please comment in comment section.

Thanks:)

About Author

mm

Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Other Post by Santosh Prasad

Visit All Post

Related Article

You may also Like

Leave a Comment

Shares