Where to define vhosts

James Dugger james.dugger at gmail.com
Fri Jun 13 15:29:20 MST 2014


Keith, In CentOS /conf.d/ is specifically designated for this purpose with
"Include /etc/httdf/conf.d/*.conf" added to the end of the httpd.conf
file.  That said it does not HAVE to go there.  I have architect-ed a dev
environment for an organization where the site developers are not familiar
with Linux based systems but need access the vhost directives so that they
can perform mod_rewrites and redirects for simpler static sites.  In order
to make this possible and to keep individuals out of the /etc/ directory
altogether I have put the vhosts in /var/httpd-conf/ before.

Another factor is server provisioning.  If you are using a provisioner like
Vagrant with BASH Shell scripts to build web servers on the fly, It is
easier to use cat or echo to append the Includes stanza at the end of the
conf file rather the sed -i to rewrite existing lines.

Just my two cents.




On Fri, Jun 13, 2014 at 3:01 PM, Ed <plug at 0x1b.com> wrote:

> In Fedora, if you don't want updates to the app (Apache in this case)
> to overwrite your configurations, you put them in /etc/httpd/conf.d
> one config file per vhost, and all the other none core config files
> (php, perl, dav_svn, etc) - you may need to preface them with numbers
> to have them load in the proper order. Some break out all module
> invocations into one file and have it be first.
>
> Apache reads the primary config file /etc/httpd/conf/httpd.conf and
> appends all of the  *.conf files in /etc/httpd/conf.d to make the
> complete configuration of your server.
>
> That's how Fedora 20 does it, CentOS might do it that way too.
>
> On Fri, Jun 13, 2014 at 1:49 PM, Michael Torres <matorres124 at gmail.com>
> wrote:
> > My experience is the config for v hosts is at the bottom of the file.
> That
> > is for apache 2.2.
> >
> > On Jun 13, 2014 1:25 PM, <techlists at phpcoderusa.com> wrote:
> >>
> >> Thank you everyone for your help!!
> >>
> >> I'm running Apache 2.2 on CentOS 6.5.
> >>
> >> I was told once to put the vhost file in the config path so that during
> >> future upgrades I do not lose my configuration.
> >>
> >> My main concern is where the config files are included in the httpd.conf
> >> file and how that might effect or be effected by directives that come
> after
> >> the vhosts.
> >>
> >>
> >>
> >>
> >> On 2014-06-13 15:03, Michael Torres wrote:
> >>>
> >>> Depends on the version of apache you are using.  I use 2.2 and I add
> >>> it to the https.conf file..,no issues
> >>> On Jun 13, 2014 12:53 PM, <techlists at phpcoderusa.com> wrote:
> >>>
> >>>> I am wondering what the proper way to add vhosts to the Apache
> >>>> config.
> >>>>
> >>>> I've used 3 methods.
> >>>>
> >>>> 1) add them to the bottom of the httpd.conf file
> >>>> 2) add an include at the bottom of the httpd.conf file that
> >>>> includes a file containing all the vhosts
> >>>> 3) adding a vhost.conf file to /etc/httpd/config.d/ directory
> >>>>
> >>>> In the last method, the vhosts are included in the middle of
> >>>> /etc/httpd/conf/httpd.conf file.  Is this a problem?
> >>>>
> >>>> Is there a better method?
> >>>>
> >>>> Thanks!!
> >>>>
> >>>> Keith
> >>>> ---------------------------------------------------
> >>>> 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 [1]
> >>>
> >>>
> >>>
> >>> Links:
> >>> ------
> >>> [1] 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
> >
> >
> > ---------------------------------------------------
> > 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/20140613/5ae3d106/attachment.html>


More information about the PLUG-discuss mailing list