0% found this document useful (0 votes)
11 views

Lab Sheet Web Server (LAMP) Latest

The document provides steps to install and configure a LAMP stack on an Ubuntu server including: 1. Installing Apache, MySQL server, PHP, and phpMyAdmin. 2. Configuring the Ubuntu firewall to allow Apache traffic, securing the MySQL installation, and setting the root password. 3. Testing the installations, creating info.php and helloWorld.php files, and accessing them in a browser. 4. Setting up virtual hosting by creating directories for domains, configuring Apache sites, and creating index.html files for each domain.

Uploaded by

25DDT21F1011
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Lab Sheet Web Server (LAMP) Latest

The document provides steps to install and configure a LAMP stack on an Ubuntu server including: 1. Installing Apache, MySQL server, PHP, and phpMyAdmin. 2. Configuring the Ubuntu firewall to allow Apache traffic, securing the MySQL installation, and setting the root password. 3. Testing the installations, creating info.php and helloWorld.php files, and accessing them in a browser. 4. Setting up virtual hosting by creating directories for domains, configuring Apache sites, and creating index.html files for each domain.

Uploaded by

25DDT21F1011
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Install Apache

Apache is most widely used web server that can be used nowadays.

Step 1: Type command below:

2. Configure Ubuntu Firewall

Step 1: Step 1: View firewall app profile by type this command:

Step 2: Type below command to view firewall “Apache Full” profile:

Step 3: Set up firewall to accept incoming (inbound traffic) for “Apache Full” firewall profile by type
below command:

Step 4: To test apache webserver after update ubuntu firewall, open client browser and enter your Web
Server IP Address like below:

Install MySQL-Server
MySQL Server is Open Source Relationan Database Management System that can be used as our
database.

Step 1: Install mysql by type below command:

Step 2: Securing the mysql database installation with secure script from mysql by entering command
below and answer all the question by following given guideline:

Step 3: login to mysql database by entering below command:

Step 4: Enter below command to view authentication method for root access:

Table below is the information fot root authentication access without any password.

Step 5: Enter below command to change authentication method for root access (creat password for root
access ):
Step 6: Enter below command again to view authentication method for root access after setting
password for root access. This step is to allow user access Mysql databases:

Step 7: Exit mysql.

Test Login MySQL after update Root password.

Step 1: Enter below command:

Step 2: Enter your account password:

Step 3: Enter your created root MySQL password.

Step 4: Once successful login, you will prompt like below:


Install PHP

Step 1: Enter below command to install PHP

Step 2: Enter below command to configure apache webserver setting, to set main priority on index.php
file first instead of index.html and others formats.

Step 3: Edit the opened file by bring forward index.php after index.html like below:

Step 4: Save file after edit by enter ‘CNTRL + X,’ then press Enter.

Step 5: Restart apache by enter below command:

Step 6: Edit ‘info.php’ by enter below command:

Step 7: Configure the info.php file by type below command:

Step 8: Exit and Save by enter ‘CNTRL + X,’ then press Enter.
Step 9: View info.php in your client browser by enter Server Ip Address/info.php like below.
Install phpMyAdmin

phpMyAdmin is a free software tools that use to handle administration on our databases such mysql-
server, mariadb and etc.

Step 1: Enter below command to install phpMyAdmin:

Step 2: Choose apache2 and click OK.

Step 3: Click Yes to configure dbconfig-common.

Step 4: Set password: password123.


Step 5: Enter same password for confirmation.

Step 6: Enter OK once pop-up error like below.

Step 7: Choose abort the select OK.

Step 8: log into mysql database.

Step 9: Remove the mysql validate password component by using the below command.
Step 10: Install again phpMyAdmin using below command.

Step 11: Restart apache webserver.

Step 12: Now you can access phpMyAdmin web interface by entering your web server ip address
following with /phpMyAdminin your browser URL like below.

Step 13: Login to phpMyAdmin by enter below username & password into Login Area.

Username: root

Password: password123

Step 14: Once successful login, you will redirect log to phpMyAdmin dashboard like below.
Testing Your Web Server:

We already done install LAMP as a web server in our Linux Machine, now we want to test it.

Step 1: Create file name helloWorld.php by entering command below:

Step 2: Create your site by entering this command and the save it.

Step 3: Restart your web server.

Step 4: Step 12: Now you can access your created hellowWorld.php web interface by entering your web
server ip address following with /hellowWorld.php in your browser URL like below.
Setup Apache to do virtual hosting.

You can running several name-based web sites on a single IP address (single server) in Apache web
server and this is we call virtual hosting.

Step 1: Create the directory for your_domain as follows:

Step 2: Assign ownership of the created folder to specific user by entering below command.

Step 3: Open new configuration file in Apache site-available directory using below command.

Step 4: Enter configuration like below and save it.

Step 5: Now use a2ensite to enable the new virtual host:

Step 6: Disable the default website that comes installed with apache by entering below command.

Step 7: Enter below command to ensure your configuration file doesn’t contain syntax errors.

Step 8: Reload Apache by entering below command.

Step 9: Your new domain website now active, but the web root still empty. Now we want to create
index.html for our web site by entering below command.
Step 10: Configure index.html file like below and save it.

Step 11: Now go to your browser and access your server domain by enter your domain Ip Address like
below:
Install a simple web application to run on the web server.

Reference:

https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-
on-ubuntu-20-04

https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-
ubuntu-20-04

You might also like