[rhn-users] virtual server setup

Kvetch kvetch at gmail.com
Mon Mar 20 16:18:22 UTC 2006


You don't need the db.hostname file for Apache.
You don't have the document roots setup for your vhosts, so it is defaulting
to your main Apache DocumentRoot nor have you defined the domains each vhost
should listen to.

You will of course need the domains setup in your DNS servers and have them
pointed to your Apache server.  With Apache the main things you need to look
for is something like this

Listen 80

NameVirtualHost *:80    # ------- if you want to have Apache listen on all
IP's assigned on this box
or
NameVirtualHost 192.168.1.3:80   ------  this will make Apache listen on
this IP for some vhosts (defined in the vhost settings).  For example if you
want this domain accessible by the outside world (ignore that I used a
non-routable IP)
NameVirtualHost 10.10.2.1:80 -------- listens on another IP that is only
accessible for folks within your network.

Then just do something like
<VirtualHost 192.168.1.3:80>
         ServerAdmin dlederer at hilltowncharter.org
         DocumentRoot   /var/www/html/site1
         ServerName hilltowncharter.org
         ServerAlias www.hilltowncharter.org
         ErrorLog /path/to/logs/hilltown-error_log
         CustomLog /path/to/logs/hilltown/access combined
</VirtualHost>

<VirtualHost 192.168.1.3:80>
        ServerAdmin dlederer at hilltowncharter.org
        DocumentRoot   /var/www/html/site2
        ServerName www.nationaidsbrigade.org
        ServerAlias nationaidsbrigade.org
        ErrorLog /path/to/logs/nation-error_log
        CustomLog /path/to/logs/nation/access combined
</VirtualHost>

To make a vhost accessible for only your internal network use just change
the
<VirtualHost 192.168.1.3:80> to
<VirtualHost 10.10.2.1:80>

I think it is just easier to just define the DirectoryIndex/ServerSignature
stuff in the main part of httpd.conf not inside the vhost.
Is this site suppose to have a SSL counterpart?  If so you will need to
define that in the ssl.conf and make it listen on 443.  You will also need
to tell httpd.conf to look for the ssl.conf file
Add this
<IfModule mod_ssl.c>
    Include conf/ssl.conf
</IfModule>
So in your SSL.conf use something like this

<VirtualHost 192.168.1.3:443>
        ServerAdmin dlederer at hilltowncharter.org
        DocumentRoot   /var/www/html/site2
        ServerName www.nationaidsbrigade.org
        ServerAlias nationaidsbrigade.org
        ErrorLog /path/to/logs/nation-error_log
        CustomLog /path/to/logs/nation/access combined
        SSLEngine on
        SSLProtocol -ALL +SSLv3 +TLSv1
        SSLCipherSuite
ALL:!aNULL:!ADH:!eNULL:!EXP:RC4+RSA:+HIGH:+MEDIUM
        SSLCertificateFile /path/to/your/ssl/cert/nation.crt
        SSLCertificateKeyFile /path/to/your/ssl/key/.nation.key
        SSLCACertificateFile /path/to/your/ssl/certs/ca-bundle.crt
</VirtualHost>

Good Luck,
Nick Baronian


> Hi,
> what files besides httpd.conf needs to know about virtual servers. My main
server (hilltown) is accessable from the web, my additional virtual servers
are not.
>
> # Virtual host www.hilltowncharter.org
> <VirtualHost *>
>         ServerAdmin dlederer at hilltowncharter.org
>         ServerSignature email
>         DirectoryIndex index.php index.html index.htm index.shtml
>         SSLEngine on
>         LogLevel debug
>         HostNameLookups off
> </VirtualHost>
>
> # Virtual host www.nationaidsbrigade.org <VirtualHost 192.168.1.3>
>         DocumentRoot /var/www/html/nab
>         ServerAdmin dlederer at hilltowncharter.org
>         ServerName www.nationaidsbrigade.org
>         ServerAlias nationaidsbrigade.org
>         ServerSignature email
>         DirectoryIndex index.html index.htm index.shtml </VirtualHost>
>
> On the debian side I know there's db.hostname files, but I cant see the
equivalent for RH, thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/rhn-users/attachments/20060320/3167f80d/attachment.htm>


More information about the rhn-users mailing list