Apache and Virtual Hosts Exercises AfNOGCHIX 2011 Blantyre, Malawi



Similar documents
Apache and Virtual Hosts Exercises

Host your websites. The process to host a single website is different from having multiple sites.

APACHE HTTP SERVER 2.2.8

Setup a Virtual Host/Website

CO Web Server Administration and Security. By: Szymon Machajewski

Exercises: FreeBSD: Apache and SSL: pre SANOG VI Workshop

Installing an SSL certificate on the InfoVaultz Cloud Appliance

Configure Wildcard-Based Subdomains

Apache Configuration

Virtual Host (Web Server)

Apache 2.2 on QNX Neutrino 6.4.x OS Step-by-step installation manual

Virtual Host Continue

Exercises: FreeBSD: Apache and SSL: SANOG VI IP Services Workshop

User s guide. APACHE SSL Linux. Using non-qualified certificates with APACHE SSL Linux. version 1.3 UNIZETO TECHNOLOGIES S.A.

SIMIAN systems. Setting up a Sitellite development environment on Mac OS X. Sitellite Content Management System

How to: Install an SSL certificate

How to setup HTTP & HTTPS Load balancer for Mediator

Installing Rails 2.3 Under Windows XP and Apache 2.2

WebBridge LR Integration Guide

Lab 3.4.2: Managing a Web Server

SecuritySpy Setting Up SecuritySpy Over SSL

esync - Receiving data over HTTPS

SIMIAN systems. Setting up a Sitellite development environment on Windows. Sitellite Content Management System

Apache HTTP Server. Implementation Guide. (Version 5.7) Copyright 2013 Deepnet Security Limited

Creating X.509 Certificates With OpenSSL

1. Configuring Apache2 Load Balancer with failover mechanism

ViMP 3.0. SSL Configuration in Apache 2.2. Author: ViMP GmbH

Enterprise SSL Support

Apache Usage. Apache is used to serve static and dynamic content

Web Server using Apache. Heng Sovannarith

Security Workshop. Apache + SSL exercises in Ubuntu. 1 Install apache2 and enable SSL 2. 2 Generate a Local Certificate 2

Installing Rails 2.3 Under CentOS/RHEL 5 and Apache 2.2

SCADA Security. Enabling Integrated Windows Authentication For CitectSCADA Web Client. Applies To: CitectSCADA 6.xx and 7.xx VijeoCitect 6.xx and 7.

Setting up a Web Server using Raspbian Wheezy on the Raspberry Pi ( Kenneth A Spencer)

How To Set Up A Virtual Host In Apa On A Linux Box On A Windows Xp Or Ipa On An Ubuntu Box On An Ipa (Windows) Or Ipo (Windows Xp) On A Ubora Box On Your Ubora

Installation of PHP, MariaDB, and Apache

MassTransit 6.0 Enterprise Web Configuration for Macintosh OS 10.5 Server

This section describes how to use SSL Certificates with SOA Gateway running on Linux.

Dataworks System Services Guide

Integrating Apache Web Server with Tomcat Application Server

CentOS. Apache. 1 de 8. Pricing Features Customers Help & Community. Sign Up Login Help & Community. Articles & Tutorials. Questions. Chat.

Services: Apache a patchy web server

How to Configure edgebox as a Web Server

CTIS486 Midterm Solution 23/07/ Akgül

PHP+MYSQL, EASYPHP INSTALLATION GUIDE

Step-by-Step guide to setup an IBM WebSphere Portal and IBM Web Content Manager V8.5 Cluster From Zero to Hero (Part 2.)

Configuring Content Switching Feature

SSL Installing your new Certificate

APACHE WEB SERVER. Andri Mirzal, PhD N

10gAS SSL / Certificate Based Authentication Configuration

PassBy[ME] - Bugzilla integration on

LAMP Quickstart for Red Hat Enterprise Linux 4

Install Apache on windows 8 Create your own server

Comparison table for an idea on features and differences between most famous statistics tools (AWStats, Analog, Webalizer,...).

Configuring Apache and IIS for High Availability Web Server Clustering

Moving Drupal to the Cloud: A step-by-step guide and reference document for hosting a Drupal web site on Amazon Web Services

Implementing HTTPS in CONTENTdm 6 September 5, 2012

Setting up an Apache Web Server for Greenstone 2 Walkthrough

WebIOPi. Installation Walk-through Macros

Created by : Ashish Shah, J.M. PATEL COLLEGE UNIT-5 CHAP-1 CONFIGURING WEB SERVER

