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

Power Electronics 2 mark Questions
Power Electronics 2 mark Questions Power Electronics 2 mark Questions
Power Electronics 2 mark Questions BALACHANDRAN D
 
3Com 3COM SWITCH 5 3CFSU0
3Com 3COM SWITCH 5 3CFSU03Com 3COM SWITCH 5 3CFSU0
3Com 3COM SWITCH 5 3CFSU0savomir
 
Recuperación de desastres evaluación del proceso del negocio y administración
Recuperación de desastres evaluación del proceso del negocio y administraciónRecuperación de desastres evaluación del proceso del negocio y administración
Recuperación de desastres evaluación del proceso del negocio y administraciónMaestros en Linea MX
 
3Com 3C17229
3Com 3C172293Com 3C17229
3Com 3C17229savomir
 
tipos de riesgos (higiene y seguridad industrial)
tipos de riesgos  (higiene y seguridad industrial)tipos de riesgos  (higiene y seguridad industrial)
tipos de riesgos (higiene y seguridad industrial)dannyypaula
 
Relaciones juridicas entre personas y familia
Relaciones juridicas entre personas y familiaRelaciones juridicas entre personas y familia
Relaciones juridicas entre personas y familiaMaestros en Linea MX
 
Higiene y seguridad industrial
Higiene y seguridad industrialHigiene y seguridad industrial
Higiene y seguridad industrialricardogarciaw
 
Relaciones juridicas entre personas y familia s14
Relaciones juridicas entre personas y familia s14Relaciones juridicas entre personas y familia s14
Relaciones juridicas entre personas y familia s14Maestros en Linea MX
 
Alarma casera jesus salas escuela
Alarma casera jesus salas escuela Alarma casera jesus salas escuela
Alarma casera jesus salas escuela Jose Alfredo
 
Universidad Estatal de Bolivar
Universidad  Estatal de BolivarUniversidad  Estatal de Bolivar
Universidad Estatal de BolivarHomero Pasto
 

Viewers also liked (20)

Apache
ApacheApache
Apache
 
Apache
ApacheApache
Apache
 
Power Electronics 2 mark Questions
Power Electronics 2 mark Questions Power Electronics 2 mark Questions
Power Electronics 2 mark Questions
 
Politicas publicas
Politicas publicasPoliticas publicas
Politicas publicas
 
3Com 3COM SWITCH 5 3CFSU0
3Com 3COM SWITCH 5 3CFSU03Com 3COM SWITCH 5 3CFSU0
3Com 3COM SWITCH 5 3CFSU0
 
Recuperación de desastres evaluación del proceso del negocio y administración
Recuperación de desastres evaluación del proceso del negocio y administraciónRecuperación de desastres evaluación del proceso del negocio y administración
Recuperación de desastres evaluación del proceso del negocio y administración
 
3Com 3C17229
3Com 3C172293Com 3C17229
3Com 3C17229
 
tipos de riesgos (higiene y seguridad industrial)
tipos de riesgos  (higiene y seguridad industrial)tipos de riesgos  (higiene y seguridad industrial)
tipos de riesgos (higiene y seguridad industrial)
 
Relaciones juridicas entre personas y familia
Relaciones juridicas entre personas y familiaRelaciones juridicas entre personas y familia
Relaciones juridicas entre personas y familia
 
Moda y deportes
Moda  y deportesModa  y deportes
Moda y deportes
 
Ser biológico
Ser biológicoSer biológico
Ser biológico
 
Redes industriales ss14
Redes industriales ss14Redes industriales ss14
Redes industriales ss14
 
Higiene y seguridad industrial
Higiene y seguridad industrialHigiene y seguridad industrial
Higiene y seguridad industrial
 
Dj
DjDj
Dj
 
Outlook
OutlookOutlook
Outlook
 
Relaciones juridicas entre personas y familia s14
Relaciones juridicas entre personas y familia s14Relaciones juridicas entre personas y familia s14
Relaciones juridicas entre personas y familia s14
 
Alarma casera jesus salas escuela
Alarma casera jesus salas escuela Alarma casera jesus salas escuela
Alarma casera jesus salas escuela
 
Adwords 1
Adwords 1Adwords 1
Adwords 1
 
Digital Marketing Training - How To do Social Media Marketing Training
Digital Marketing Training - How To do Social Media Marketing TrainingDigital Marketing Training - How To do Social Media Marketing Training
Digital Marketing Training - How To do Social Media Marketing Training
 
Universidad Estatal de Bolivar
Universidad  Estatal de BolivarUniversidad  Estatal de Bolivar
Universidad Estatal de Bolivar
 

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

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
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
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Recently uploaded (20)

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
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
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
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
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.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