Web Server and Database Management
Web Server and Database Management
Objective:
The objective of this lab is to manage web servers and databases on Linux.
td
Detailed Steps:
tl
1. Install and Configure Apache or Nginx:
Pv
● Choose a web server such as Apache or Nginx.
● Install the selected web server on your Linux system.
ng
# For Apache:
sudo apt install apache2
ni
ar
# For Nginx:
sudo apt install nginx
Le
● Configure the web server to serve HTML pages and handle incoming requests.
td
<p>This is a basic HTML page hosted on the web server.</p>
</body>
tl
</html>
Pv
● Access the HTML page via a web browser by navigating to http://localhost or
the IP address of your server.
ng
3. Install MySQL or PostgreSQL:
ni
● Choose a database management system such as MySQL or PostgreSQL.
ar
● Install the selected database management system on your Linux system.
Le
# For MySQL:
sudo apt install mysql-server
# For PostgreSQL:
IE
# For PostgreSQL:
sudo systemctl start postgresql # For PostgreSQL
sudo systemctl enable postgresql
# For MySQL:
sudo mysql -u root -p
# For PostgreSQL:
sudo -u postgres psql
td
● Create a new database.
tl
Pv
CREATE DATABASE my_database;
ng
CREATE TABLE my_table (
id INT PRIMARY KEY,
ni
ar
name VARCHAR(50)
);
Le
● Perform simple SQL queries such as inserting data into the table, querying data
from the table, updating records, and deleting records.
IE
Conclusion:
AF
This lab has provided hands-on experience in managing web servers and databases on
Linux. Participants have learned how to install and configure Apache or Nginx as web
N
These skills are essential for web developers, system administrators, and DevOps
engineers to deploy and manage web applications with backend databases.