Re: best practices for configuring multiple VirtualHost Apache WWW servers in Fedora?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tim:
>> The conf.d/*.conf files are processed in alphabetical order, so name
>> your default virtual host's configuration file to be picked first (e.g.
>> 000-default.conf).  Filenames don't have to be the same as the domain
>> name, by the way.


Franta Hanzlík:
> IMO this alphabetical order processing (assuming that provided 
> the conf.d/*.conf files are either vhost-only, or no-vhost-only (ie the
> definition for the "main" server)) is only relevant for determining what 
> the "default" virtual server (serving to other vhost unassigned requests) 
> will be.

If you look at the main httpd.conf file, this is at the very end:

  ---- begin my paste ----
  
  # Supplemental configuration
  #
  # Load config files in the "/etc/httpd/conf.d" directory, if any.
  IncludeOptional conf.d/*.conf
  
  ---- end of my paste ----

In essence there's just one big configuration file, composed of the
main file with all the conf.d entries as a part of it.  They're
included into it (which will be an alphabetically ordered import).  But
since the main configuration file doesn't have anything else after it
(as mine currently stands), they're simply appended to it (in
alphabetic sorted order).  And THEN that conglomeration is parsed
(which will have its own set of rules).

So, the alphabetical sorting should only make any difference where...

Something that's found first is considered first for something, or
something that's found last gets to override a previous settings.

Though many things don't have any priority.

The default virtual host is simply the first virtual host defined, and
any traffic that doesn't appear to belong to any particular virtual
host is dealt with by it.  In the past, that would have been a server
in the main configuration, these days it's the first virtual host.  

Either way, it may be prudent to make it serve an error notice.


> - So when all vhosts listen on all interfaces and all their IPs and
> using only standard ports 80/http and 443/https there will be one
> "default" server for http and one "default" for https.

I think it's more a case of Apache listens, and is the handler to deal
with this traffic goes here or there.  Rather than multiple Apaches
listening to everything to see if something is supposed to be for them,
and ignoring what isn't.  I have more virtual hosts configured then
there are Apache processes running.

But yes, there could be one default HTTP and one default HTTPS, and you
could define them both with just one conf file.

The confusing thing is when someone is simply going to serve one
website, doesn't really need virtual hosts, yet has to delve into them
because of some outside requirement (such as some oddball requirements
of one of the certificate issuers).

-- 
 
uname -rsvp
Linux 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
 
Boilerplate:  All unexpected mail to my mailbox is automatically deleted.
I will only get to see the messages that are posted to the mailing list.
 
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux