Google Grupper har inte längre stöd för nya Usenet-inlägg eller -prenumerationer. Historiskt innehåll förblir synligt.
Stäng

LOOK HERE NEWBIES...apache win32 config help ..

0 visningar
Hoppa till det första olästa meddelandet

Lindis

oläst,
4 juli 2003 20:11:352003-07-04
till
This is a how-to doc for httpd.conf , fully working apache 2.0.45< -
win32 server ..

This config is made for internet connection with a static IP address
for instance > ? 123.xx.xxx.xxx ? and apache server listening at port
80 ..
And running on Ms-Windows XP Home Edition .. and after u installed
apache
on ur computer either by default path or by your own choice of install
dir path.
And choosen to start apache as service ? easiest way.. u can then
choose to let windows start apache auto or start it manually trough
apache monitor utility ..

to access apache server you can use the IP address or get yourself an
free
web redirect service that will redirect the web domain that u get from
that service for instance > ? www.someurl.get.there.com = ?your IPnr
..?123.xx.xxx.xxx?. .. there are numerous of these services ..

I also made changes in my ?HOST? file in
?c:\windows\system32\drivers\etc\?

Looks something like this..this one is in swedish ..urs can be in
english depending on installed os version .. if u cant find any ?HOST?
file just make one
that looks like this and place it in same dir ..
-----------------------------------------------------------------------------------------------

# Copyright (c) 1993-1999 Microsoft Corp.
#
# Det här är HOSTS-exempelfilen som används av Microsoft TCP/IP för
Windows.
#
# Den här filen innehåller mappningar av IP-adresser till värdnamn. Du
bör
# inte ange fler än en post per rad. IP-adressen bör anges
# i den första kolumnen och följas av motsvarande värddatornamn.
# IP-adressen och värdnamnet måste åtskiljas av minst ett blanksteg.
#
# Kommentarer (som dessa) kan infogas på en egen rad eller
# efter ett datornamn. Kommentarer måste föregås av tecknet #.
#
# Till exempel:
#
# 102.54.94.97 rhino.acme.com # källserver
# 38.25.63.10 x.acme.com # klientvärddatorn x

127.0.0.1 localhost
123.xx.xxx.xxx billgates.doesnt.know.it
123.xx.xxx.xxx billgates.crashes.a.lot.com

-------------------------------------------------------------------------------------------------

Ok that was that .. next issue .. configuring the apache httpd.conf
file that are located by default install path > c:\program
files\apache2\conf\httpd.conf < ..

here is my configuration .. that can me altered to fit ur needs .. but
its fully working on my computer .. after weeks of total brain
disorder and lots of
looking in http://groups.google.com/groups?hl=sv&lr=&ie=UTF-8&group=comp.infosystems.www.servers.ms-windows
?. And lots of help
from a superb help site for all kinds of computer related problems ..
http://www.experts-exchange.com/Web/Web_Servers/Apache/ ?.
Many thanks to my helping apache guru > Samri ?.
Well here is my stripped version of httpd.conf file ?.
-------------------------------------------------------------------------------------------------

#my stripped httpd.conf

### Section 1: Global Environment


ServerRoot "e:/Apache2"

#

#ScoreBoardFile logs/apache_runtime_status

#
PidFile logs/httpd.pid

#
Timeout 300

#
KeepAlive On
#
#
MaxKeepAliveRequests 100
#
#
KeepAliveTimeout 15

##
## Server-Pool Size Regulation (MPM specific)
##

<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild 0
</IfModule>

#
#
Listen 123.xx.xxx.xxx:80
#Listen localhost:8080
#
#
LoadModule access_module modules/mod_access.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_module modules/mod_auth.so
#LoadModule auth_anon_module modules/mod_auth_anon.so
#LoadModule auth_dbm_module modules/mod_auth_dbm.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
LoadModule imap_module modules/mod_imap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule ssl_module modules/mod_ssl.so
#LoadModule php4_module e:/apache2/php/php4ts.dll
#

#ExtendedStatus On

### Section 2: 'Main' server configuration
#
#
ServerAdmin lind...@hotmail.com

#
ServerName www.somedomain.com:80

#
UseCanonicalName Off

#
DocumentRoot "e:/Apache2/htdocs"

<Directory />
Options -indexes FollowSymLinks
AllowOverride none
</Directory>
#
<Directory "e:/Apache2/htdocs">

Options -Indexes FollowSymLinks ExecCGI multiviews

AllowOverride none

Order allow,deny

allow from all
</Directory>
#
#main dir
<Directory "e:/apache2/htdocs/site1">
Options Indexes FollowSymLinks MultiViews
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
#
#guest dir
<Directory "e:/apache2/htdocs/site2">
Options Indexes FollowSymLinks MultiViews
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
#

#
#UserDir "C:/WinNT/profiles/*/My Documents/My Website"

#
#
#<Directory "C:\Documents and Settings\user\My documents\">
# 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 index.html index.html.var index.php default.php
main.php

