Creating Apache Virtual Hosts with Enable/Disable Vhosts Options in RHEL/CentOS 7.0

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Matei Cezar

I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

23 Responses

  1. Dinesh says:

    Hi,
    I get the same error as alam above:
    when i adding IncludeOptional sites-enabled/*.conf line in httpd.conf then in restart i got error Invalid command ‘IncludeOptional’, perhaps misspelled or defined by a module not included in the server configuration

    Has anyone been able to resolve this?

  2. Dinesh says:

    Hi, I am getting the error:

    sudo apachectl restart
    apachectl: Configuration syntax error, will not run “restart”:
    Syntax error on line 410 of /usr/local/apache/conf/httpd.conf:
    Invalid command ‘IncludeOptional’, perhaps misspelled or defined by a module not included in the server configuration

    Any help you can provide how to overcome this? I searched the net and have seen others get this error as well but did not find any solution.

  3. alam says:

    when i adding IncludeOptional sites-enabled/*.conf line in httpd.conf then in restart i got error Invalid command ‘IncludeOptional’, perhaps misspelled or defined by a module not included in the server configuration

  4. Flo says:

    Works as described! Perfect. Thanks!

  5. br4v37 says:

    hello, thank u for the tutorial. can u put a tutorial about run vhost with separate uid ( i tried httpd-itk, suPHP but nothing works with me )

  6. John says:

    Hello, I have followed all steps, but my issue is that my second website uses my first websites directory!

  7. mstone says:

    Interesting approach however I usually don’t turn sites on and off so it is actually easier for me to include the virtualhost right in the httpd.conf, but just wanted to let you know there is a typo in the instructions

    /usr/local/bin/a2dissite

    Two “ss” later when you execute the script you only have one “s”

  8. anchorite says:

    This is great, thank you very much!

  9. Matei Cezar says:

    I’m trying to simplify Vhost management process ;)

  10. c0m0 says:

    you are trying to replicate the debian apache management tool :(

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.