Setup a Virtual Host/Website

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

Apache and Virtual Hosts Exercises

Virtual Host Continue

Web Server using Apache. Heng Sovannarith

CO Web Server Administration and Security. By: Szymon Machajewski

Virtual Host (Web Server)

GlobalSign Solutions

Installing an SSL certificate on the InfoVaultz Cloud Appliance

1. Configuring Apache2 Load Balancer with failover mechanism

How to: Install an SSL certificate

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

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

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

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

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

Semantic based Web Application Firewall (SWAF - V 1.6)

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

Ulteo Open Virtual Desktop Installation

Cloud Homework instructions for AWS default instance (Red Hat based)

Zimbra :: The Leader in Open Source Collaboration. Administrator's PowerTip #3: June 21, 2007 Zimbra Forums - Zimbra wiki - Zimbra Blog

Configure Wildcard-Based Subdomains

Installing Booked scheduler on CentOS 6.5

Installation documentation for Ulteo Open Virtual Desktop

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

Configuring Apache and IIS for High Availability Web Server Clustering

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

SSL Installing your new Certificate

Lab 3.4.2: Managing a Web Server

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

Setup Local Mail Server Using Postfix, Dovecot And Squirrelmail On CentOS 6.5/6.4

CC ICT-SUD. Setting up and integrate Apache, MySQL and PHP on a Linux system

User Manual of the Pre-built Ubuntu 9 Virutal Machine

Apache2 Configuration under Debian GNU/Linux. Apache2 Configuration under Debian GNU/Linux

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

Apache Configuration

Apache & Virtual Hosts & mod_rewrite

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

User Manual of the Pre-built Ubuntu Virutal Machine

Apache Web Server Complete Guide Dedoimedo

Ruby on Rails (Ruby 1.9.2, Rails 3.1.1) Installation

WEB2CS INSTALLATION GUIDE

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

Step One: Installing Rsnapshot and Configuring SSH Keys

Technical specification

1. If there is a temporary SSL certificate in your /ServerRoot/ssl/certs/ directory, move or delete it. 2. Run the following command:

Configuring Content Switching Feature

Local Caching Servers (LCS): User Manual

Configuring your network settings to use Google Public DNS

Web Same-Origin-Policy Exploration Lab

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

White Paper. Fabasoft on Linux - Preparation Guide for Community ENTerprise Operating System. Fabasoft Folio 2015 Update Rollup 2

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

APACHE HTTP SERVER 2.2.8

DEPLOYMENT GUIDE Version 1.1. Deploying F5 with Oracle Application Server 10g

FUJITSU Cloud IaaS Trusted Public S5 Setup and Configure yum Software Package Manager with CentOS 5.X/6.X VMs

Local DNS Attack Lab. 1 Lab Overview. 2 Lab Environment. SEED Labs Local DNS Attack Lab 1

Install Apache on windows 8 Create your own server

How to Install SMTPSwith Mailer on Centos Server/VPS

esync - Receiving data over HTTPS

SQL Injection Attack Lab

Contents. 1. Infrastructure

Implementing Reverse Proxy Using Squid. Prepared By Visolve Squid Team

The Subversion move/migrate from one server to another, shall be divided into 3 steps: Backup Create Import

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

Deploying the BIG-IP System v10 with Oracle Application Server 10g R2

Web Hosting: Pipeline Program Technical Self Study Guide

Create a New Account Contents

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 (

Installing Rails 2.3 Under CentOS/RHEL 5 and Apache 2.2

Apache Server Implementation Guide

CYAN SECURE WEB HOWTO. NTLM Authentication

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

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

IIS, FTP Server and Windows

How to setup HTTP & HTTPS Load balancer for Mediator

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

Installing QuickBooks Enterprise Solutions Database Manager On Different Linux Servers

LAMP Quickstart for Red Hat Enterprise Linux 4

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

The following process allows you to configure exacqvision permissions and privileges for accounts that exist on an Active Directory server:

CTIS486 Midterm Solution 23/07/ Akgül

Dataworks System Services Guide

SUSE Manager in the Public Cloud. SUSE Manager Server in the Public Cloud

INUVIKA OVD VIRTUAL DESKTOP ENTERPRISE

deploying meteor with meteor up

Other documents in this series are available at: servernotes.wazmac.com

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

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

nitrobit update server

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

Integrating Apache Web Server with Tomcat Application Server

OPENPROJECT INSTALL ON CENTOS 7 RUNNING IN VMWARE PLAYER

Managing Linux Computers Using System Center 2012 R2 Configuration Manager

Using Webmin and Bind9 to Setup DNS Sever on Linux

Using VirtualBox ACHOTL1 Virtual Machines

Transcription:

Setup a Virtual Host/Website Contents Goals... 2 Setup a Website in CentOS... 2 Create the Document Root... 2 Sample Index File... 2 Configuration... 3 How to Check If Your Website is Working... 5 Setup a Website in Ubuntu... 6 Configuration... 8 How to Check If Your Website is Working... 10 Conclusion... 11 1

Goals After reading this guide, you should understand how to setup and manage a website on your Linux server system. (Please note that here we are discussing a typical Linux system, with no control panel. However, even if you do have a control panel, most of the configurations are the same, with the exception of file locations.) Setup a Website in CentOS Create the Document Root Before starting, you have to create the document root, which is the directory where your site contents should be stored, and give necessary permissions and ownerships. In this case, we are going to set our document root under /var/www/html/example_docs. Sample Index File Let s create a sample index file. An index file is the page that loads by default when you access your website. (You can use the file for testing purposes and delete or modify the file after testing.) 1) Change your current directory to our document root. 2) Now create the index file using vi, vim, nano, or your favourite editing tool. (Note: vim is not installed by default. You can use vi instead.) 2

