Thursday, 23 February 2017

How to Install LAMP stack on Ubunt 16.04 VPS

1)Install Apache

-sudo apt-get update
-sudo apt-get install apache2

add a single line to the /etc/apache2/apache2.conf file to suppress a warning message.


-sudo apache2ctl configtest

Open up the main configuration file


-sudo nano /etc/apache2/apache2.conf

at the bottom of the file, add:-

ServerName Domain Name or IP


 check for syntax errors

-sudo apache2ctl configtest

Output
Syntax OK

Restart Apache to implement the changes:

-sudo systemctl restart apache2

see the Apache Full profile:

-sudo ufw app info Apache Full
Output
Profile: Apache Full
Title: Web Server (HTTP,HTTPS)
Description: Apache v2 is the next generation of the omnipresent Apache web
server.

Ports:
  80/tcp

Allow incoming traffic for this profile:

-sudo ufw allow in "Apache Full"


2)Install MySQL

-sudo apt-get install mysql-server

for security, run following command and press other than Y

-sudo mysql_secure_installation
check mysql
-mysql --version



3)Install PHP

-sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql

check php installation

-php --version

CREAT BASIC PHP SCRIPT OF PHP INFO
-sudo nano /var/www/html/info.php
PUT THE TEXT IN BLANK FILE
<?php
phpinfo();
?>
ctrl+x, then press Y and hit Enter

Go to your browser then type:

domainname/IP address/info.php












No comments:

Post a Comment