Including an External Apache vhost file

James Dugger james.dugger at gmail.com
Sun Mar 16 00:04:33 MST 2014


Keith,

Depends on the Distro.  If you are using CentOS or any RHEL alternative,
then typically you place the site conf files in:

    /etc/httpd/conf.d/

The following line should already be in the httpd.conf file provided by
Apache it may just need to be un-commented:

    Include conf.d/*.conf

FYI site configuration files placed in the conf.d directory are given run
priority by lower numbered files first. For example 10-example.site2.conf
would be run before 20-example.site1.conf.

If you don't want to use the conf.d/ directory then you could create a
directory like /etc/httpd/conf/vhost/ and place your .conf files in there.
 You would then simply add an includes file like so in httpd.conf:

    Include conf/vhost/*.conf

If you are running Apache in a Debian or Ubuntu based distro than all site
conf files go in /etc/apache2/sites-available/. Apache2 in Debian and
Ubuntu require that new sites are enabled.  to do this after creating your
site's .conf file run:

   sudo a2ensite your-site-name.conf (this is the same name you gave the
conf file in /etc/apache2/sites-available)

Also in Debian/Ubuntu you need to ensure that the mod_rewrite module is
enabled.  To do this you type just once.

    sudo a2enmod rewrite

Hope that helps.

​James​


On Sat, Mar 15, 2014 at 9:24 PM, keith smith <klsmith2020 at yahoo.com> wrote:

> Cool, thanks!!
>
> ------------------------
> Keith Smith
>
>
>   On Saturday, March 15, 2014 8:40 PM, Eric Cope <eric.cope at gmail.com>
> wrote:
>  Cpanel does it that way too. I couldn't find a quick reference, but here
> is one:
>
> http://stackoverflow.com/questions/6526498/import-include-external-virtualhost-file-to-be-used-inside-apaches-httpd-conf
>
> Eric
>
>
> On Sat, Mar 15, 2014 at 5:04 PM, keith smith <klsmith2020 at yahoo.com>wrote:
>
>
>
>  I Hope I do not drive everyone crazy over the next couple days or weeks
> as it might be.  So let me thank you in advance for your patience and help!!
>
> A little background... A year ago one of the members of this list helped
> me configure a webserver that is in my home office.  It has run well for a
> year.  It is on an old desktop so I bought a new box and it is time to
> configure it.  This time I hope to go it alone with my safety net of course.
>
> My first of probably many questions has to do with Apache - I was told a
> while ago that the way to add vhosts is by putting them into a seperate
> file so they will not get overwritten during an update.
>
> I've been looking for a standard way to do this, however I am not finding
> any standard.  Is there a standard or do I just add an include at the end
> of the httpd.config.  If so should I just add the SSL vhosts in the same
> way?
>
> Thank you so much for your help!!
>
>  Keith
>
> ------------------------
> Keith Smith
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.phxlinux.org/mailman/listinfo/plug-discuss
>
>
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.phxlinux.org/mailman/listinfo/plug-discuss
>
>
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.phxlinux.org/mailman/listinfo/plug-discuss
>



-- 
James

*Linkedin <http://www.linkedin.com/pub/james-h-dugger/15/64b/74a/>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phxlinux.org/pipermail/plug-discuss/attachments/20140316/4149aaa8/attachment.html>


More information about the PLUG-discuss mailing list