/ Forside / Teknologi / Operativsystemer / Linux / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
Linux
#NavnPoint
o.v.n. 11177
peque 7911
dk 4814
e.c 2359
Uranus 1334
emesen 1334
stone47 1307
linuxrules 1214
Octon 1100
10  BjarneD 875
Apache og flere hosts
Fra : John Hinge


Dato : 17-04-02 22:59

Hej, jeg prøver at køre flere domæner på en Apache 1.3.23 på
en rødhætte 7.2
Men uanset hvilket domænenavn jeg tilgår, så er det det samme
domæne der dukker op i browseren :(

her er hvad jeg *troede* min conf sku gøre :
browsere som spørger efter : www.spoon.adsl.dk
sku se de ting som ligger i /var/www/html/

browsere som spørger efter : www.adogd.dk
sku se de ting som ligger i /var/www/adogd

her følger min httpd.conf, i håbet om at nogen kan gennemskue hvor det
er jeg dummer mig


## httpd.conf - configuration for the Apache web server
#
# Generated automatically... if you edit manually, the changes will be
# lost
# the next time you run "apacheconfig".
#
# What we listen to
#
ServerRoot /etc/httpd/

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a
# DSO you
# have to place corresponding `LoadModule' lines at this location so
# the
# directives contained in it are actually available _before_ they are
# used.
# Please read the file README.DSO in the Apache 1.3 distribution for
# more
# details about the DSO mechanism and run `httpd -l' for the list of
# already
# built-in (statically linked and thus always available) modules in
# your httpd
# binary.
#
# Note: The order is which modules are loaded is important. Don't
# change
# the order below without expert advice.
#
# Example:
# LoadModule foo_module modules/mod_foo.so

LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule env_module modules/mod_env.so
LoadModule config_log_module modules/mod_log_config.so
LoadModule agent_log_module modules/mod_log_agent.so
LoadModule referer_log_module modules/mod_log_referer.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule status_module modules/mod_status.so
LoadModule info_module modules/mod_info.so
LoadModule includes_module modules/mod_include.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule asis_module modules/mod_asis.so
LoadModule imap_module modules/mod_imap.so
LoadModule action_module modules/mod_actions.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule anon_auth_module modules/mod_auth_anon.so
LoadModule db_auth_module modules/mod_auth_db.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule setenvif_module modules/mod_setenvif.so
<IfDefine HAVE_PERL>
LoadModule perl_module modules/libperl.so
</IfDefine>
<IfDefine HAVE_PHP>
LoadModule php_module modules/mod_php.so
</IfDefine>
<IfDefine HAVE_PHP3>
LoadModule php3_module modules/libphp3.so
</IfDefine>
<IfDefine HAVE_PHP4>
LoadModule php4_module modules/libphp4.so
</IfDefine>
<IfDefine HAVE_DAV>
LoadModule dav_module modules/libdav.so
</IfDefine>
<IfDefine HAVE_ROAMING>
LoadModule roaming_module modules/mod_roaming.so
</IfDefine>

# Reconstruction of the complete module list from all available
# modules
# (static and shared ones) to achieve correct module execution order.
# [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
ClearModuleList
AddModule mod_vhost_alias.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_log_agent.c
AddModule mod_log_referer.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_auth_anon.c
AddModule mod_auth_db.c
AddModule mod_expires.c
AddModule mod_headers.c
AddModule mod_so.c
AddModule mod_setenvif.c
<IfDefine HAVE_PERL>
AddModule mod_perl.c
</IfDefine>
<IfDefine HAVE_PHP>
AddModule mod_php.c
</IfDefine>
<IfDefine HAVE_PHP3>
AddModule mod_php3.c
</IfDefine>
<IfDefine HAVE_PHP4>
AddModule mod_php4.c
</IfDefine>
<IfDefine HAVE_DAV>
AddModule mod_dav.c
</IfDefine>
<IfDefine HAVE_ROAMING>
AddModule mod_roaming.c
</IfDefine>

ServerName spoon.adsl.dk

ServerAdmin sidekick@nntp.dk

Listen *:80

Port 80

ScoreBoardFile /var/run/httpd.scoreboard


# Where do we put the lock and pif files?
LockFile /var/lock/httpd.lock
PidFile /var/run/httpd.pid
CoreDumpDirectory "/etc/httpd"

# Documents
DocumentRoot /var/www/html
UserDir public_html
IndexOptions FancyIndexing


# Who runs the server?
User apache
Group apache

# Performance parameters
MaxClients 150
TimeOut 300
KeepAlive false
MaxKeepAliveRequests 100
MaxRequestsPerChild 100
KeepAliveTimeout 15
MinSpareServers 2
MaxSpareServers 4
StartServers 2

# Error documents



# Misc


AccessFileName .htaccess
#UseCanonicalName on
UseCanonicalName off
TypesConfig /etc/mime.types
DefaultType "text/plain"


# Defaults for virtual hosts
ServerSignature on

# Logs

ErrorLog /var/log/httpd/error_log

LogLevel warn

HostNameLookups Off


# Need to fix this
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-
Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog /var/log/httpd/access_log combined

Alias /icons/ "/var/www/icons/"

#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client.
# The same rules about trailing "/" apply to ScriptAlias directives as
# to
# Alias.
#
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/var/www/cgi-bin">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

#
# FancyIndexing: whether you want fancy directory indexing or standard
#
IndexOptions FancyIndexing

#
# AddIcon* directives tell the server which icon to show for different
# files or filename extensions. These are only displayed for
# FancyIndexed directories.
#
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

#
# DefaultIcon: which icon to show for files which do not have an icon
# explicitly set.
#
DefaultIcon /icons/unknown.gif

#
# ReadmeName: the name of the README file the server will look for by
# default, and append to directory listings.
#
# HeaderName: the name of a file which should be prepended to
# directory indexes.
#
# The server will first look for name.html and include it if found.
# If name.html doesn't exist, the server will then look for name.txt
# and include it as plaintext if found.
#
ReadmeName README
HeaderName HEADER

#
# IndexIgnore: a set of filenames which directory indexing should
# ignore
# and not include in the listing. Shell-style wildcarding is
# permitted.
#
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

#
# AddEncoding: allows you to have certain browsers (Mosaic/X 2.1+)
# uncompress
# information on the fly. Note: Not all browsers support this.
# Despite the name similarity, the following Add* directives have
# nothing
# to do with the FancyIndexing customization directives above.
#
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz

#
# AddLanguage: allows you to specify the language of a document. You
# can
# then use content negotiation to give a browser a file in a language
# it can understand. Note that the suffix does not have to be the same
# as the language keyword --- those with documents in Polish (whose
# net-standard language code is pl) may wish to use "AddLanguage pl
# .po"
# to avoid the ambiguity with the common suffix for perl scripts.
#
AddLanguage en .en
AddLanguage fr .fr
AddLanguage de .de
AddLanguage da .da
AddLanguage el .el
AddLanguage it .it

#
# LanguagePriority: allows you to give precedence to some languages
# in case of a tie during content negotiation.
# Just list the languages in decreasing order of preference.
#
LanguagePriority en fr de

#
# AddType: allows you to tweak mime.types without actually editing it,
# or to
# make certain files to be certain types.
#
# The following is for PHP4 (conficts with PHP/FI, below):
<IfModule mod_php4.c>
AddType application/x-httpd-php .php4 .php3 .phtml .php
AddType application/x-httpd-php-source .phps
</IfModule>

# The following is for PHP3:
<IfModule mod_php3.c>
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
</IfModule>

# The following is for PHP/FI (PHP2):
<IfModule mod_php.c>
AddType application/x-httpd-php .phtml
</IfModule>

AddType application/x-tar .tgz

#
# AddHandler: allows you to map certain file extensions to "handlers",
# actions unrelated to filetype. These can be either built into the
# server
# or added with the Action command (see below)
#
# If you want to use server side includes, or CGI outside
# ScriptAliased directories, uncomment the following lines.
#
# To use CGI scripts:
#
#AddHandler cgi-script .cgi

#
# To use server-parsed HTML files
#
AddType text/html .shtml
AddHandler server-parsed .shtml

#
# Uncomment the following line to enable Apache's send-asis HTTP file
# feature
#
#AddHandler send-as-is asis

#
# If you wish to use server-parsed imagemap files, use
#
AddHandler imap-file map

#
# The following directives modify normal HTTP response behavior.
# The first directive disables keepalive for Netscape 2.x and browsers
# that
# spoof it. There are known problems with these browserimplementations.
# The second directive is for Microsoft Internet Explorer 4.0b2
# which has a broken HTTP/1.1 implementation and does not properly
# support keepalive when it is used on 301 or 302 (redirect) responses.
#
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-
1.0

#
# The following directive disables HTTP/1.1 responses to browsers which
# are in violation of the HTTP/1.0 spec by not being able to grok a
# basic 1.1 response.
#
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0


# If the perl module is installed, this will be enabled.
<IfModule mod_perl.c>
Alias /perl/ /var/www/perl/
<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>
</IfModule>


# Allow access to local system documentation from localhost
Alias /doc/ /usr/share/doc/
<Location /doc>
order deny,allow
deny from all
allow from localhost
Options Indexes FollowSymLinks
</Location>


# Virtual hosts
# Virtual host Default Virtual Host
<VirtualHost _default_:*>
   ServerName _default_
   ServerSignature email
   DirectoryIndex index.php index.html index.htm index.shtml
   ServerSignature email
   LogLevel warn
   HostNameLookups off
</VirtualHost>

<VirtualHost www.adogd.dk>
ServerAdmin sidekick@nntp.dk
DocumentRoot /var/www/adogd
ServerName www.adogd.dk
ServerAlias *.adogd.dk
</VirtualHost>

<VirtualHost *>
   ServerName www.spoon.dvd-klub.dk
   DocumentRoot /var/www/html/usage
</VirtualHost>


# Directories...

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

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

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

<Directory "/var/www/cgi-bin">
   Options ExecCGI
   AllowOverride None
   Allow from from all
   Order allow,deny
</Directory>
ServerTokens OS


--
John Hinge - shayera / .sPOOn.
On usenet I represent no one but myself.
"Buffy I love you...... Oh God No!" Spike, Buffy tVs
http://www.spoon.dvd-klub.dk

 
 
Peter Makholm (17-04-2002)
Kommentar
Fra : Peter Makholm


Dato : 17-04-02 23:08

John Hinge <sidekick_gimmenospam_@nntp.dk> writes:

> her følger min httpd.conf, i håbet om at nogen kan gennemskue hvor det
> er jeg dummer mig

Du kan ikke bruge domænenavne i <VirtualHost>-linjerne, der skal stå
IP-adresser (eventuelt *)

--
Emacs er det eneste moderne styresystem der ikke er multitrådet.

Jacob Bunk Nielsen (17-04-2002)
Kommentar
Fra : Jacob Bunk Nielsen


Dato : 17-04-02 23:26

John Hinge <sidekick_gimmenospam_@nntp.dk> writes:

> Hej, jeg prøver at køre flere domæner på en Apache 1.3.23 på
> en rødhætte 7.2
> Men uanset hvilket domænenavn jeg tilgår, så er det det samme
> domæne der dukker op i browseren :(

Det ser ud som om du mangler en:

NameVirtualHost *

i din httpd.conf.

--
Jacob - www.bunk.cc
No amount of careful planning will ever replace dumb luck.

John Hinge (18-04-2002)
Kommentar
Fra : John Hinge


Dato : 18-04-02 12:00

On 18 apr 2002 Jacob Bunk Nielsen was heard to say:

> John Hinge <sidekick_gimmenospam_@nntp.dk> writes:
>
>> Hej, jeg prøver at køre flere domæner på en Apache 1.3.23 på
>> en rødhætte 7.2
>> Men uanset hvilket domænenavn jeg tilgår, så er det det samme
>> domæne der dukker op i browseren :(
>
> Det ser ud som om du mangler en:
>
> NameVirtualHost *
>
> i din httpd.conf.
>
Det gjorde jeg sørme også.. doh!
Og så sku jeg lige rette i mine <VirtualHost blabla>
hvor blabla ifølge apache docsene sku være * istedet..
nu kører det tilsyneladende
Apache docsene er min ven, men den med NameVirtualHost
havde jeg totalt svedt ud.. pænt tak :)


--
John Hinge - shayera / .sPOOn.
On usenet I represent no one but myself.
"Buffy I love you...... Oh God No!" Spike, Buffy tVs
http://www.spoon.dvd-klub.dk

Søg
Reklame
Statistik
Spørgsmål : 177557
Tips : 31968
Nyheder : 719565
Indlæg : 6408878
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste