Virtual hosts

Nair, Murlidharan T mnair at iusb.edu
Mon Sep 18 17:56:40 UTC 2006


 

________________________________

From: redhat-install-list-bounces at redhat.com on behalf of karlp at ourldsfamily.com
Sent: Mon 9/18/2006 9:54 AM
To: Getting started with Red Hat Linux
Subject: Re: Virtual hosts




On Mon, September 18, 2006 2:06 am, Maxim Vexler wrote:
> On 9/18/06, Nair, Murlidharan T <mnair at iusb.edu> wrote:
>>
>>
>> ________________________________
>>
>> From: redhat-install-list-bounces at redhat.com on behalf of Maxim Vexler
>> Sent: Sun 9/17/2006 1:23 PM
>> To: Getting started with Red Hat Linux
>> Subject: Re: Virtual hosts
>>
>>
>>
>> On 9/17/06, Nair, Murlidharan T <mnair at iusb.edu> wrote:
>> >
>> >
>> > I am trying to configure my httpd.conf to specify a virtual host. I have
>> > not done this before. I am getting the following error
>> >
>> > [root at bioinformatics init.d]# ./httpd restart
>> > Stopping httpd:                                            [  OK  ]
>> > Starting httpd: [Sun Sep 17 10:22:55 2006] [error] VirtualHost
>> > _default_:443 -- mixing * ports and non-* ports with a NameVirtualHost
>> > address is not supported, proceeding with undefined results
>> >                                                            [  OK  ]
>> >
>> > Do I have to make an entry in the DNS record, specifying the virtual
>> > host? Its the cname I guess correct?
>> > Let me know if I have goofed up any where.
>> > Cheers ../Murli
>> >
>> >
>> > #httpd.conf is this correct ?
>> > # Virtual host Default Virtual Host
>> > NameVirtualHost *
>> > <VirtualHost *>

This looks better than below.

>> >         ServerName bioinformatics.iusb.edu
>> > # this is what the ip (149.161.64.244) for the machine has been mapped
>> > as
>> >         ServerAlias www.bioinformatics.iusb.edu
>> >         VirtualDocumentRoot /var/www/html
>> >         ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
>> >         ServerSignature email
>> >         DirectoryIndex  index.php index.html index.htm index.shtml
>> >        LogLevel  warn
>> > #       HostNameLookups off
>> > </VirtualHost>
>> >
>> > <VirtualHost *>
>> >     ServerName splice.bioinformatics.iusb.edu
>> >     VirtualDocumentRoot /mnt/webservice/splicehtml
>> >     ScriptAlias /cgi/ "/mnt/webservice/splicecgi-bin/"
>> > <Directory "/mnt/webservice/splicehtml">
>> >         Options Indexes Includes FollowSymLinks
>> >         AllowOverride None
>> >         Allow from all
>> >         Order allow,deny
>> > </Directory>
>> > <Directory "/var/www/icons">
>> >         Options Indexes MultiViews
>> >         AllowOverride None
>> >         Allow from all
>> >         Order allow,deny
>> > </Directory>
>> > <Directory "/mnt/webservice/splicecgi-bin">
>> >         Options ExecCGI
>> >         AllowOverride None
>> >         Allow from all
>> >         Order allow,deny
>> > </Directory>
>> > </VirtualHost>
>> >
>>
>> Hi, Attach my virtual hosts file I am using on my debian server.
>> See if that helps you
>>
>> <<<
>> NameVirtualHost wiki
>>
>> <VirtualHost wiki>
>> ServerName wiki
>> DocumentRoot /var/www/
>> RedirectMatch ^/$ /twiki/bin/view/
>>        <Directory /twiki/>
>>               Options Indexes FollowSymLinks MultiViews
>>               AllowOverride None
>>               Order allow,deny
>>               allow from all
>>              # This directive allows us to have apache2's default start page
>>              # in /apache2-default/, but still have / go to the right place
>>       </Directory>
>> </VirtualHost>
>>
>>
>> NameVirtualHost noc
>>
>> <VirtualHost noc>
>> ServerName noc
>> DocumentRoot /var/www/
>> RedirectMatch ^/$ /otrs/
>> </VirtualHost>
>>
>> NameVirtualHost helpdesk
>>
>> <VirtualHost helpdesk>
>> ServerName helpdesk
>> DocumentRoot /var/www/
>> RedirectMatch ^/$ /otrs/customer.pl
>> </VirtualHost>
>>
>> NameVirtualHost *:80
>> <VirtualHost *>

