Apache and Virtual Hosts Exercises



Similar documents
Setup a Virtual Host/Website

Network Management & Monitoring

Installing an SSL certificate on the InfoVaultz Cloud Appliance

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

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

Apache Configuration

Solr Bridge Search Installation Guide

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

How to Install Multicraft on a VPS or Dedicated Server (Ubuntu bit)

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

Ulteo Open Virtual Desktop Installation

Installation documentation for Ulteo Open Virtual Desktop

CO Web Server Administration and Security. By: Szymon Machajewski

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

Installation of PHP, MariaDB, and Apache

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

HOW TO BUILD A VMWARE APPLIANCE: A CASE STUDY

Monitoring Netflow with NFsen

How to: Install an SSL certificate

Network Management & Monitoring Request Tracker (RT) Installation and Configuration

Web Proxy Auto Discovery (WPAD) Configuration Guide. Revision Warning and Disclaimer

LAMP Quickstart for Red Hat Enterprise Linux 4

IBM DB2 for Linux, UNIX, and Windows. Deploying IBM DB2 Express-C with PHP on Ubuntu Linux

Installing Rails 2.3 Under CentOS/RHEL 5 and Apache 2.2

INASP: Effective Network Management Workshops

Redmine Installation on Debian. v1.1

ULTEO OPEN VIRTUAL DESKTOP UBUNTU (PRECISE PANGOLIN) SUPPORT

CPE111 COMPUTER EXPLORATION

Web Browsing Examples. How Web Browsing and HTTP Works

How to setup HTTP & HTTPS Load balancer for Mediator

Expresso Quick Install

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

Create a virtual machine at your assigned virtual server. Use the following specs

Advanced Internetworking

Network Monitoring Lab

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

Installing an open source version of MateCat

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 your network settings to use Google Public DNS

INUVIKA OVD INSTALLING INUVIKA OVD ON UBUNTU (TRUSTY TAHR)

itixi Ubuntu Server Deployment How-To/Information

WebBridge LR Integration Guide

Transferring AIS to a different computer

Ruby on Rails (Ruby 1.9.2, Rails 3.1.1) Installation

Load Balancing/High Availability Configuration for neoninsight Server

CTIS486 Midterm Solution 23/07/ Akgül

Desktop : Ubuntu Desktop, Ubuntu Desktop Server : RedHat EL 5, RedHat EL 6, Ubuntu Server, Ubuntu Server, CentOS 5, CentOS 6

Technical specification

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

OpenGeo Suite for Linux Release 3.0

SETTING UP A LAMP SERVER REMOTELY

Changing Your Cameleon Server IP

Linux Development Environment Description Based on VirtualBox Structure

Installing Dspace 1.8 on Ubuntu 12.04

Building Website with Drupal 7

owncloud 8 and DigitalOcean Matthew Davidson Bluegrass Linux User Group 03/09/2015

tpischeduler tpischeduler TotalFBO tpischeduler TotalFBO Initial Installation tpischeduler TotalFBO tpischeduler

netkit lab web server and browser 1.2 Giuseppe Di Battista, Maurizio Patrignani, Massimo Rimondini Version Author(s)

Enterprise SSL Support

SNPsyn documentation. Release 1.1b. Tomaž Curk Gregor Rot Davor Sluga Uroš Lotrič Blaž Zupan

Web Server using Apache. Heng Sovannarith

Spam Marshall SpamWall Step-by-Step Installation Guide for Exchange 5.5

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

CYAN SECURE WEB HOWTO. NTLM Authentication

Lab 4 Domain Name System - DNS CMPE 150

Kollaborate Server Installation Guide!! 1. Kollaborate Server! Installation Guide!

FTP Server Configuration

Apt-mirror. Copyright c Dr. Kent L. Miller Jan-20

Adafruit's Raspberry Pi Lesson 6. Using SSH

VERSION 9.02 INSTALLATION GUIDE.

Installation Guide for AmiRNA and WMD3 Release 3.1

Back Up Linux And Windows Systems With BackupPC

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

BioWin Network Installation

While are you still in Nagios working directory, create a new file for DNS servers monitoring

ITIS 2110 Lab 11: Domain Name Server. Tyler Everhart 11/12/2010

Integrating Apache Web Server with Tomcat Application Server

How to Restore a Linux Server Using Bare Metal Restore

GestióIP IPAM v3.0 IP address management software Installation Guide v0.1

netkit lab Università degli Studi Roma Tre Dipartimento di Informatica e Automazione Computer Networks Research Group Version 1.

WebScheduler TotalFBO TotalFBO Initial Installation TotalFBO Connecting to a Database TotalFBO

How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu

Introduction. What is Unbound and what is DNSSEC. Installation. Manual for Unbound on Windows. W.C.A. Wijngaards, NLnet Labs, October 2010


FortiAuthenticator - Two-Factor Authentication Agent for Windows VERSION 1.0

2. Boot using the Debian Net Install cd and when prompted to continue type "linux26", this will load the 2.6 kernel

Raspberry Pi Webserver

Local Caching Servers (LCS): User Manual