3) Add the following lines in the file: 4) If you are using vi or vim editor, please press Esc + shift + : + x to save the file. 5) Now you have successfully created our test index file. Configuration Now we are going to create a website named www.example.com. (Simply replace example.com with your domain name.) (Note: You do not have to install httpd because httpd service is typically installed with CentOS by default. If httpd is not found, please install the service using yum. The command will be as follows: yum install httpd ) 1) Open the Apache configuration file using any of your file editors, for example using vi or vim. You can find your Apache configuration file (httpd.conf) under /etc/httpd/conf/httpd.conf. 2) Next, you have to specify your document root with the directive Directory with necessary permissions. (Please do not worry about the line number; you can place the root anywhere in the configuration file.) Please follow the example below. 3

3) Then, find the directive DirectoryIndex. You can specify your index file here. (This will be the default page that loads when you access your domain.) 4) There is two ways that you can configure your domain: IP-based Apache and name-based Apache. Using the IP-based method, you have to use separate IP addresses for each domain. In contrast, using the name-based method, you can share an IP address with a number of domains. Here we are going to configure your domain using the IP-based Apache method. Please go to the end of the httpd.conf file and add the following lines: NameVirtualHost This directive is used to specify the IP that you will use for your domains and also the httpd service port. Here we provide the wildcard * instead of a specific IP address, in order to assign any available IP to our domain. (You can assign the same IP to all your domains or you can assign separate IPs for each domain.) DocumentRoot Your domains document root directory path. ServerName Your server FQDN (Fully Qualified Domain Name). 4

ErrorLog The error log path. 5) Now you can restart the httpd service to see if there are any errors. 6) You have now successfully configured your website! (Note that you have to register your domain name first, then point your domain to an IP address and forward the DNS. Reverse entries are must if you want the domain to resolve from the outside.) How to Check If Your Website is Working Now that you have successfully configured your website, how do you know if the website is loading successfully within your system? Before registering your domain and setting up DNS entries, please follow the steps below: 1) Open the file /etc/hosts and point your IP to a created domain name. 2) Now open and comment on the entries in /etc/resolv.conf. Put a # at the start of each line so that the system will only check the /etc/hosts file and will not look for other resolvers in /etc/resolv.conf. 3) Now you can type your website address (the name you gave in /etc/hosts ) in the browser to see if the index page is loading. If you do not have a graphical interface, you 5

can use the command elinks or htmlview. If these components are not installed, you can install them using the yum installation utility. The command will be as follows: yum install elinks (for installing elinks ) yum install htmlview (for installing htmlview ) 4) Now you will receive your default page (index page) and will have successfully setup your website! (Note that SUCCESS!!! Your Website is working fine. is the contents from the index page and if you are using any other index page it will display the contents from that index page.) 5) Press q to exit the window. 6) You have successfully setup your website! (Don't forget to remove the # from /etc/resolv.conf.) Setup a Website in Ubuntu (Note: In Ubuntu, after installation, a sample index file will be created automatically under the /var/www directory. For simplicity, we are going to use /var/www as our document root and the index.html under that directory as our test index page.) 6

Configuration Now we are going to create a website named www.example.com. (Simply replace example.com with your domain name.) 1) Open the configuration file httpd.conf and edit using any of your file editors. For example, you can use vi, vim or nano. You can find this file under /etc/apache2/httpd.conf. (Note: This is actually an empty file. The actual Apache configuration file is apache2.conf, but it is a large configuration file and it may be difficult for you to find its contents and modify them. The easy way to manage this file is to edit and add the configurations in httpd.conf, which are included by default in apache2.conf.) 2) First, tell Apache what the index file name is. You can use the directive DirectoryIndex for that. Add the following line in the file: 3) Then, specify the document root and provide the necessary permissions. 7

4) Now we are going to add the configuration for your virtual host. For that, add the following lines into the file (we give the wildcard * with the directive VirtualHost so that we can use any IP address available with this address): 5) The full file is given below. 6) You have completed the configuration. Now you can restart the apache service for the configurations to take effect and to know if there are any errors. 8

7) Now you have successfully setup your website on your Ubuntu system. How to Check If Your Website is Working Now that you have successfully configured your website, how do you know if the website is loading successfully within your system? Before registering your domain name and setting up DNS entries, please follow the steps below: 1) Open the file /etc/hosts file and point your IP to a created domain. 2) Now open and comment on the entries in /etc/resolv.conf. Put a # at the start of each line so that the system will only check the /etc/hosts file and will not look for other resolvers in /etc/resolv.conf. 3) Now you can type your website address (the name you gave in /etc/hosts ) in the browser to see if the index page is loading. If you do not have a graphical interface, you can use the commands elinks or htmlview. If these components are not installed, you can install them using the apt-get installation utility. The command will be as follows. 9

apt-get install elinks (for installing elinks ) apt-get install htmlview (for installing htmlview ) 4) Now you will get your default page (index page), and you have successfully setup your website! 5) Press q to exit the window. 6) You have successfully setup your website! (Don't forget to remove the # from /etc/resolv.conf.) 10

Conclusion Now you have successfully setup your website. This is a setup with minimal configuration; you can customize or secure your website further according to your needs. If you encountered any issues with this guide, please also note that there is additional information available in our Wiki database at http://myhosting.com/kb. Finally, we encourage you to contact our technical support team by email at vps@myhosting.com, or calling us at 1-866-289-5091 with any questions or concerns. 11