#
#
AccessFileName .htaccess

#
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>

#
# This is for stupid IIS attacks...
RedirectMatch /scripts/
http://localhost/scripts/..%c1%2f../winnt/system32/cmd.exe?/c+dir
RedirectMatch /c/ http://localhost/c/winnt/system32/cmd.exe?/c+dir
RedirectMatch /d/ http://localhost/d/winnt/system32/cmd.exe?/c+dir
RedirectMatch /_vti_bin/
http://localhost/_vti_bin/..%255c../..%255c../..%255c/winnt/system32/cmd.exe?/c+dir
RedirectMatch /_mem_bin/
http://localhost/_mem_bin/..%255c../..%255c../..%255c/winnt/system32/cmd.exe?/c+dir
RedirectMatch /msadc/ http://localhost/MSADC/root.exe?/c+dir
RedirectMatch /MSADC/ http://localhost/MSADC/root.exe?/c+dir
#
#
TypesConfig conf/mime.types

#
#
DefaultType text/plain

#
#
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>

#
#
HostnameLookups On

#
#
#EnableMMAP off

#
#EnableSendfile off

#
#
ErrorLog logs/error.log

#
#
LogLevel warn

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

# You need to enable mod_logio.c to use %I and %O
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\" %I %O" combinedio

#
#
CustomLog logs/access.log common

#
#
#CustomLog logs/referer.log referer
#CustomLog logs/agent.log agent

#
#
#CustomLog logs/access.log combined

#
#
ServerTokens Full

#
#
ServerSignature On

#
#
Alias /icons/ "e:/Apache2/icons/"

<Directory "e:/Apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

#
#
Alias /manual/ "e:/Apache2/manual"

<Directory "e:/Apache2/manual">
Options Indexes FollowSymLinks MultiViews IncludesNoExec
AddOutputFilter Includes html
AllowOverride None
Order allow,deny
Allow from all
</Directory>

#
#
ScriptAlias /cgi-bin/ "e:/Apache2/cgi-bin/"
ScriptAlias /php/ "e:/Apache2/php/"
#
#
<Directory "e:/Apache2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>


#
# Example:
# Redirect permanent /foo http://www.example.com/bar

#
IndexOptions FancyIndexing VersionSort

#
#
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 /icons/unknown.gif

#
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz

#
ReadmeName README.html
HeaderName HEADER.html

#
#
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

#
#
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz

#
#
# DefaultLanguage nl
#
#
# Danish (da) - Dutch (nl) - English (en) - Estonian (et)
# French (fr) - German (de) - Greek-Modern (el)
# Italian (it) - Norwegian (no) - Norwegian Nynorsk (nn) - Korean (ko)
# Portugese (pt) - Luxembourgeois* (ltz)
# Spanish (es) - Swedish (sv) - Catalan (ca) - Czech(cs)
# Polish (pl) - Brazilian Portuguese (pt-br) - Japanese (ja)
# Russian (ru) - Croatian (hr)
#
AddLanguage da .dk
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .et
AddLanguage fr .fr
AddLanguage de .de
AddLanguage he .he
AddLanguage el .el
AddLanguage it .it
AddLanguage ja .ja
AddLanguage pl .po
AddLanguage ko .ko
AddLanguage pt .pt
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pt-br .pt-br
AddLanguage ltz .ltz
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .sv
AddLanguage cs .cz .cs
AddLanguage ru .ru
AddLanguage zh-TW .zh-tw
AddLanguage hr .hr

#
#
LanguagePriority en sv no da nl et fr de el it ja ko pl pt pt-br ltz
ca es tw

#
#
ForceLanguagePriority Prefer Fallback

#
#
AddDefaultCharset ISO-8859-1

#
#
AddCharset ISO-8859-1 .iso8859-1 .latin1
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
AddCharset ISO-8859-3 .iso8859-3 .latin3
AddCharset ISO-8859-4 .iso8859-4 .latin4
AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru
AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb
AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk
AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb
AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5 .Big5 .big5
# For russian, more than one charset is used (depends on client,
mostly):
AddCharset WINDOWS-1251 .cp-1251 .win-1251
AddCharset CP866 .cp866
AddCharset KOI8-r .koi8-r .koi8-ru
AddCharset KOI8-ru .koi8-uk .ua
AddCharset ISO-10646-UCS-2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-8 .utf8

#
AddCharset GB2312 .gb2312 .gb
AddCharset utf-7 .utf7
AddCharset utf-8 .utf8
AddCharset big5 .big5 .b5
AddCharset EUC-TW .euc-tw
AddCharset EUC-JP .euc-jp
AddCharset EUC-KR .euc-kr
AddCharset shift_jis .sjis

#
#
AddType application/x-tar .tgz
AddType application/x-httpd-php .php
AddType image/x-icon .ico

#
#
AddHandler cgi-script .cgi

#
#
#AddHandler send-as-is asis

#
#AddHandler imap-file map

#
#
AddHandler type-map var

#
#
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml

#
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
Action application/x-httpd-php "/php/php.exe"
#
#

#
#
# Alias /error/include/ "/your/include/path/"
#
# Alias /error/ "@exp_errordir@/"
#
# <Directory "@exp_errordir@">
# AllowOverride None
# Options IncludesNoExec
# AddOutputFilter Includes html
# AddHandler type-map var
# Order allow,deny
# Allow from all
# LanguagePriority en cs de es fr it nl sv pt-br ro
# ForceLanguagePriority Prefer Fallback
# </Directory>
#
ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
ErrorDocument 410 /error/HTTP_GONE.html.var
ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var

#
#
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0
force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

#
#
BrowserMatch "Microsoft Data Access Internet Publishing Provider"
redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
BrowserMatch "^gnome-vfs" redirect-carefully

#
#
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 123.xx.xxx.xxx
</Location>
#
#
#<Location /server-info>
# SetHandler server-info
# Order deny,allow
# Deny from all
# Allow from 123.xx.xxx.xxx
#</Location>

#
#
#<IfModule mod_proxy.c>
#ProxyRequests On
#
#<Proxy *>
# Order deny,allow
# Deny from all
# Allow from .example.com
#</Proxy>

#
#
#ProxyVia On

#
#
#CacheRoot "E:/Apache2/proxy"
#CacheSize 5
#CacheGcInterval 4
#CacheMaxExpire 24
#CacheLastModifiedFactor 0.1
#CacheDefaultExpire 1
#NoCache a-domain.com another-domain.edu joes.garage-sale.com

#</IfModule>
# End of proxy directives.

#
# Bring in additional module-specific configurations
#
<IfModule mod_ssl.c>
Include conf/ssl.conf
</IfModule>


### Section 3: Virtual Hosts

#
NameVirtualHost *

# root
<VirtualHost *>
DocumentRoot "e:/apache2/htdocs"
</VirtualHost>

# Main (site1)
<VirtualHost *>
ServerName www.somedomain.com
DocumentRoot "e:/apache2/htdocs/site1"
</VirtualHost>

# guest (Site2)
<VirtualHost *>
ServerName www.somedomain.otherthanfirst.com
DocumentRoot "e:/apache2/htdocs/site1"
</VirtualHost>
#
#end of httpd.conf

------------------------------------------------------------------------------------------------
well that was that ... hope this helps someone out ...

In the doc root dir (*root) i use one index.php page or u can use just
an index.htm html page that tells anyone accessing my computer trough
IP address
in big text to "GET LOST" "U HAVE NOTHING TO FIND HERE" ...

In my main page (site1) i have an .htaccess file that looks like this
...

-------------------------------------------------------------------------

AuthUserFile /apache2/users/.htmain *this entry points to where the
.htpasswd file is located .. *
AuthName my webserver main site
AuthType Basic

require user admin
require user my_trusted_friend

-------------------------------------------------------------------------

And in guest site (site2) i have an .htaccess file that looks like
this ....

--------------------------------------------------------------------------

AuthUserFile /apache2/users/.htguest *this entry points to where the
.htpasswd file is located .. *
AuthName my webserver guest site
AuthType Basic

require user guest

---------------------------------------------------------------------------

ps. the text... - *this entry points to where the .htpasswd file is
located .. * -
must be deleted in the actual .htaccess file ..

the .htpasswd file can look something like this ..and are located in
my configs at "e:/apache2/users/.htmain"
And are made by using the password maker utility in
apache2\bin\htpasswd.exe ,
type this in to a dos-command interpreter window: htpasswd -cmd
/Apache2/users/.htpasswd xxxxx
xxxxx = name of user , then follow the instructions on screen ..
finished ..

ps.. u must be located in the same dir as the htpasswd.exe with
command prompt .. for instance > e:\apace2\bin\:>
after that enter the lines above .. htpasswd -cmd
/apache/users/.htpasswd xxxxx
----------------------------------------------------------------------------

admin:$apr1$sZ4.....$bJebTWHSsBdykryf664dr.
my_trusted_friend:$apr1$eO2.....$131n9CbghxqEmwNfSUH4C1


----------------------------------------------------------------------------

that was that ... a fully working apache win32 server config vers
2.0.45 and up ..im running 2.0.46 ..
I really hope this can help someone that are totally new to apache web
server configurating as i was
and still are ... :) ... but im learning more and more everyday ..

rock on .... greets from Lindis kiruna sweden .. email:
lind...@hotmail.com

Lindis

oläst,
5 juli 2003 05:03:402003-07-05
till
An error was found .!! in line # guest (Site2) the line > DocumentRoot
"e:/apache2/htdocs/site1" should be > DocumentRoot
"e:/apache2/htdocs/site2 "

ok .. bye bye ..greets lindis

0 nya meddelanden