Labno 03
Labno 03
Configuration on CentOS
1. Introduction
This report details the installation and configuration of an Apache web server on CentOS,
including firewall settings and the setup of IP-based and port-based websites. The document also
includes troubleshooting tips and security best practices for maintaining a robust web hosting
environment.
Run the following commands to update the system and install Apache:
http://your-server-ip
If Apache is correctly installed, the default CentOS test page should appear.
<VirtualHost 192.168.94.131:80>
DocumentRoot "/var/www/html/ip_based"
ServerName 192.168.94.131
<Directory "/var/www/html/ip_based">
AllowOverride All
Require all granted
</Directory>
ErrorLog "/var/log/httpd/ip_based_error.log"
CustomLog "/var/log/httpd/ip_based_access.log" combined
</VirtualHost>
Hamna Amir, a dedicated student with the roll number 21-cp-10, has always strived for excellence in
her academic journey. Known for her sharp problem-solving skills and creative approach, she has
consistently demonstrated a passion for learning and growing. Whether tackling complex assignments
or engaging in group discussions, Hamna is committed to achieving her goals and making a positive
impact in her field of study.
5. Port-Based Website Configuration
5.1 Create a New Virtual Host for Port-Based Access
<VirtualHost 192.168.94.131:2000>
DocumentRoot "/var/www/html/port_based"
<Directory "/var/www/html/port_based">
AllowOverride All
Require all granted
</Directory>
ErrorLog "/var/log/httpd/port_based_error.log"
CustomLog "/var/log/httpd/port_based_access.log" combined
</VirtualHost>
Create the document root and index page:
Set silinux =disabled and save it by :wq so that port based web hosting is enabled
Restart Apache: