Homepage selbermachen 7.852 Themen, 35.619 Beiträge

Wie konfiguriere ich den Apache Server um zwei homepages aufrufe

Zwincki / 3 Antworten / Baumansicht Nickles

Hallo,
angenommen ich habe zwei homepages:


www.markus.de   und
www.markus2.de


Ich habe mir den Apache Webserver installiert, um die Seiten offline zu testen. Unter Windows. Wie muß ich die Configurationsdatei (httpd.conf) des Apache Servers konfigurieren, damit ich zum Beispiel folgendes aufrufen kann:


http://localhost/markus/


Damit die index.html von markus ausgeführt wird?


UND:


http://localhost/markus2/


damit die index.html von markus2 ausgeführt wird?


Bisher habe ich unter DocumentRoot folgende Zeilen eingerichtet:


DocumentRoot "c:/perl/htdocs"
DocumentRoot "c:/perl/htdocs/markus"
DocumentRoot "c:/perl/htdocs/markus2"


Bei Eingabe von http:/localhost/ oder http:/localhost/markus wird immer nur die homepage markus ausgeführt. Gebe ich http:/localhost/markus2 ein, dann bekomme ich eine Fehlermeldung.Obwohl es das Verzeichnis ../markus2 gibt.


Ich vermute mal das dieser Eintrag unter DocumentRoot nicht ausreicht. Was muß ich in der httpd.conf ändern, um beide homepages - ohne kopiererei - aufrufen zu können? Denn ich könnte ja auch einfach die homepage Markus löschen und die homepage Markus2 einspielen.


Das ist mir auf Dauer zu viel Arbeit. Deswegen möchte ich beide homepages ohne viel Schnickschnack von http:/localhost/markus oder .../markus2 aufrufen können.


Ich hoffe, jemand hat mich verstanden???????


Hier ein Teil der Datei httpd:


 


### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#


#
# ServerType is either inetd, or standalone.  Inetd mode is only supported on
# Unix platforms.
#
ServerType standalone


#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "c:/perl"


#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile logs/httpd.pid


#
# ScoreBoardFile: File used to store internal server process information.
# Not all architectures require this.  But if yours does (you'll know because
# this file will be  created when you run Apache) then you *must* ensure that
# no two invocations of Apache share the same scoreboard file.
#
ScoreBoardFile logs/apache_runtime_status


#
# In the standard configuration, the server will process httpd.conf (this
# file, specified by the -f command line option), srm.conf, and access.conf
# in that order.  The latter two files are now distributed empty, as it is
# recommended that all directives be kept in a single file for simplicity. 
# The commented-out values below are the built-in defaults.  You can have the
# server ignore these files altogether by using "/dev/null" (for Unix) or
# "nul" (for Win32) for the arguments to the directives.
#
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf


#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300


#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On


#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100


#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15


#
# Apache on Win32 always creates one child process to handle requests.  If it
# dies, another child process is created automatically.  Within the child
# process multiple threads handle incoming requests.  The next two
# directives control the behaviour of the threads and processes.
#


#
# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies.  The child will exit so
# as to avoid problems after prolonged use when Apache (and maybe the
# libraries it uses) leak memory or other resources.  On most systems, this
# isn't really needed, but a few (such as Solaris) do have notable leaks
# in the libraries.  For Win32, set this value to zero (unlimited)
# unless advised otherwise.
#
# NOTE: This value does not include keepalive requests after the initial
#       request per connection. For example, if a child process handles
#       an initial request and 10 subsequent "keptalive" requests, it
#       would only count as 1 request towards this limit.
#
MaxRequestsPerChild 0


#
# Number of concurrent threads (i.e., requests) the server will allow.
# Set this value according to the responsiveness of the server (more
# requests active at once means they're all handled more slowly) and
# the amount of system resources you'll allow the server to consume.
#
ThreadsPerChild 50


#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
#Listen 3000
#Listen 12.34.56.78:80


#
# BindAddress: You can support virtual hosts with this option. This directive
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the <VirtualHost> and Listen directives.
#
#BindAddress *


#
# Apache Modules compiled into the standard Windows build
#
# The following modules are bound into the standard Apache binary distribution
# for Windows.  To change the standard behavior, uncomment the following lines
# and modify the list of those specific modules to be enabled in the server.
#
# WARNING: This is an advanced option that may render your server inoperable!
# Do not use these directives without expert guidance.
#
#ClearModuleList
#AddModule mod_so.c mod_mime.c mod_access.c mod_auth.c mod_negotiation.c
#AddModule mod_include.c mod_autoindex.c mod_dir.c mod_cgi.c mod_userdir.c
#AddModule mod_alias.c mod_env.c mod_log_config.c mod_asis.c mod_imap.c
#AddModule mod_actions.c mod_setenvif.c mod_isapi.c


#
# 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 `apache -l' for the list of already
# built-in (statically linked and thus always available) modules in your Apache
# binary.
#
# Note: The order in which modules are loaded is important.  Don't change
# the order below without expert advice.
#
#LoadModule anon_auth_module modules/ApacheModuleAuthAnon.dll
#LoadModule dbm_auth_module modules/ApacheModuleAuthDBM.dll
#LoadModule digest_auth_module modules/ApacheModuleAuthDigest.dll
#LoadModule cern_meta_module modules/ApacheModuleCERNMeta.dll
#LoadModule digest_module modules/ApacheModuleDigest.dll
#LoadModule expires_module modules/ApacheModuleExpires.dll
#LoadModule headers_module modules/ApacheModuleHeaders.dll
#LoadModule proxy_module modules/ApacheModuleProxy.dll
#LoadModule rewrite_module modules/ApacheModuleRewrite.dll
#LoadModule speling_module modules/ApacheModuleSpeling.dll
#LoadModule info_module modules/ApacheModuleInfo.dll
#LoadModule status_module modules/ApacheModuleStatus.dll
#LoadModule usertrack_module modules/ApacheModuleUserTrack.dll


#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
#ExtendedStatus On


### Section 2: 'Main' server configuration
#ISEXT next 2 lines are need to allow execution of script in the root directory
AddHandler cgi-script .pl
AddHandler cgi-script .cgi
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#


#
# Port: The port to which the standalone server listens.  Certain firewall
# products must be configured before Apache can listen to a specific port.
# Other running httpd servers will also interfere with this port.  Disable
# all firewall, security, and other services if you encounter problems.
# To help diagnose problems use the Windows NT command NETSTAT -a
#
Port 80


#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.
#
ServerAdmin you@your.address


#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
# machine always knows itself by this address. If you use Apache strictly for
# local testing and development, you may use 127.0.0.1 as the server name.
#
#ServerName new.host.name
#ISEXT
ServerName localhost



#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "c:/perl/htdocs"
DocumentRoot "c:/perl/htdocs/markus"
DocumentRoot "c:/perl/htdocs/markus2"
#
# 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).
#
# First, we configure the "default" to be a very restrictive set of
# permissions. 
#
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>


#
# 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.
#


#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "c:/perl/htdocs">


#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
#ISEXT
#    Options Indexes FollowSymLinks MultiViews
    Options Indexes FollowSymLinks MultiViews ExecCGI +Includes


#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
    AllowOverride None


#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all
</Directory>


#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
# Under Win32, we do not currently try to determine the home directory of
# a Windows login, so a format such as that below needs to be used.  See
# the UserDir documentation for details.
#
<IfModule mod_userdir.c>
    UserDir "c:/perl/users/"
</IfModule>


#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
#<Directory "c:/perl/users">
#    AllowOverride FileInfo AuthConfig Limit
#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#    <Limit GET POST OPTIONS PROPFIND>
#        Order allow,deny
#        Allow from all
#    </Limit>
#    <LimitExcept GET POST OPTIONS PROPFIND>
#        Order deny,allow
#        Deny from all
#    </LimitExcept>
#</Directory>


#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
#ISEXT
    #DirectoryIndex index.html
    DirectoryIndex index.html index.shtml index.htm index.php index.php3
</IfModule>


#
# AccessFileName: The name of the file to look for in each directory
# for access control information.
#
AccessFileName .htaccess


#
# The following lines prevent .htaccess files from being viewed by
# Web clients.  Since .htaccess files often contain authorization
# information, access is disallowed for security reasons.  Comment
# these lines out if you want Web visitors to see the contents of
# .htaccess files.  If you change the AccessFileName directive above,
# be sure to make the corresponding changes here.
#
# Also, folks tend to use names such as .htpasswd for password
# files, so this will protect those as well.
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>


#
# CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each
# document that was negotiated on the basis of content. This asks proxy
# servers not to cache the document. Uncommenting the following line disables
# this behavior, and proxies will be allowed to cache the documents.
#
#CacheNegotiatedDocs

bei Antwort benachrichtigen
k.0815 Zwincki „Wie konfiguriere ich den Apache Server um zwei homepages aufrufe“
Optionen

hmm, dann leg dir doch für die neue page n virtuellen server auf nem neuen port an. wenn es nur zu testzwecken ist, sollte das ja keine probleme geben.

bei Antwort benachrichtigen
Zwincki k.0815 „hmm, dann leg dir doch für die neue page n virtuellen server auf nem neuen port...“
Optionen

Ich habe bis jetzt diverse sogenannte Expertenseiten mit ellenlangen Reports über die httpd.conf unter Unix und Windows gelesen.

Aber leider war das nur alles Halbwissen was da vermittelt wurde. Der eine hat vom anderen abgeschrieben - denke ich - und einige haben oder wollten nur dumme nichts sagende webSeiten ins www stellen. Ohne verständlich etwas zu vermitteln.

So nach und nach habe ich jetzt zusammen das ich unter Windows 2000 mit vituellen Host arbeiten könnte. Dazu muß ich die hosts.conf im /system32 korrigieren und was alle verschwiegen haben auch eine Netzwerkkarte installieren damit Windows diverse www`s virtuell verarbeiten kann. Leider habe ich keine!

Jetzt versuche ich gerade was mit batch-Dateien und Dreamweaver hinzujonglieren! Was im Prinzip geht, aber leider mühsam ist.

bei Antwort benachrichtigen
k.0815 Zwincki „Und wie geht das?“
Optionen

hmm, gute frage wie das unter windows geht, mußte es irgendwo n abschnitt in der httpd.conf geben. unter linux kann man das sehr bequem über webmin machen

bei Antwort benachrichtigen