Linux serverlinux web serverNETWORK ADMINISTRATIONS

Configuring LAMP Server in Ubuntu Server 15.04 (Linux, Apache, MariaDB, Php) & PhpmyAdmin

In this Video, a Detailed Video Demonstration is being done how to Install:
1. MariaDB
2. Apache Web Server
3. Php5
4. Securing Apache Web Server
5. PhpMyAdmin

The List of Commands are as follows:

MariaDB is regarded as Good Replacement to Old Mysql Server

PART-A DEPLOYMENT OF MariaDB Server

A. Installation of MariaDB Server
#apt-get -y install mariadb-server mariadb-client

B. Setting Root Password for MariaDB
#mysql_secure_installation

Type the Password for Root: Press Enter
Set Root Password: (Press Y)
And Set the Password (2 Times)
Remove Anonymous Users: Press Y
Disallow root Login Remotly: Press Y
Reload privilege Tables Now: Press Y

C. Start the MariaDB Database Software
#mysql -u root -p
(Type the password which is being set above)

D. Quit from MariaDB
Type: quit and Press Enter

PART-B

DEPLOYMENT OF APACHE WEB SERVER

A. Installation of Apache Web Server Package
#apt-get -y install apache2

B. Open the Test Web Page
Open Firefox Web Browser: Type: http://ipaddress

PART-C

DEPLOYMENT OF PHP

A. Installation of PHP and Apache PHP Module
#apt-get -y install php5 libapache2-mod-php5

B. Restart Apache
#systemctl restart apache2

C. Test Php and Get Details About Php Installation
#nano /var/www/html/info.php

Now Type the following code

D. Change the owner of Info.php to www-data user and group
#chown www-data:www-data /var/www/html/info.php

E. Open the Web Browser and type the following address
http://ip-address/info.php

PART-D

GETTING MYSQL / MARIADB SUPPORT IN PHP

A. Search for Php5 Modules
#apt-cache search php5

B. Install all the Modules Listed
#apt-get -y install php5-mysqlnd php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

C. Restart Apache Web Server
#systemctl restart apache2

PART-E
OPTIMIZATION OF PHP

DEPLOYMENT OF APCu PHP cache to Speed up PHP

A. Installation of APCu- PHP opcode cacher for
caching and optimizing Php Intermedia Code.

#apt-get install php5-apcu

B. Restart Apache Web Server
#systemctl restart apache2

C. Reload of Info.php Web Page
Open web browser: Type:
http://ip-address/info.php

PART-F

MAKING APACHE2 SECURE USING SSL

A. Enabling SSL/TLS
#a2enmod ssl
#a2ensite default-ssl

B. Restart Apache Web Server
Open Web Browser and Type the Following:
Use https rather than http

https://ip-address

PART-G DEPLOYMENT OF PHPMYADMIN

A. Installation of Phpmyadmin
#apt-get -y install phpmyadmin

1.Select apache2
2. Configure database for Phpmyadmin: Yes
3. Enter the password: (Enter the Password of MariaDB Root)
4. MYSQL Application Password: Type the password
5. Web server to reconfigure automatically: apache2

B. Setting to Disable Plygin
MariaDB enables a plugin called “unix_socket” for the root user
by default, this plugin prevents that the root user can login to
PHPMyAdmin and that TCP connections to MySQL are working
for the root user.

Therefore I’ll deactivate that plugin with the following command:

#echo “update user set plugin=” where User=’root’; flush privileges;” | mysql –defaults-file=/etc/mysql/debian.cnf mysql

C. Open Web browser and Type the Address:
http://ip-address/phpmyadmin
Username: root
Password: (As set by you)

source by Dr. Anand Nayyar

linux web server

Leave a Reply

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