Asia Web Services Ltd. (vpshosting.com.hk)

SI455 Advanced Computer Networking. Lab2: Adding DNS and Servers (v1.0) Due 6 Feb by start of class

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

How to Configure edgebox as a Web Server

VDCF - Virtual Datacenter Control Framework for the Solaris TM Operating System

Installing Rails 2.3 Under Windows XP and Apache 2.2

INUVIKA OVD INSTALLING INUVIKA OVD ON RHEL 6

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

Apache Hadoop 2.0 Installation and Single Node Cluster Configuration on Ubuntu A guide to install and setup Single-Node Apache Hadoop 2.

Transcription:

Apache and Virtual Hosts Exercises Install Apache version 2 Apache is already installed on your machines, but if it was not you would simply do: # apt-get install apache2 As the root user. Once Apache is installed it is up and running. The startup defintion for Apache is /etc/init.d/apache2. You can stop, start, restart, reload Apache by doing: # service apache2 stop # service apache2 start # service apache2 restart 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 the standard Linux convention of: /var/www/share/virtualhostname1 /var/www/share/virtualhostname2 /var/www/share/etc All of your PCs have multiple entries for their assigned IP addresses on the Authoritative nameserver for the zone ws.nsrc.org that is on 10.10.0.254. Thus, you can use both these names: pcx.ws.nsrc.org ==> 10.10.0.X tzx.ws.nsrc..org ==> 10.10.0.X to access your machines. We will take advantage of this for the exercise. Let's create the web directories that we ll need:

# cd /var/www/ # mkdir share # cd share # mkdir pcx.ws.nsrc.org # mkdir tzx.ws.nsrc.org Be sure you replace X with the number of your PC. Now let's copy the original index.html file to our pcx.ws.nsrc.org directory, and the tzx.ws.nsrc.org directory as well: # cp../index.html pcx.ws.nsrc.org/. # cp../index.html tzx.ws.nsrc.org/. Edit the index.html files in the pcx and tzx directories. # vi pcx.ws.nsrc.org/index.html Change the text This is the default web page for this server. to pcx.ws.nsrc.org Virtual Host. Close and save the file. # vi tzx.ws.nsrc.org/index.html Change the text This is the default web page for this server. to tzx.ws.nsrc.org Virtual Host. Close and save the file. Now we need to adjust the Apache configuration files for our two new sites. We will treat the pcx.ws.nsrc.org site as our default site that is, where people arrive if, for some reason, the come to our box without specifying a host name (for instance, if they use an IP address instead): # cd /etc/apache2/sites-available # vi default In the file default we will change the DocumentRoot setting to point to the directory for pcx.ws.nsrc.org. Look for this line: DocumentRoot /var/www Change this line to read:

DocumentRoot /var/www/share/pcx.ws.nsrc.org Save the file and exit. Now let s restart Apache and see if the server is still working: # service apache2 restart In a web browser (on your machine) open the URL http://pcx.ws.nsrc.org/ and you should see: It works! pc32.ws.nsrc.org Virtual Host The web server software is running but no content has been added, yet. To verify that you only have one host at this time open the URL http://tzx.ws.nsrc.org/ and you should see the same thing. Now let s enable our other host, tzx.ws.nsrc.org. We need to create a new file in /etc/apache2/sites-available and call it something to indicate the name of the virtual host. The easiest thing to do is just copy the default config file and update the DocumentRoot statement in that file to point to our other host. # cd /etc/apache2/sites-available # cp default tzx.ws.nsrc.org # vi tzx.ws.nsrc.org Find the line that says: DocumentRoot /var/www/share/pcx.ws.nsrc.org And, change that line to read: DocumentRoot /var/www/share/tzx.ws.nsrc.org And, underneath that line add a line that says: ServerName tzx.ws.nsrc.org Now exit and save the file. To enable the virtual host do:

# a2ensite tzx.ws.nsrc.org After restarting prove to yourself that virtual hosting is working. In a web browser go to http://tzx.ws.nsrc.org/ and you should see the page indicate you are looking at the index.html file that resides in /var/www/share/tzx.ws.nsrc.org i.e., the page will say: It works! tz32.ws.nsrc.org Virtual Host The web server software is running but no content has been added, yet. That s it! You are now running Apache with virtual hosts on your machine. Ubuntu / Debian Linux make this very simple as the default configuration is already built assuming you wish to use virtual hosting. On item you can update is the name of the log files that are being written for each host. To do for tzx.ws.nsrc.org you would do: # vi /etc/apache2/sites-available/tzx.ws.nsrc.org And look for the line that says: ErrorLog /var/log/apache2/error.log And change the line to read: ErrorLog /var/log/apache2/tzx.error.log Now look for the line that says: CustomLog /var/log/apache2/access.log combined And change this to read: CustomLog /var/log/apache2/tzx.access.log combined Now save and exit from the file and reload the Apache web server:

To verify that your changes are working look in the Apache log directory for the new log file: # ls /var/log/apache2 And, you should see the new log files: tzx.access.log tzx.error.log That s it. This is very useful for all sorts of reasons and is standard if you are providing virtual hosts to other users.