How to Create an Apache 2 Virtual Host on Debian 7 Wheezy Linux Quick-Start Guide

October 14, 2014 | By the+gnu+linux+evangelist | Filed in: Tutorial.

Debian Apache 2 Virtual Hosts Quick Start

You are Welcome! The Tutorial shows you Step-by-Step How to Getting-Started with Apache 2 Virtual Host on Linux Debian 7 Wheezy i386/amd64 Desktop/Server.

And the term Virtual Host refers to the Practice of Running more than One Website (such as and on a Single Machine.

Virtual Hosts can be:

  • Name-based“, meaning that you have Multiple Names running on each IP address
  • IP-based“, meaning that you have a Different IP Address for Every Website

The fact that they are Running on the Same Physical Server is Not Apparent to the End User.

Step-by-step – ActiveMQ Fedora 37 Installation

How to Create a Name-based Virtual Host on Linux Debian

    How to Install LAMP Server on Debian.

    LAMP Server Installation Debian
  1. Or Open a Command Line Terminal Window
    (Press “Enter” to Execute Commands)

    Create Apache 2 Virtual Host on Linux Debian 7 Wheezy - Open Terminal

    Or Login into Server Shell Shell.

  2. Add the Domain to the hosts Config File.


    If Got “User is Not in Sudoers file” then see: How to Enable sudo

    nano /etc/hosts

    Append: []

    Only Substitute Your real Domain Name to “[]” :)
    Ctrl+Shift+v to Paste Content on nano
    Ctrl+x to Save and Exit from nano Editor

  3. Create the VHost Target Directory.

    mkdir /var/www/html/[mySite]

    And may be also a Testing index.html:

    echo "My New WebSite is Working! :)" > /var/www/html/[mySite]/index.html

    Then Set the Domain’s Ownership with:

    chown -R www-data:www-data /var/www/html/[mySite]
  4. Create a VHost Config File.

    nano /etc/apache2/sites-available/[myDomainName].conf

    Append at Least:

    <VirtualHost *:80>
    DocumentRoot /var/www/html/[mySite]

    To get a little More Insight may look:

    cat /etc/apache2/sites-available/000-default.conf
  5. Enabling the New Virtual-Host.

    cd /etc/apache2/sites-enabled
    ln -s ../sites-available/[myDomainName].conf .
  6. Restart Apache2 Web Server.

    service apache2 restart
  7. How to Enable Apache2 mod_rewrite Module on Debian.

    Enabling Apache2 Rewrite for Debian

    How to Create a IP-based Virtual Host on Linux Debian

    How to Create an IP-Based Virtual Host on Debian.

    Debian Apache2 IP Virtual-Host

Tags: , , , , , , , , , ,

QuickChic Theme • Powered by WordPress