This is what is causing the problem. You have to have *:80 on both or neither.

DNS doesn't matter in this example. If it's setup and working, I.e:

host wiki...
host IP.ADD.For.wiki

both point to the other, you are good.


Karl





>>        ServerAdmin webmaster at localhost
>>
>>        DocumentRoot /var/www/
>>        <Directory />
>>                Options FollowSymLinks
>>                AllowOverride None
>>        </Directory>
>>        <Directory /var/www/>
>>                Options Indexes FollowSymLinks MultiViews
>>                AllowOverride None
>>                Order allow,deny
>>                allow from all
>>                # This directive allows us to have apache2's default start
>> page
>>                # in /apache2-default/, but still have / go to the right
>> place
>>                RedirectMatch ^/$ /twiki/bin/view/
>>        </Directory>
>>
>>        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
>>        <Directory "/usr/lib/cgi-bin">
>>                AllowOverride None
>>                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
>>                Order allow,deny
>>                Allow from all
>>        </Directory>
>>
>>        ErrorLog /var/log/apache2/error.log
>>
>>        # Possible values include: debug, info, notice, warn, error, crit,
>>        # alert, emerg.
>>        LogLevel warn
>>
>>        CustomLog /var/log/apache2/access.log combined
>>        ServerSignature On
>>
>>    Alias /doc/ "/usr/share/doc/"
>>    <Directory "/usr/share/doc/">
>>        Options Indexes MultiViews FollowSymLinks
>>        AllowOverride None
>>        Order deny,allow
>>        Deny from all
>>        Allow from 127.0.0.0/255.0.0.0 ::1/128
>>    </Directory>
>>
>> </VirtualHost>
>> >>>
>>
>>
>> --
>> Cheers,
>> Maxim Vexler
>>
>> I presume your main server is wiki correct? do you have two installations of
>> Apache?  Also do you have the virtual host as one of the DNS records ?
>>
>> Thanks ../Murli
>>
>>
>
> Yes, wiki is the main server.
> The is only a single instance of the Apache daemon running.
>
> otrs it CNAME in the DNS.
> This server is in the internal network that why you are not seeing
> fqdn dns names.
>



Here the my updated httpd.conf and I am still not able to get it to work. I am getting errors regarding permissions. Check http://splice.bioinformatics.iusb.edu 

I checked the permission on all the directoris and file they are all 755. I have to mention here that the docment root for the virtual host splice.bioinformatics.iusb.edu is on a storage array. Is there anything special that I need to do in that case.

Thanks ../Murli

 

   
#
# Virtual hosts
#

# Virtual host Default Virtual Host
NameVirtualHost *:80
<VirtualHost *:80>
 
        ServerName bioinformatics.iusb.edu
        VirtualDocumentRoot /var/www/html
        ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
          ServerSignature email
        DirectoryIndex  index.php index.html index.htm index.shtml 

        LogLevel  warn
#       HostNameLookups off

</VirtualHost>

<VirtualHost *:80>
    ServerName splice.bioinformatics.iusb.edu
    VirtualDocumentRoot /mnt/webservice/splicehtml
    ScriptAlias /cgi/ "/mnt/webservice/splicecgi-bin/"
    ErrorLog "/var/log/httpd/error_log"
    DirectoryIndex  index.php index.html index.htm index.shtml 

<Directory "/mnt/webservice/splicehtml">
        Options Indexes Includes FollowSymLinks
        AllowOverride None
        Allow from all
        Order allow,deny
</Directory>

<Directory "/var/www/icons">
        Options Indexes MultiViews
        AllowOverride None
        Allow from all
        Order allow,deny
</Directory>

<Directory "/mnt/webservice/splicecgi-bin">
        Options ExecCGI
        AllowOverride None
        Allow from all
        Order allow,deny
</Directory>
</VirtualHost>

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories). 
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

<Directory "/">
        Options FollowSymLinks
        
      AllowOverride None
</Directory>

<Directory "/var/www/html">
        Options Indexes Includes FollowSymLinks
        
        AllowOverride None
        Allow from all


        Order allow,deny
</Directory>

<Directory "/var/www/icons">
        Options Indexes MultiViews
        
        AllowOverride None
        Allow from all

        
        Order allow,deny
</Directory>

<Directory "/var/www/cgi-bin">
        Options ExecCGI
        
        AllowOverride None
        Allow from all

        
        Order allow,deny
</Directory>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 18342 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/redhat-install-list/attachments/20060918/24f9d5da/attachment.bin>


More information about the Redhat-install-list mailing list