Re: Apache configuration problem

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

 



On Mon, 2008-05-19 at 12:55 +0100, Paul wrote:
> If I try in Firefox http://127.0.0.1 - it will come up with the first
> of the VirtualHosts. However, if I have 127.0.0.1/test123, Apache
> complains that the URL test123 is not on this.

That request's not making use of virtual hosts, you're asking for a
test123 sub-directory off the default site.  Virtual hosts are when you
have different hostnamed websites on the same IP address.  As far as
browsing them's concerned, they're completely independent websites.

example /etc/hosts file:

  127.0.0.1  localhost.localdomain  localhost  example.com  example.net

example browsing requests:

  http://localhost/
  http://example.com/
  http://example.net/

example Apache configuration sections:

  <VirtualHost *:80>
        ServerName       localhost
        ServerAlias      localhost.localdomain
  # This alias makes this section respond to both hostnames
        UseCanonicalName On
        DocumentRoot     /var/www/virtuals/localhost
  </VirtualHost>

  <VirtualHost *:80>
        ServerName       example.com
        UseCanonicalName On
        DocumentRoot     /var/www/virtuals/example.com
  </VirtualHost>

  <VirtualHost *:80>
        ServerName       example.net
        UseCanonicalName On
        DocumentRoot     /var/www/virtuals/example.net
  </VirtualHost>

NB:  I don't make virtual hosts as sub-directories inside the
default /var/www/html directory, I give them a completely separate path
(as above).  That way you cannot access a different website through one
of the others.  Doing so can allow some devious sidestepping of any
access limitations that you'd applied to a virtual host.

-- 
[tim@bigblack ~]$ uname -ipr
2.6.23.15-80.fc7 i686 i386

Don't send private replies to my address, the mailbox is ignored.
I read messages from the public lists.




-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux