SlideShare a Scribd company logo
1 of 12
Download to read offline
Apache Web Server
LABORATORY EXERCISES
LABORATORY EXERCISE 01: ENVIRONMENT SETUP (30 MINS)
- Install VMWare (VMWare Server for Windows XP/VMWare Workstation 8 for Windows 7)
- Load Linux Red Hat 9 Image (username: root/password: password)
- Configure the ff:
A. Local Computer running on Windows B. Virtual Machine running on Linux
VMNet1 Internet Protocol (TCP/IP) Properties: /etc/sysconfig/network:
IP Address: 10.10.10.1 Gateway: 10.10.10.1
Subnet Mask: 255.255.255.0 /etc/sysconfig/network-scripts/ifcfg-eth0:
IP Address: 10.10.10.2
Subnet Mask: 255.255.255.0
*To enable changes, run:
service network restart OR /etc/init.d/network
restart
On windows/system32/drivers/etc/hosts, add: On /etc/hosts, change FQDN from:
10.10.10.2 student.<your_name>.com student.apache.com to student.<your_name>.com
Test connection between Windows and Linux machines:
ping 10.10.10.2 ping 10.10.10.1
ping student.<your_name>.com ping 16.xx… (IP from HP Network)
ping localhost
ping student.<your_name>.com
Setup website name on Windows and Linux hosts:
Ex.: 10.10.10.2 richieboy.com
ping website from Windows and Linux machines
Apache Web Server
LABORATORY EXERCISES
LABORATORY EXERCISE 02: INSTALLING APACHE (30 MINS)
- Install Apache httpd on Linux and Windows
cd /home/training/installers
tar xzvf httpd-2.0.63.tar.gz
cd httpd-2.0.63
./configure --prefix=/usr/local/apache2 --enable-ssl
make
make install
- Verify if apache is running
ps -ef | grep httpd
- Stop and Start apache
cd /usr/local/apache2/bin
./apachectl stop
./apachectl start
- Test default web site
* Other ways of stopping apache:
killall httpd
kill -9 <pid>
kill -TERM `cat /usr/local/apache2/logs/httpd.pid
LABORATORY EXERCISE 03: FAMILIARIZATION WITH HTTPD.CONF (30 MINS)
- Edit httpd.conf using vi editor
- Customize your default index.html and come up with your own website
Apache Web Server
LABORATORY EXERCISES
LABORATORY EXERCISE 04: SECURE REVERSE PROXY (30 MINS)
Use your Apache on Windows to work as an SRP to your Apache on Linux website:
- On your Windows box, edit httpd.conf
- Enable the mod_proxy module by uncommenting:
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
- Make sure that ProxyRequests directive is set to "off"
ProxyRequests Off
- Add the following lines:
ProxyPass /<extension> http://<your_linux_website>
ProxyPassReverse /<extension> http://<your_linux_website>
- Test the SRP by viewing each other’s website
Apache Web Server
LABORATORY EXERCISES
LABORATORY EXERCISE 05: BASIC SECURITY (15 MINS)
- Locate the /usr/local/apache2/htdocs block from httpd.conf
- Edit the "Allow from all" parameter to "Deny from all"
- Restart apache
- Try to access your website
Note: Ensure that you are editing configurations under the correct directory.
Apache Web Server
LABORATORY EXERCISES
LABORATORY EXERCISE 06: USER-BASED AUTHENTICATION (1 HOUR)
A. REQUIRING USERS-
- Create a new directory under /htdocs to serve as your protected site
- Create an index.html file under the new directory
- Use the htpasswd tool to generate a password file
cd /usr/local/apache2/bin
./htpasswd -c <passwordFile> <user1>
- Add 2 more users to the passwordfile
./htpasswd <passwordFile> <user2>
./htpasswd <passwordFile> <user3>
- On httpd.conf, append the User-Based Authentication block
<Directory /usr/local/apache2/htdocs/prohibited>
AuthName "Restricted Access"
AuthType basic
AuthUserFile <passwordFile>
Require user user1 user2
</Directory>
- Try accessing the URL of the protected site. You should be prompted for a username and password.
- Try providing the correct username and password for user1/2/3
- Try cancelling out of the prompt. What is the page displayed?
B. REQUIRING GROUPS
- Place a comment on the entries in the httpd.conf from the previous activity
- Create a groupfile with 2 lines:
setA: user1 user2 user3
setB: user4 user5 user6
- Add user4 to the password file
cd /usr/local/apache2/bin
./htpasswd <passwordFile> <user4>
- On httpd.conf, append the User-Based Authentication block
<Directory /usr/local/apache2/htdocs/prohibited>
AuthName "Restricted Access"
AuthType basic
AuthUserFile <passwordFile>
AuthGroupFile <groupfile>
Require group setB
</Directory>
- Try to access the URL of the protected site.
- Try providing the credentials of user1/2/3
- Try providing the credentials of user4/5/6
***groupfile format/sample:
beatles: john paul george ringo
voltes5: steve littlejohn bigbert jamie mark
teletubbies: tinkywinky dipsi lala pow
Apache Web Server
LABORATORY EXERCISES
LABORATORY EXERCISE 07: THE .HTACCESS FILE (30 MINS)
- On httpd.conf, edit the value of AllowOveride directive under the /usr/local/apache2/htdocs block
AllowOverride All
- Make sure that AccessFileName directive is set:
AccessFileName .htaccess
- Restart Apache
- Create 5 layers of directories under htdocs
/usr/local/apache2/htdocs/layer1/layer2/layer3/layer4/layer5
- Create an .htaccess file under layer3
- Type the ff on your .htaccess file
AuthName "Restricted Access"
AuthType basic
AuthUserFile /usr/local/apache2/.htpasswd
Require user user1 user2
- Try to access the ff URLs:
http://<your_site>/layer1
http://<your_site>/layer1/layer2
http://<your_site>/layer1/layer2/layer3
http://<your_site>/layer1/layer2/layer3/layer4
http://<your_site>/layer1/layer2/layer3/layer4/layer5
Additional Exercise:
*Create two more layers, Layer 6 and Layer7. Place another .htaccess file on Layer 5. Page should
display “Forbidden” when you access Layers 5-7.
Apache Web Server
LABORATORY EXERCISES
LABORATORY EXERCISE 08: VIRTUAL HOSTING (1 HOUR)
A. SINGLE DAEMON, MULTIPLE SITES USING VIRTUAL HOST BLOCK AND A SINGLE IP ADDRESS:
Requirements:
1. Fully qualified domain name (FQDN) resolvable/mapped for each additional website/host.
2. Document Root folder and website contents for each additional host.
3. A NameVirtualHost directive should be defined
NameVirtualHost [IP Address/*]:[Port]
4. A <VirtualHost> block for each different host that you would like to serve
Procedure:
1. Your websites:
Primary/default Website FQDN: ________________________
Secondary Website FQDN: ______________________
2. Update your hosts file (/etc/hosts) to define/map the FQDNs to the server’s IP address.
Watch out: the host file (that is used for simulating the function of DNS) should define the default
FQDN of the host server. For example, your hostname is student, you may add the following line
in the hosts file:
111.111.111.1 student.<your name>.com student
3. Create a document root directory for the new host/website
Secondary Website FQDN’s Document Root directory: ______________________
4. Modify the default web page for the default webpage file. Copy/Create a default webpage file to
the Secondary Website.
5. Update the httpd.conf file to define the virtual hosts. You may follow the syntax below:
NameVirtualHost *:80
<VirtualHost *:80>
Server name Primary_FQDN
DocumentRoot Primary_DocumentRoot_folder
</VirtualHost>
<VirtualHost *:80>
Servername Secondary_FQDN
DocumentRoot Secondary_DocumentRoot_folder
</VirtualHost>
Apache Web Server
LABORATORY EXERCISES
6. Make sure to check if there are no syntax errors. Please note the result after running the command:
_____________________________.
Result:
7. Restart Apache service using the command: ________________
B. SINGLE-DAEMON, MULTIPLE SITES USING VIRTUAL HOST BLOCK AND MULTIPLE IP ADDRESSES:
Requirements:
1. New IP address for the new host/website
2. Fully qualified domain name (FQDN) resolvable/mapped for each additional website/host.
3. Document Root folder and website contents for each additional host.
4. A NameVirtualHost directive should be defined
5. A <VirtualHost> block for each different host that you would like to serve
Procedure:
TO ADD/CREATE NEW IP INTERFACES:
- Go to /etc/sysconfig/network-scripts/
- Copy eth0 and name it as eth0:1
- Edit eth0:1 content (Change the values of DEVICE & IPADDR)
- Restart network interface by issuing: /etc/init.d/network restart
- To confirm if the interface was successfully added, issue ifconfig command
1. Your websites:
Primary/default Website FQDN: ________________________
Secondary Website FQDN: ______________________
Primary/default Website IP: ________________________
Secondary Website IP: ______________________
2. Update your hosts file (/etc/hosts) to define/map the FQDNs to the server’s IP address.
Watchout: the host file (that is used for simulating the function of DNS) should define the default
FQDN of the host server. For example, your hostname is student, you may add the following line
in the hosts file:
111.111.111.1 student.<your_name>.com student
3. Create a Document Root directory for the new host/website
Secondary Website FQDN’s Document Root directory: ______________________
4. Modify the default web page for the default webpage file. Copy/Create a default webpage file to
the Secondary Website.
Apache Web Server
LABORATORY EXERCISES
5. Update the httpd.conf file to define the virtual hosts. You may follow the syntax below:
Listen IP1:80
Listen IP2:80
<VirtualHost *:80>
Servername Primary_FQDN
DocumentRoot Primary_DocumentRoot_folder
</VirtualHost>
<VirtualHost *:80>
Servername Secondary_FQDN
DocumentRoot Secondary_DocumentRoot_folder
</VirtualHost>
6. Make sure to check if there are no syntax errors. Please note the result after running the command:
_____________________________.
Result:
7. Restart Apache service using the command: ________________
C. MULTIPLE-DAEMON, MULTIPLE SITES USING VIRTUAL HOST BLOCK AND MULTIPLE IP ADDRESSES:
Requirements:
1. New IP address for the new host/website
2. Fully qualified domain name (FQDN) resolvable/mapped for each additional website/host.
3. Document Root folder and website contents for each additional host.
4. Different configuration file for each site
5. Different .pid file for each site
Procedure:
1. Your websites:
Primary/default Website FQDN: ________________________
Secondary Website FQDN: ______________________
Primary/default Website IP: ________________________
Secondary Website IP: ______________________
2. Update your hosts file (/etc/hosts) to define/map the FQDNs to the server’s IP address.
Watchout: the host file (that is used for simulating the function of DNS) should define the default
FQDN of the host server. For example, your hostname is student, you may add the following line
in the hosts file:
111.111.111.1 student.<your_name>.com student
Apache Web Server
LABORATORY EXERCISES
3. Create a Document Root directory for the new host/website
Secondary Website FQDN’s Document Root directory: ______________________
4. Modify the default web page for the default webpage file. Copy/Create a default webpage file to
the Secondary Website.
5. Your config files (include full path):
a. ________________________________
b. ________________________________
6. Update your config files to define the Listen directive (you may create a fresh copy of the backup.
You may follow the syntax below:
Listen IPaddress:80
7. Explicitly define a Pidfile directive for each site.
8. Update the document DocumentRoot directive that is out of any block (globally defined) to point to
your DocumentRoot for each site.
9. Make sure to check if there are no syntax errors. Please note the result after running the command:
_____________________________.
Result:
10. Restart Apache service using the command: ________________
Apache Web Server
LABORATORY EXERCISES
LABORATORY EXERCISE 09: SSL (1 HOUR)
A. SELF-SIGNED SSL CERTIFICATE
issue command --> find / -name “openssl” –print
command:
openssl req -new -x509 -nodes -out server.crt -keyout server.key
example: openssl req -new -x509 -nodes -out www.jbcarrot.com.crt -keyout www.jbcarrot.com.key
Output should be:
1. server.crt
2. server.key
Create a new folder for server.crt and server.key separately (ex. /usr/local/apache2/conf/SSL/SSL.crt or
/usr/local/apache2/conf/SSL/SSL.key) and move the files respectively to each folder.
Installing the SSL on your Apache website:
- open the configuration file for apache using VI command or gedit
2 options:
a. vi /usr/local/apache2/conf/httpd.conf
b. vi /usr/local/apache2/conf/ssl.conf
- identify the SSL <VirtualHost> block to configure, try to search for the “SSL” keyword
/SSL
- configure the <VirtualHost> block for the SSL-enabled site.
<VirtualHost IP:443>
DocumentRoot <path_to_your_document_root>
ServerName www.yourdomain.com
SSLEngine on
SSLCertificateFile <path_to_server.crt>
SSLCertificateKeyFile <path_to_server.key>
</VirtualHost>
- restart apache
./apachectl stop
./apachectl startssl
B. CREATE REAL SSL CERTIFICATE
1. Create RSA private key
openssl genrsa -des3 -out server.key 1024
Apache Web Server
LABORATORY EXERCISES
- to see details
openssl rsa -noout -text -in server.key
openssl rsa -noout -text -in www.jbcarrot.com.key
- to remove passphrase
openssl rsa -in server.key –out server.unencryted.key
2. Create a Certificate Signing Request (CSR)
openssl req -new -key server.key -out server.csr
- to see details of CSR
openssl req -noout -text -in server.csr
3. Have the Certificate Authority sign the request.
(email the csr to the acting CA)
4. Receive and examine SSL Certificate
- to see details
openssl x509 -noout -text -in server.crt
5. Installing the SSL on your Apache website:
- open the configuration file for apache using VI command or gedit
2 options
a. vi /usr/local/apache2/conf/httpd.conf
b. vi /usr/local/apache2/conf/ssl.conf
- identify the SSL <VirtualHost> block to configure, try to search for the “SSL” keyword
/SSL
- configure the <VirtualHost> block for the SSL-enabled site.
<VirtualHost IP:443>
DocumentRoot <path_to_your_document_root>
Apache Web Server
LABORATORY EXERCISES
ServerName www.yourdomain.com
SSLEngine on
SSLCertificateFile <path_to_server.crt>
SSLCertificateKeyFile <path_to_server.key>
</VirtualHost>
- restart apache
./apachectl stop
./apachectl startssl

More Related Content

What's hot

Linux questions
Linux questionsLinux questions
Linux questions1gman68
 
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20laffersHow%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20lafferstutorialsruby
 
Technical Aspects of SLiMS
Technical Aspects of SLiMSTechnical Aspects of SLiMS
Technical Aspects of SLiMShendrowicaksono
 
Cacoo enterprise installation_manual
Cacoo enterprise installation_manualCacoo enterprise installation_manual
Cacoo enterprise installation_manualjoseig23
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hostingwebhostingguy
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101Rami Sayar
 
Drupal, Memcache and Solr on Windows
Drupal, Memcache and Solr on WindowsDrupal, Memcache and Solr on Windows
Drupal, Memcache and Solr on WindowsAlessandro Pilotti
 
How To Install Openbravo ERP 2.50 MP43 in Ubuntu
How To Install Openbravo ERP 2.50 MP43 in UbuntuHow To Install Openbravo ERP 2.50 MP43 in Ubuntu
How To Install Openbravo ERP 2.50 MP43 in UbuntuWirabumi Software
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPressdotCloud
 
Lamp Server With Drupal Installation
Lamp Server With Drupal InstallationLamp Server With Drupal Installation
Lamp Server With Drupal Installationfranbow
 
Apache2 BootCamp : Getting Started With Apache
Apache2 BootCamp : Getting Started With ApacheApache2 BootCamp : Getting Started With Apache
Apache2 BootCamp : Getting Started With ApacheWildan Maulana
 
Content server installation guide
Content server installation guideContent server installation guide
Content server installation guideNaveed Bashir
 
Document Management: Opendocman and LAMP installation on Cent OS
Document Management: Opendocman and LAMP installation on Cent OSDocument Management: Opendocman and LAMP installation on Cent OS
Document Management: Opendocman and LAMP installation on Cent OSSiddharth Ram Dinesh
 
First fare 2011 website 101 for frc teams
First fare 2011 website 101 for frc teamsFirst fare 2011 website 101 for frc teams
First fare 2011 website 101 for frc teamsOregon FIRST Robotics
 

What's hot (19)

hw1a
hw1ahw1a
hw1a
 
Linux questions
Linux questionsLinux questions
Linux questions
 
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20laffersHow%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
 
Technical Aspects of SLiMS
Technical Aspects of SLiMSTechnical Aspects of SLiMS
Technical Aspects of SLiMS
 
PHP selber bauen
PHP selber bauenPHP selber bauen
PHP selber bauen
 
Cacoo enterprise installation_manual
Cacoo enterprise installation_manualCacoo enterprise installation_manual
Cacoo enterprise installation_manual
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hosting
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101
 
Ex200
Ex200Ex200
Ex200
 
Howto Pxeboot
Howto PxebootHowto Pxeboot
Howto Pxeboot
 
Drupal, Memcache and Solr on Windows
Drupal, Memcache and Solr on WindowsDrupal, Memcache and Solr on Windows
Drupal, Memcache and Solr on Windows
 
How To Install Openbravo ERP 2.50 MP43 in Ubuntu
How To Install Openbravo ERP 2.50 MP43 in UbuntuHow To Install Openbravo ERP 2.50 MP43 in Ubuntu
How To Install Openbravo ERP 2.50 MP43 in Ubuntu
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPress
 
Ex407
Ex407Ex407
Ex407
 
Lamp Server With Drupal Installation
Lamp Server With Drupal InstallationLamp Server With Drupal Installation
Lamp Server With Drupal Installation
 
Apache2 BootCamp : Getting Started With Apache
Apache2 BootCamp : Getting Started With ApacheApache2 BootCamp : Getting Started With Apache
Apache2 BootCamp : Getting Started With Apache
 
Content server installation guide
Content server installation guideContent server installation guide
Content server installation guide
 
Document Management: Opendocman and LAMP installation on Cent OS
Document Management: Opendocman and LAMP installation on Cent OSDocument Management: Opendocman and LAMP installation on Cent OS
Document Management: Opendocman and LAMP installation on Cent OS
 
First fare 2011 website 101 for frc teams
First fare 2011 website 101 for frc teamsFirst fare 2011 website 101 for frc teams
First fare 2011 website 101 for frc teams
 

Viewers also liked

C++ COMPUTER SCIENCE PROJECT
C++ COMPUTER SCIENCE PROJECTC++ COMPUTER SCIENCE PROJECT
C++ COMPUTER SCIENCE PROJECTAbhishek Shukla
 
Skriveklasse hos Danish Export Association januar 2017
Skriveklasse hos Danish Export Association januar 2017Skriveklasse hos Danish Export Association januar 2017
Skriveklasse hos Danish Export Association januar 2017Uffe Lyngaae
 
Gbolahan Shyllon - Learn About Agile Project Management
Gbolahan Shyllon - Learn About Agile Project ManagementGbolahan Shyllon - Learn About Agile Project Management
Gbolahan Shyllon - Learn About Agile Project ManagementGbolahan Shyllon
 
Beurs outlook 2017
Beurs outlook 2017Beurs outlook 2017
Beurs outlook 2017Karel Mercx
 
Gdz algebra test_2010
Gdz algebra test_2010Gdz algebra test_2010
Gdz algebra test_2010Lucky Alex
 
Gdz algebra bevz
Gdz algebra bevzGdz algebra bevz
Gdz algebra bevzLucky Alex
 
203689110 slides-epi-e-epc-ppt
203689110 slides-epi-e-epc-ppt203689110 slides-epi-e-epc-ppt
203689110 slides-epi-e-epc-pptFabio Silva
 
Fundraising in-a-generational-society
Fundraising in-a-generational-societyFundraising in-a-generational-society
Fundraising in-a-generational-societyLauren Wenner
 
ejercicios todas la estructuras
ejercicios todas la estructurasejercicios todas la estructuras
ejercicios todas la estructurasjeison lopez
 
Resume Jati Permana Putra - 19 Januari 2017
Resume Jati Permana Putra - 19 Januari 2017Resume Jati Permana Putra - 19 Januari 2017
Resume Jati Permana Putra - 19 Januari 2017Jati Permana
 
Chinh sach cac goi dau tu questra
Chinh sach cac goi dau tu   questraChinh sach cac goi dau tu   questra
Chinh sach cac goi dau tu questraAWS MINING TLD
 

Viewers also liked (20)

C++ COMPUTER SCIENCE PROJECT
C++ COMPUTER SCIENCE PROJECTC++ COMPUTER SCIENCE PROJECT
C++ COMPUTER SCIENCE PROJECT
 
Skriveklasse hos Danish Export Association januar 2017
Skriveklasse hos Danish Export Association januar 2017Skriveklasse hos Danish Export Association januar 2017
Skriveklasse hos Danish Export Association januar 2017
 
Gbolahan Shyllon - Learn About Agile Project Management
Gbolahan Shyllon - Learn About Agile Project ManagementGbolahan Shyllon - Learn About Agile Project Management
Gbolahan Shyllon - Learn About Agile Project Management
 
Apache
ApacheApache
Apache
 
Beurs outlook 2017
Beurs outlook 2017Beurs outlook 2017
Beurs outlook 2017
 
Transcript LLB
Transcript LLBTranscript LLB
Transcript LLB
 
Christopher Deubert, "Concussion Litigation and Legislation in Sports"
Christopher Deubert, "Concussion Litigation and Legislation in Sports"Christopher Deubert, "Concussion Litigation and Legislation in Sports"
Christopher Deubert, "Concussion Litigation and Legislation in Sports"
 
Gdz algebra test_2010
Gdz algebra test_2010Gdz algebra test_2010
Gdz algebra test_2010
 
Gdz algebra bevz
Gdz algebra bevzGdz algebra bevz
Gdz algebra bevz
 
Assignment 5
Assignment 5Assignment 5
Assignment 5
 
203689110 slides-epi-e-epc-ppt
203689110 slides-epi-e-epc-ppt203689110 slides-epi-e-epc-ppt
203689110 slides-epi-e-epc-ppt
 
OpenIO ServerLess Storage
OpenIO ServerLess StorageOpenIO ServerLess Storage
OpenIO ServerLess Storage
 
Fundraising in-a-generational-society
Fundraising in-a-generational-societyFundraising in-a-generational-society
Fundraising in-a-generational-society
 
ejercicios todas la estructuras
ejercicios todas la estructurasejercicios todas la estructuras
ejercicios todas la estructuras
 
Make Explaindio Animated Videos
Make Explaindio Animated VideosMake Explaindio Animated Videos
Make Explaindio Animated Videos
 
Massive MIMO
Massive MIMOMassive MIMO
Massive MIMO
 
أمن المعلومات البحثية
أمن المعلومات البحثيةأمن المعلومات البحثية
أمن المعلومات البحثية
 
biografia
biografia biografia
biografia
 
Resume Jati Permana Putra - 19 Januari 2017
Resume Jati Permana Putra - 19 Januari 2017Resume Jati Permana Putra - 19 Januari 2017
Resume Jati Permana Putra - 19 Januari 2017
 
Chinh sach cac goi dau tu questra
Chinh sach cac goi dau tu   questraChinh sach cac goi dau tu   questra
Chinh sach cac goi dau tu questra
 

Similar to Apache

Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linuxVicent Selfa
 
Drupal camp South Florida 2011 - Introduction to the Aegir hosting platform
Drupal camp South Florida 2011 - Introduction to the Aegir hosting platformDrupal camp South Florida 2011 - Introduction to the Aegir hosting platform
Drupal camp South Florida 2011 - Introduction to the Aegir hosting platformHector Iribarne
 
Configuration of Apache Web Server On CentOS 8
Configuration of Apache Web Server On CentOS 8Configuration of Apache Web Server On CentOS 8
Configuration of Apache Web Server On CentOS 8Kaan Aslandağ
 
Deployment ibm connections - No Http Server required
Deployment ibm connections - No Http Server requiredDeployment ibm connections - No Http Server required
Deployment ibm connections - No Http Server requiredSarwar Javaid
 
Building drupal web farms with IIS - part 1
Building drupal web farms with IIS - part 1Building drupal web farms with IIS - part 1
Building drupal web farms with IIS - part 1Alessandro Pilotti
 
Network File System (NFS)
Network File System (NFS)Network File System (NFS)
Network File System (NFS)abdullah roomi
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stackRootGate
 
Installing WordPress on AWS
Installing WordPress on AWSInstalling WordPress on AWS
Installing WordPress on AWSManish Jain
 
Serving Moodle Presentation
Serving Moodle PresentationServing Moodle Presentation
Serving Moodle Presentationwebhostingguy
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptwebhostingguy
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptwebhostingguy
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptwebhostingguy
 
One click deployment
One click deploymentOne click deployment
One click deploymentAlex Su
 

Similar to Apache (20)

Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linux
 
Drupal camp South Florida 2011 - Introduction to the Aegir hosting platform
Drupal camp South Florida 2011 - Introduction to the Aegir hosting platformDrupal camp South Florida 2011 - Introduction to the Aegir hosting platform
Drupal camp South Florida 2011 - Introduction to the Aegir hosting platform
 
Ubuntu vps setup
Ubuntu vps setupUbuntu vps setup
Ubuntu vps setup
 
Configuration of Apache Web Server On CentOS 8
Configuration of Apache Web Server On CentOS 8Configuration of Apache Web Server On CentOS 8
Configuration of Apache Web Server On CentOS 8
 
Deployment ibm connections - No Http Server required
Deployment ibm connections - No Http Server requiredDeployment ibm connections - No Http Server required
Deployment ibm connections - No Http Server required
 
EC CUBE 3.0.x installation guide
EC CUBE 3.0.x installation guideEC CUBE 3.0.x installation guide
EC CUBE 3.0.x installation guide
 
Building drupal web farms with IIS - part 1
Building drupal web farms with IIS - part 1Building drupal web farms with IIS - part 1
Building drupal web farms with IIS - part 1
 
Apache
ApacheApache
Apache
 
Network File System (NFS)
Network File System (NFS)Network File System (NFS)
Network File System (NFS)
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stack
 
Team lab install_en
Team lab install_enTeam lab install_en
Team lab install_en
 
Modul quick debserver
Modul quick debserverModul quick debserver
Modul quick debserver
 
Installing WordPress on AWS
Installing WordPress on AWSInstalling WordPress on AWS
Installing WordPress on AWS
 
Lumen
LumenLumen
Lumen
 
Serving Moodle Presentation
Serving Moodle PresentationServing Moodle Presentation
Serving Moodle Presentation
 
Apache - Quick reference guide
Apache - Quick reference guideApache - Quick reference guide
Apache - Quick reference guide
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.ppt
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.ppt
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.ppt
 
One click deployment
One click deploymentOne click deployment
One click deployment
 

Recently uploaded

Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 

Recently uploaded (20)

Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

Apache

  • 1. Apache Web Server LABORATORY EXERCISES LABORATORY EXERCISE 01: ENVIRONMENT SETUP (30 MINS) - Install VMWare (VMWare Server for Windows XP/VMWare Workstation 8 for Windows 7) - Load Linux Red Hat 9 Image (username: root/password: password) - Configure the ff: A. Local Computer running on Windows B. Virtual Machine running on Linux VMNet1 Internet Protocol (TCP/IP) Properties: /etc/sysconfig/network: IP Address: 10.10.10.1 Gateway: 10.10.10.1 Subnet Mask: 255.255.255.0 /etc/sysconfig/network-scripts/ifcfg-eth0: IP Address: 10.10.10.2 Subnet Mask: 255.255.255.0 *To enable changes, run: service network restart OR /etc/init.d/network restart On windows/system32/drivers/etc/hosts, add: On /etc/hosts, change FQDN from: 10.10.10.2 student.<your_name>.com student.apache.com to student.<your_name>.com Test connection between Windows and Linux machines: ping 10.10.10.2 ping 10.10.10.1 ping student.<your_name>.com ping 16.xx… (IP from HP Network) ping localhost ping student.<your_name>.com Setup website name on Windows and Linux hosts: Ex.: 10.10.10.2 richieboy.com ping website from Windows and Linux machines
  • 2. Apache Web Server LABORATORY EXERCISES LABORATORY EXERCISE 02: INSTALLING APACHE (30 MINS) - Install Apache httpd on Linux and Windows cd /home/training/installers tar xzvf httpd-2.0.63.tar.gz cd httpd-2.0.63 ./configure --prefix=/usr/local/apache2 --enable-ssl make make install - Verify if apache is running ps -ef | grep httpd - Stop and Start apache cd /usr/local/apache2/bin ./apachectl stop ./apachectl start - Test default web site * Other ways of stopping apache: killall httpd kill -9 <pid> kill -TERM `cat /usr/local/apache2/logs/httpd.pid LABORATORY EXERCISE 03: FAMILIARIZATION WITH HTTPD.CONF (30 MINS) - Edit httpd.conf using vi editor - Customize your default index.html and come up with your own website
  • 3. Apache Web Server LABORATORY EXERCISES LABORATORY EXERCISE 04: SECURE REVERSE PROXY (30 MINS) Use your Apache on Windows to work as an SRP to your Apache on Linux website: - On your Windows box, edit httpd.conf - Enable the mod_proxy module by uncommenting: #LoadModule proxy_module modules/mod_proxy.so #LoadModule proxy_http_module modules/mod_proxy_http.so - Make sure that ProxyRequests directive is set to "off" ProxyRequests Off - Add the following lines: ProxyPass /<extension> http://<your_linux_website> ProxyPassReverse /<extension> http://<your_linux_website> - Test the SRP by viewing each other’s website
  • 4. Apache Web Server LABORATORY EXERCISES LABORATORY EXERCISE 05: BASIC SECURITY (15 MINS) - Locate the /usr/local/apache2/htdocs block from httpd.conf - Edit the "Allow from all" parameter to "Deny from all" - Restart apache - Try to access your website Note: Ensure that you are editing configurations under the correct directory.
  • 5. Apache Web Server LABORATORY EXERCISES LABORATORY EXERCISE 06: USER-BASED AUTHENTICATION (1 HOUR) A. REQUIRING USERS- - Create a new directory under /htdocs to serve as your protected site - Create an index.html file under the new directory - Use the htpasswd tool to generate a password file cd /usr/local/apache2/bin ./htpasswd -c <passwordFile> <user1> - Add 2 more users to the passwordfile ./htpasswd <passwordFile> <user2> ./htpasswd <passwordFile> <user3> - On httpd.conf, append the User-Based Authentication block <Directory /usr/local/apache2/htdocs/prohibited> AuthName "Restricted Access" AuthType basic AuthUserFile <passwordFile> Require user user1 user2 </Directory> - Try accessing the URL of the protected site. You should be prompted for a username and password. - Try providing the correct username and password for user1/2/3 - Try cancelling out of the prompt. What is the page displayed? B. REQUIRING GROUPS - Place a comment on the entries in the httpd.conf from the previous activity - Create a groupfile with 2 lines: setA: user1 user2 user3 setB: user4 user5 user6 - Add user4 to the password file cd /usr/local/apache2/bin ./htpasswd <passwordFile> <user4> - On httpd.conf, append the User-Based Authentication block <Directory /usr/local/apache2/htdocs/prohibited> AuthName "Restricted Access" AuthType basic AuthUserFile <passwordFile> AuthGroupFile <groupfile> Require group setB </Directory> - Try to access the URL of the protected site. - Try providing the credentials of user1/2/3 - Try providing the credentials of user4/5/6 ***groupfile format/sample: beatles: john paul george ringo voltes5: steve littlejohn bigbert jamie mark teletubbies: tinkywinky dipsi lala pow
  • 6. Apache Web Server LABORATORY EXERCISES LABORATORY EXERCISE 07: THE .HTACCESS FILE (30 MINS) - On httpd.conf, edit the value of AllowOveride directive under the /usr/local/apache2/htdocs block AllowOverride All - Make sure that AccessFileName directive is set: AccessFileName .htaccess - Restart Apache - Create 5 layers of directories under htdocs /usr/local/apache2/htdocs/layer1/layer2/layer3/layer4/layer5 - Create an .htaccess file under layer3 - Type the ff on your .htaccess file AuthName "Restricted Access" AuthType basic AuthUserFile /usr/local/apache2/.htpasswd Require user user1 user2 - Try to access the ff URLs: http://<your_site>/layer1 http://<your_site>/layer1/layer2 http://<your_site>/layer1/layer2/layer3 http://<your_site>/layer1/layer2/layer3/layer4 http://<your_site>/layer1/layer2/layer3/layer4/layer5 Additional Exercise: *Create two more layers, Layer 6 and Layer7. Place another .htaccess file on Layer 5. Page should display “Forbidden” when you access Layers 5-7.
  • 7. Apache Web Server LABORATORY EXERCISES LABORATORY EXERCISE 08: VIRTUAL HOSTING (1 HOUR) A. SINGLE DAEMON, MULTIPLE SITES USING VIRTUAL HOST BLOCK AND A SINGLE IP ADDRESS: Requirements: 1. Fully qualified domain name (FQDN) resolvable/mapped for each additional website/host. 2. Document Root folder and website contents for each additional host. 3. A NameVirtualHost directive should be defined NameVirtualHost [IP Address/*]:[Port] 4. A <VirtualHost> block for each different host that you would like to serve Procedure: 1. Your websites: Primary/default Website FQDN: ________________________ Secondary Website FQDN: ______________________ 2. Update your hosts file (/etc/hosts) to define/map the FQDNs to the server’s IP address. Watch out: the host file (that is used for simulating the function of DNS) should define the default FQDN of the host server. For example, your hostname is student, you may add the following line in the hosts file: 111.111.111.1 student.<your name>.com student 3. Create a document root directory for the new host/website Secondary Website FQDN’s Document Root directory: ______________________ 4. Modify the default web page for the default webpage file. Copy/Create a default webpage file to the Secondary Website. 5. Update the httpd.conf file to define the virtual hosts. You may follow the syntax below: NameVirtualHost *:80 <VirtualHost *:80> Server name Primary_FQDN DocumentRoot Primary_DocumentRoot_folder </VirtualHost> <VirtualHost *:80> Servername Secondary_FQDN DocumentRoot Secondary_DocumentRoot_folder </VirtualHost>
  • 8. Apache Web Server LABORATORY EXERCISES 6. Make sure to check if there are no syntax errors. Please note the result after running the command: _____________________________. Result: 7. Restart Apache service using the command: ________________ B. SINGLE-DAEMON, MULTIPLE SITES USING VIRTUAL HOST BLOCK AND MULTIPLE IP ADDRESSES: Requirements: 1. New IP address for the new host/website 2. Fully qualified domain name (FQDN) resolvable/mapped for each additional website/host. 3. Document Root folder and website contents for each additional host. 4. A NameVirtualHost directive should be defined 5. A <VirtualHost> block for each different host that you would like to serve Procedure: TO ADD/CREATE NEW IP INTERFACES: - Go to /etc/sysconfig/network-scripts/ - Copy eth0 and name it as eth0:1 - Edit eth0:1 content (Change the values of DEVICE & IPADDR) - Restart network interface by issuing: /etc/init.d/network restart - To confirm if the interface was successfully added, issue ifconfig command 1. Your websites: Primary/default Website FQDN: ________________________ Secondary Website FQDN: ______________________ Primary/default Website IP: ________________________ Secondary Website IP: ______________________ 2. Update your hosts file (/etc/hosts) to define/map the FQDNs to the server’s IP address. Watchout: the host file (that is used for simulating the function of DNS) should define the default FQDN of the host server. For example, your hostname is student, you may add the following line in the hosts file: 111.111.111.1 student.<your_name>.com student 3. Create a Document Root directory for the new host/website Secondary Website FQDN’s Document Root directory: ______________________ 4. Modify the default web page for the default webpage file. Copy/Create a default webpage file to the Secondary Website.
  • 9. Apache Web Server LABORATORY EXERCISES 5. Update the httpd.conf file to define the virtual hosts. You may follow the syntax below: Listen IP1:80 Listen IP2:80 <VirtualHost *:80> Servername Primary_FQDN DocumentRoot Primary_DocumentRoot_folder </VirtualHost> <VirtualHost *:80> Servername Secondary_FQDN DocumentRoot Secondary_DocumentRoot_folder </VirtualHost> 6. Make sure to check if there are no syntax errors. Please note the result after running the command: _____________________________. Result: 7. Restart Apache service using the command: ________________ C. MULTIPLE-DAEMON, MULTIPLE SITES USING VIRTUAL HOST BLOCK AND MULTIPLE IP ADDRESSES: Requirements: 1. New IP address for the new host/website 2. Fully qualified domain name (FQDN) resolvable/mapped for each additional website/host. 3. Document Root folder and website contents for each additional host. 4. Different configuration file for each site 5. Different .pid file for each site Procedure: 1. Your websites: Primary/default Website FQDN: ________________________ Secondary Website FQDN: ______________________ Primary/default Website IP: ________________________ Secondary Website IP: ______________________ 2. Update your hosts file (/etc/hosts) to define/map the FQDNs to the server’s IP address. Watchout: the host file (that is used for simulating the function of DNS) should define the default FQDN of the host server. For example, your hostname is student, you may add the following line in the hosts file: 111.111.111.1 student.<your_name>.com student
  • 10. Apache Web Server LABORATORY EXERCISES 3. Create a Document Root directory for the new host/website Secondary Website FQDN’s Document Root directory: ______________________ 4. Modify the default web page for the default webpage file. Copy/Create a default webpage file to the Secondary Website. 5. Your config files (include full path): a. ________________________________ b. ________________________________ 6. Update your config files to define the Listen directive (you may create a fresh copy of the backup. You may follow the syntax below: Listen IPaddress:80 7. Explicitly define a Pidfile directive for each site. 8. Update the document DocumentRoot directive that is out of any block (globally defined) to point to your DocumentRoot for each site. 9. Make sure to check if there are no syntax errors. Please note the result after running the command: _____________________________. Result: 10. Restart Apache service using the command: ________________
  • 11. Apache Web Server LABORATORY EXERCISES LABORATORY EXERCISE 09: SSL (1 HOUR) A. SELF-SIGNED SSL CERTIFICATE issue command --> find / -name “openssl” –print command: openssl req -new -x509 -nodes -out server.crt -keyout server.key example: openssl req -new -x509 -nodes -out www.jbcarrot.com.crt -keyout www.jbcarrot.com.key Output should be: 1. server.crt 2. server.key Create a new folder for server.crt and server.key separately (ex. /usr/local/apache2/conf/SSL/SSL.crt or /usr/local/apache2/conf/SSL/SSL.key) and move the files respectively to each folder. Installing the SSL on your Apache website: - open the configuration file for apache using VI command or gedit 2 options: a. vi /usr/local/apache2/conf/httpd.conf b. vi /usr/local/apache2/conf/ssl.conf - identify the SSL <VirtualHost> block to configure, try to search for the “SSL” keyword /SSL - configure the <VirtualHost> block for the SSL-enabled site. <VirtualHost IP:443> DocumentRoot <path_to_your_document_root> ServerName www.yourdomain.com SSLEngine on SSLCertificateFile <path_to_server.crt> SSLCertificateKeyFile <path_to_server.key> </VirtualHost> - restart apache ./apachectl stop ./apachectl startssl B. CREATE REAL SSL CERTIFICATE 1. Create RSA private key openssl genrsa -des3 -out server.key 1024
  • 12. Apache Web Server LABORATORY EXERCISES - to see details openssl rsa -noout -text -in server.key openssl rsa -noout -text -in www.jbcarrot.com.key - to remove passphrase openssl rsa -in server.key –out server.unencryted.key 2. Create a Certificate Signing Request (CSR) openssl req -new -key server.key -out server.csr - to see details of CSR openssl req -noout -text -in server.csr 3. Have the Certificate Authority sign the request. (email the csr to the acting CA) 4. Receive and examine SSL Certificate - to see details openssl x509 -noout -text -in server.crt 5. Installing the SSL on your Apache website: - open the configuration file for apache using VI command or gedit 2 options a. vi /usr/local/apache2/conf/httpd.conf b. vi /usr/local/apache2/conf/ssl.conf - identify the SSL <VirtualHost> block to configure, try to search for the “SSL” keyword /SSL - configure the <VirtualHost> block for the SSL-enabled site. <VirtualHost IP:443> DocumentRoot <path_to_your_document_root> Apache Web Server LABORATORY EXERCISES ServerName www.yourdomain.com SSLEngine on SSLCertificateFile <path_to_server.crt> SSLCertificateKeyFile <path_to_server.key> </VirtualHost> - restart apache ./apachectl stop ./apachectl startssl