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

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

    DocumentRoot /www/docs/
    ErrorLog logs/
    CustomLog logs/ common
Question by:MCN_CO
    1 Comment
    LVL 82

    Accepted Solution

    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  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

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    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 you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    733 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now