[Last Call] Learn how to a build a cloud-first strategyRegister Now


I need a httpd <virtualhost > element that serves to an IP only.. no host

Posted on 2011-04-29
Medium Priority
Last Modified: 2012-05-11
It should look something like this

    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/docs/dummy-host.example.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
Question by:MCN_CO
1 Comment
LVL 84

Accepted Solution

Dave Baldwin earned 2000 total points
ID: 35494860
This is a working vhost file from my Ubuntu 8.04 test server (with the name changed) for Apache 2.2.  You may not need all of it.  I stopped changing it when I got it working.

Apache 2.2 puts these into 'sites-available' with a symlink to them in 'sites-enabled'.  Older versions put everything in 'httpd.conf' and other systems may also.  Here's the page for my system https://help.ubuntu.com/8.04/serverguide/C/httpd.html  It uses a program called 'a2ensite' to enable vhosts.
    ServerAdmin webmaster@localhost
    ServerName mysite
    DocumentRoot /home/mysite/public_html/
    <Directory /home/mysite/public_html/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all

    ScriptAlias /cgi-bin/ /home/mysite/public_html/cgi-bin/
    <Directory "/home/mysite/public_html/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all

    ErrorLog /home/mysite/apache-error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /home/mysite/access.log combined
    ServerSignature On


Open in new window


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses
Course of the Month17 days, 14 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question