Installation Guide for WebSphere Application Server (WAS) and its Fix Packs on AIX V5.3L

Installing OptiRain Open on Macintosh OS X 10.6 (Snow Leopard)

EQUELLA. Clustering Configuration Guide. Version 6.0

Apache Web Server Complete Guide Dedoimedo

Web Same-Origin-Policy Exploration Lab

Installation Instructions

Xpert.ivy 4.2. Server Guide

tpischeduler tpischeduler TotalFBO tpischeduler TotalFBO Initial Installation tpischeduler TotalFBO tpischeduler

Browser Client 2.0 Admin Guide

Configuring MassTransit for the Web Using Apache on Mac OS 10.2 and 10.3

What will be supplied with chemoventory package?

Reference and Troubleshooting: FTP, IIS, and Firewall Information

A Beginner's Guide to Setting Up A Web Hosting System (Or, the design and implementation of a system for the worldwide distribution of pictures of

Configuring Ubuntu Server as a Firewall and Reverse Proxy for OWA 2007 Configuration Guide

WebSphere Application Server V7: Deploying Applications

Installing and Configuring Apache

Running Nginx as Reverse Proxy server

How To Enable A Websphere To Communicate With Ssl On An Ipad From Aaya One X Portal On A Pc Or Macbook Or Ipad (For Acedo) On A Network With A Password Protected (

Setting Up A Nagios Monitoring System Warren Block, May 2005

Installing SQL-Ledger on Windows

Running Secure & Reliable Web/Mail/other Services from Home Part-II: Setting Up A SOHO Linux Web and Server

Mapping ITS s File Server Folder to Mosaic Windows to Publish a Website

Apache JMeter HTTP(S) Test Script Recorder

e-cert (Server) User Guide For Apache Web Server

Internal Security Concepts Users Guide

Redatam+SP REtrieval of DATa for Small Areas by Microcomputer

Talk Internet User Guides Controlgate Administrative User Guide

Laboratory Exercises VI: SSL/TLS - Configuring Apache Server

Ricardo Perdigao, Solutions Architect Edsel Garcia, Principal Software Engineer Jean Munro, Senior Systems Engineer Dan Mitchell, Principal Systems

IBM WebSphere Application Server Communications Enabled Applications Setup guide

SQL Injection Attack Lab Using Collabtive

A STEP- BY-STEP GUIDE

Lab - Observing DNS Resolution

Configuring the BBj Jetty Web Server (rev10.02) for OSAS

WEB INTERFACE FOR CDS/ISIS. GENISISweb VERSION Deepali Talagala, General Secretary, Sri Lanka Library Association Colombo

Copyright Notice. Parallels IP Holdings GmbH Vordergasse 59 CH-Schaffhausen Switzerland Phone: Fax:

Running Multiple Shibboleth IdP Instances on a Single Host

Getting the software The Apache webserver can be downloaded free from the Apache website :

SITEMINDER SSO FOR EMC DOCUMENTUM REST

Enterprise Knowledge Platform

Transcription:

Apache and Virtual Hosts Exercises AfNOGCHIX 2011 Blantyre, Malawi Install Apache version 2 from Package Set the path to your network ftp package source --- you may have already done this in earlier sessions # set FTP_ROOT=ftp://10.10.10.200/pub/FreeBSD/releases/i386/8.2- RELEASE/packages/All Note: the above command is one line Adding Apache package # pkg_add $FTP_ROOT/apache-2.2.17_1.tbz Now we will configure Apache to run on your machines. Configure Apache version 2 Apache is a Third Party software package. The configuration files for Apache reside in the /usr/local/etc directory. In order for Apache to run you must first do the following: # ee /etc/rc.conf Add a line to the bottom of this file and enter: apache22_enable= YES Now exit and save the file. If you install Third Party software and need to know what to enter in the /etc/rc.conf file to enable it, read the initialization script for that software. For instance, for Apache you can do: # less /usr/local/etc/rc.d/apache22

You will see comments at the top of the file describing the options you can place in the /etc/rc.conf file to run the service. See the section: # # Add the following lines to /etc/rc.conf to enable apache22: # apache22_enable (bool): Set to "NO" by default. # Set it to "YES" to enable apache22 Press q to exit from the less command. Start Apache version 2 This is quite simple. Now that the service has been enabled in /etc/rc.conf type: # /usr/local/etc/rc.d/apache22 start If you would like to prove that Apache is working on your computer open a web browser and enter in the address: http://localhost/ You should see a page that says, It works! The file where this text resides is: /usr/local/www/apache22/data/index.html

Making Changes To Your Home Page We edit the file /usr/local/www/apache22/data/index.html # ee /usr/local/www/apache22/data/index.html Enter the text This is my website, Created in the AfNOGChix 2011 Class Reload/Refresh on your browser http://localhost/ Configure Virtual Hosts in Apache 2 There are several ways to approach virtual hosting. The first thing you must determine is your directory structure where each web site will reside. For our purposes we will use: /usr/local/www/share All of your PCs have multiple entries for their assigned IP addresses. At the very least you have: - *** xxxxx.afchix.mw = is domain registered during DNS exercise *** pcx.afchix.mw ==> 10.10.10.X www.yourdomain.afchix.mw ==> 0.10.10.X We will take advantage of this for the exercise. Let's create three web directories: # cd /usr/local/www/ # mkdir share # cd share # mkdir default # mkdir mtgdomain # mkdir ws Now let's copy the original index.html file to our default directory, and the mtg and ws directories as well..

# cp../apache22/data/index.html default/. # cp../apache22/data/index.html mtgdomain/. # cp../apache22/data/index.html ws/. Edit the index.html files in mtg and ws. # ee mtgdomain/index.html Add the text Meeting Domain Virtual Host to This is my website, Created in the AfNOGChix 2011 Class!. Close and save the file. # ee ws/index.html Add the text Workshop Virtual Host to This is my website, Created in the AfNOGChix 2011 Class. Close and save the file. Next we need to edit the Apache configuration files to adjust for our new directory settings. # cd /usr/local/etc/apache22 # ee httpd.conf In the file httpd.conf we are looking first for the following line: DocumentRoot "/usr/local/www/apache22/data Change this line to read: DocumentRoot "/usr/local/www/share/default Then look for the line that reads: <Directory "/usr/local/www/apache22/data"> And change this to: <Directory "/usr/local/www/share"> Now find the line that says: #Include etc/apache22/extra/httpd-vhosts.conf And change this by removing the hash (#) at the beginning of the line we are

uncommenting this line to use vhosts: Include etc/apache22/extra/httpd-vhosts.conf Now let's verify that Apache is still working. # /usr/local/etc/rc.d/apache22 restart In a web browser (on your machine) open the URL http://localhost/ once again. It should still read, This is my website, Created in the AfNOGChix 2011 Class. Now we will add the configuration for our two virtual hosts: # cd /usr/local/etc/apache22/extra # ee httpd-vhosts.conf Find the line that says: NameVirtualHost *:80 And delete everything after that line. Now let's configure your two virtual hosts. Add the following to the file below the NameVirtualHost *:80 line: <VirtualHost *:80> ServerAdmin afnogchix@localhost DocumentRoot "/usr/local/www/share/default" ServerName 10.10.10.X ErrorLog "/var/log/httpd-error_log" CustomLog "/var/log/httpd-access_log" common </VirtualHost> <VirtualHost *:80> ServerAdmin afnogchix@localhost DocumentRoot "/usr/local/www/share/mtg" ServerName www.yourdomain.afchix.mw ErrorLog "/var/log/mtg-error_log" CustomLog "/var/log/mtg-access_log" common </VirtualHost> <VirtualHost *:80> ServerAdmin afnogchix@localhost DocumentRoot "/usr/local/www/share/ws" ServerName pcx.afchix.mw ErrorLog "/var/log/ws-error_log"

CustomLog "/var/log/ws-access_log" common </VirtualHost> Once you are done save the file and quit. Now we must restart Apache to load the new configuration. You can do this two different ways: Either: Or: # /usr/local/etc/rc.d/apache22 restart # apachectl restart After restarting prove to yourself that virtual hosting is working. Do the following on your browser: Browser Tab Tab 1 Type the address localhost Tab 2 127.0.0.1 Tab 3 Tab 4 Tab 5 10.10.10.X pcx.afchix.mw www.yourdomain.afchix.mw Do you see what you expect? Remember to replace the X and xx with the appropriate numbers. For example, for pc10.afchix.or.ke the urls would be: localhost 127.0.0.1 41.215.76.10 pc10.afchix.mw www.yourdomain.afchix.mw Homework: If you have defined additional hosts for your IP address feel free to add them in to your /usr/local/etc/apache22/extra/httpdvhosts.conf file. Remember to create a directory for their DocumentRoot and to place an html file in that directory.