httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Gonzalez <t...@tuxcafe.com>
Subject Re: [users@httpd] VirtualHost (frustrated out of my mind)
Date Thu, 08 Jul 2004 20:59:43 GMT
Hola Avery,() como anda todo?.

Jueves, 08 de Julio de 2004, 03:50:56 p.m., decias algo sobre [users@httpd] VirtualHost (frustrated
out of my mind):

Avery> Could someone please help me I cant get Virtual hosting
Avery> to work right. I have read through all of the documents on
Avery> apache's website plus some other websites hanging around. Thanks.

Avery> I have 5 sites and I want each site to have its own
Avery> webpage. I want these sites to be name based VirtualHosts. I
Avery> have
Avery> defined my 5 domains in my httpd.conf file. I also
Avery> added these 5 domains to my hosts file. Here is the problem, I
Avery> cant
Avery> get each virtual host to use a different index.html
Avery> file. All of the hosts want to use the same index.html file.
Avery> Here
Avery> is the first VirtualHost entry
Avery> ----------------------
Avery> <VirtualHost *>
[snip]
Avery> /var/www/html/domain1.com/index.html.

Avery> I then point my browser to www.domain2.com and I am
Avery> getting the index file from the directory
Avery> /var/www/html/domain1.com Should I be seeing the index
Avery> file from /var/www/html/domain2.com.

well  it's  a simple missconfiguration i see, i have just two viirtual
hosts and i did the same mistake you're doing now.

What  you have to do is to define your main site as a virtual host and
so on with the other sites.

Take a look at my config.

##############################
# Host Virtual de TuxCafe    #
##############################

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin webmaster@tuxcafe.com
    ServerName www.tuxcafe.com:80
    DocumentRoot /www/htdocs/tuxcafe
    ServerAlias tuxcafe.com *.tuxcafe.com
    ErrorLog /var/log/apache/tuxcafe-error_log
    CustomLog /var/log/apache/tuxcafe-access_log common
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"%I %O
" combinedio
    <Location />
    <IfModule mod_deflate.c>
    #compress content with type html, text, and css
       AddOutputFilterByType DEFLATE text/html text/plain text/css
       <IfModule mod_headers.c>
    #properly handle requests coming from behind proxies
       Header append Vary User-Agent
    </IfModule>
    </IfModule>
    </Location>
    <Directory />
      IndexOptions FancyIndexing NameWidth=* FoldersFirst \
      ScanHTMLTitles DescriptionWidth=*
      HeaderName HEADER.html
      ReadmeName README.html
      AllowOverride All FileInfo Indexes AuthConfig
      Options Indexes FollowSymLinks
        # SymLinksIfOwnerMatch
    </Directory>
    <Directory "/admin">
       AllowOverride None
       Options Indexes FollowSymLinks SymLinksIfOwnerMatch
       Order allow,deny
       Allow from all
    </Directory>
    ScriptAlias /cgi-bin "/www/cgi-bin"
    <Directory "/www/cgi-bin">
       AllowOverride None
       Options FollowSymLinks
       Order allow,deny
       Allow from all
    </Directory>
</VirtualHost>

##############################
# Host Virtual de SkyNetBBS!.#
##############################

<VirtualHost *:80>
    ServerAdmin webmaster@skynetbbs.org
    DocumentRoot /www/htdocs/skynet
    ServerAlias skynetbbs.org *.skynetbbs.org
    ServerName www.skynetbbs.org:80
    ErrorLog /var/log/apache/skynet-error_log
    CustomLog /var/log/apache/skynet-access_log common
    <Location />
    <IfModule mod_deflate.c>
    #compress content with type html, text, and css
    AddOutputFilterByType DEFLATE text/html text/plain text/css
    <IfModule mod_headers.c>
    #properly handle requests coming from behind proxies
    Header append Vary User-Agent
    </IfModule>
    </IfModule>
    </Location>
    <Directory />
      IndexOptions FancyIndexing NameWidth=* FoldersFirst \
      ScanHTMLTitles DescriptionWidth=*
      HeaderName HEADER.html
      ReadmeName README.html
      AllowOverride FileInfo Indexes AuthConfig
      Options Indexes SymLinksIfOwnerMatch
    </Directory>
    ScriptAlias /cgi-bin/ "/www/cgi-bin2/"
    <Directory "/www/cgi-bin2">
       AllowOverride None
       Options None
       Order allow,deny
       Allow from all
    </Directory>
</VirtualHost>

I have www.tuxcafe.com and www.skynetbbs.org there're no main sites as
all of them are dfined as virtual hosts name based as you want.

Hope  this  helps,  i'm no expert but it happened to me and that's the
way Apche gurus here helped me sole it.

Luck

-- 
Cordialmente:
David
::: TUXCAFE :::
E-mail:test@tuxcafe.com
DiseƱo Web
Administracion de Redes:
Tel: (571)-565-9995



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message