Namebased virtualhost - error 403

Pagina: 1
Acties:

  • TomPé
  • Registratie: Januari 2003
  • Laatst online: 29-01 19:46
Het volgende:

Ik ben bezig om een webserver met apache op te zetten en ga gebruik maken van namebased virtualhosts.

Ik heb apache2 tijdens de installatie van linux laten installeren dus dat moet zoiezo goed zijn.
Vervoglens ben ik via de documentatie van apache de server gaan configureren. Zo zien er mijn config files uit:

De HTTPD.CONF

### Global Environment ######################################################

Include /etc/apache2/uid.conf
Include /etc/apache2/server-tuning.conf
Include /etc/apache2/sysconfig.d/loadmodule.conf
Include /etc/apache2/listen.conf
Include /etc/apache2/mod_log_config.conf
Include /etc/apache2/sysconfig.d/global.conf
Include /etc/apache2/mod_status.conf
Include /etc/apache2/mod_info.conf
Include /etc/apache2/mod_autoindex-defaults.conf

TypesConfig /etc/apache2/mime.types
DefaultType text/plain

Include /etc/apache2/mod_mime-defaults.conf
Include /etc/apache2/errors.conf
Include /etc/apache2/ssl-global.conf

<Directory />
Options None
AllowOverride None
Order deny,allow
Deny from all
</Directory>

AccessFileName .htaccess

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

DirectoryIndex index.html index.htm index.html.var

### 'Main' server configuration #############################################

Include /etc/apache2/default-server.conf

# Another way to include your own files
#
# The file below is generated from /etc/sysconfig/apache2,
# include arbitrary files as named in APACHE_CONF_INCLUDE_FILES and
# APACHE_CONF_INCLUDE_DIRS

Include /etc/apache2/sysconfig.d/include.conf

### Virtual server configuration ############################################

Include /etc/apache2/vhosts.d/vh.conf

Vervogles de belangrijkste files:

De LISTEN.CONF

<IfDefine SSL>
<IfDefine !NOSSL>
<IfModule mod_ssl.c>

Listen 443

</IfModule>
</IfDefine>
</IfDefine>

Listen 213.19.186.66:80
NameVirtualHost 213.19.186.66:80

De DEFAULT_SERVER.CONF

DocumentRoot /sites/srv/www/htdocs

<Directory "/sites/srv/www/htdocs">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Alias /icons/ /usr/share/apache2/icons/

<Directory "/usr/share/apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

ScriptAlias /cgi-bin/ "/sites/srv/www/cgi-bin/"

<Directory "/sites/srv/www/cgi-bin">
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>

<IfModule mod_userdir.c>
UserDir disabled root
Include /etc/apache2/mod_userdir.conf
</IfModule>

Include /etc/apache2/conf.d/*.conf

Include /etc/apache2/conf.d/apache2-manual?conf

En als laatste mijn VH.CONF (de virtualhost file)

<VirtualHost _default_:80>
DocumentRoot "/sites/default80"
</VirtualHost>

<VirtualHost _default_:*>
DocumentRoot "/sites/default"
</VirtualHost>

<VirtualHost 213.19.186.66:80>
DocumentRoot "/sites/linux2"
ServerName linux2.tridsl.nl:80
</VirtualHost>

<VirtualHost 213.19.186.66:80>
DocumentRoot "/sites/utah"
ServerName utah.tridsl.nl
</VirtualHost>


Dit zijn dus mijn config files. Nu werkt het volgende niet: Als ik naar adres linux2.tridsl.nl of utah.tridsl.nl of 213.19.186.66
ga dan krijg ik als foutmelding:

Toegang verboden!
U hebt niet de toestemming om toegang te krijgen tot de gevraagde map. Er is of wel geen index document of de map is beveiligd tegen lezen.

Indien u van oordeel bent dat deze server in fout is, gelieve de webmaster te contacteren.

Error 403
utah.tridsl.nl
Wed Oct 20 13:50:23 2004
Apache/2.0.47 (Linux/SuSE)

Maar haal ik nou alle info uit mijn vh.conf en ga ik naar de bovenstaande adressen dan werkt de server wel
en kom ik bij de adressen in de standaard document root terrecht.

Ik heb alles afgezocht en de hele apache documentatie na gezocht maar kan niks vinden.

Wie kan mij helpen


Alvast bedankt,

Tom Pennings

TomPé


  • SPee
  • Registratie: Oktober 2001
  • Laatst online: 16-02 12:24
Volgens mij verwijzen die _default_ en IP adres naar hetzelfde "virtual host".

Je moet dan een andere naam opgeven.
Dus ipv 192.168.2.2 - pietjepuk als hostname.

Verder kun je ook kijken naar de toegangsrechten op die directory/bestanden.

[edit]
Wat ik ook zie, is verschillende IP adressen. Volgens mij vallen die niet onder aparte virtual hosts, maar als een aparte server. Hij kan standaard maar naar 1 IP luisteren. Wil je dat hij naar meerdere IP luistert, dan moet je apart opgeven dat hij naar die IP's moet luisteren. En daar dan weer een aparte configuratie voor opgeven. Dit is dan niet een andere virtuele host.
Een virtuele host, is bedoelt om de server bereikbaar te maken onder diverse namen. Dus www.jantje.host verwijst naar de directory /www/jantje en toont dat "domein", terwijl www.pietje.host verwijst naar de directory /www/pietje en toont dat "domein".

[ Voor 58% gewijzigd door SPee op 20-10-2004 14:25 ]

let the past be the past.


Verwijderd

Moet default logischerwijs niet achteraan? Dus virtualhost, virtualhost, ..., default?

Ik heb trouwens ook virtualhosts en volgens mij werkte dat niet zo goed als je in de 'global scope' (dus buiten de virtualhost statements) een soort default server opzette.

  • TomPé
  • Registratie: Januari 2003
  • Laatst online: 29-01 19:46
SPee schreef op 20 oktober 2004 @ 14:21:
Volgens mij verwijzen die _default_ en IP adres naar hetzelfde "virtual host".

Je moet dan een andere naam opgeven.
Dus ipv 192.168.2.2 - pietjepuk als hostname.

Verder kun je ook kijken naar de toegangsrechten op die directory/bestanden.

[edit]
Wat ik ook zie, is verschillende IP adressen. Volgens mij vallen die niet onder aparte virtual hosts, maar als een aparte server. Hij kan standaard maar naar 1 IP luisteren. Wil je dat hij naar meerdere IP luistert, dan moet je apart opgeven dat hij naar die IP's moet luisteren. En daar dan weer een aparte configuratie voor opgeven. Dit is dan niet een andere virtuele host.
Een virtuele host, is bedoelt om de server bereikbaar te maken onder diverse namen. Dus www.jantje.host verwijst naar de directory /www/jantje en toont dat "domein", terwijl www.pietje.host verwijst naar de directory /www/pietje en toont dat "domein".
Ik kan jou verhaal niet helemaal volgen;

Volgens mij verwijzen die _default_ en IP adres naar hetzelfde "virtual host". ???

Je moet dan een andere naam opgeven.
Dus ipv 192.168.2.2 - pietjepuk als hostname.

Ik kan geen naam opgeven want dan komt hij met de melding; Invalid adress

Verder weet ik waar virtualhost voor is anders begin ik er ook niet aan he...

TomPé


  • BOOTZ
  • Registratie: Maart 2001
  • Laatst online: 09-02 10:21
1. Je moet zorgen dat apache luistert naar alle IP's die van belang zijn. Dit kan met Bind of met Listen (zoek maar op in de docs)
2. Zet aan het begin van je vhosts.conf (of hoe je die ook noemt) voor elk IP een regel neer: "NameVirtualHost 123.123.123.123:80"
3. Maak je vhosts zoals je in je huidige config gedaan hebt (deze zijn prima, behalve dan dat je bij ServerName niet de poort op hoeft te geven)
4. Zet je default als laatste neer. Soms werkt _default_ niet (bij mij iig), dan kan je altijd nog <VirtualHost 123.123.123.123 456.456.456.456> neerzetten, met als ServerAlias een *, en een kloppende ServerName.

Maak je eigen poll


  • TomPé
  • Registratie: Januari 2003
  • Laatst online: 29-01 19:46
Ik heb nou in listen.conf aangegeven dat hij naar 213.19.186.66:80 moet luisteren, dit is ook het enige ip adres waarnaar hij moet luisteren.

Vervolgens heb ik de poorten bij ServerName weggehaald en de _default_ onderaan geplaatst.

Echter hetzelfde resultaat.

Geef in in de commandline in httpd2 -S krijg ik de volgende info:

VirtualHost configuration:
213.19.186.66:80 is a NameVirtualHost
default server linux2.tridsl.nl (/etc/apache2/vhosts.d/vh.conf:3)
port 80 namevhost linux2.tridsl.nl (/etc/apache2/vhosts.d/vh.conf:3)
port 80 namevhost utah.tridsl.nl (/etc/apache2/vhosts.d/vh.conf:8)
wildcard NameVirtualHosts and _default_ servers:
_default_:80 utah (/etc/apache2/vhosts.d/vh.conf:13)
_default_:* utah (/etc/apache2/vhosts.d/vh.conf:17)
Syntax OK


Volgens mij klopt de 3de regel dan al niet want linux2.tridsl.nl moet helemaal geen default zijn maar juist een virtual host

[ Voor 8% gewijzigd door TomPé op 20-10-2004 14:58 ]

TomPé


Verwijderd

Dat komt denk ik omdat linux2.tridsl.nl de eerste ServerName is die apache tegenkomt.

Probeer de config eens wat op te schonen, want ik vind het er nogal rommelig uitzien. Men neme
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Globaal spul
...
Listen 213.19.186.66:80

# Virtualhosts
NameVirtualHost 213.19.186.66
<Virtualhost 213.19.186.66>
  ServerName blaat
  Vhost-opties
</Virtualhost>
<Virtualhost 213.19.186.66>
  ServerName blaat2
  Vhost-opties
</Virtualhost>
<Virtualhost _default_>
  ServerName blaatenzo
  Default configuratie
</Virtualhost>

En dan verder geen server configuraties in je globale scope zetten.. Overigens hoef je echt niet overal de poorten achter te zetten; bij Listen is dat voldoende.

[ Voor 9% gewijzigd door Verwijderd op 20-10-2004 15:30 ]


  • TomPé
  • Registratie: Januari 2003
  • Laatst online: 29-01 19:46
Ik heb mijn httpd.conf aangepast zodat nu op een paar dingetjes na alles in deze file staat en niet meer zoals mijn oude dat alles in aparte files staat.

Maar ik krijg nog steeds de onderstaande melding als ik naar 1 van mijn virtualhosts ga...?


Forbidden
You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.


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

Apache/2.0.47 (Linux/SuSE) Server at 213.19.186.66 Port 80


Nieuwe httpd.conf is als volgt:

### Global Environment ######################################################
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests.

User wwwrun
Group www

## Server Tuning ##

# preform MPM
<IfModule prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>

# worker MPM
<IfModule worker.c>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
MaxClients 150
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

# leader MPM
<IfModule leader.c>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
MaxClients 150
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

# perchild MPM
<IfModule perchild.c>
NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0

AcceptMutex fcntl
</IfModule>

#metux MPM
<IfModule metuxmpm.c>
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxRequestsPerChild 0

Multiplexer "wwwrun" "www"
</IfModule>

KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15

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


## Load Modules ##

# as listed in APACHE_MODULeS (/etc/sysconfig/apache2)
LoadModule access_module /usr/lib/apache2-prefork/mod_access.so
LoadModule actions_module /usr/lib/apache2-prefork/mod_actions.so
LoadModule alias_module /usr/lib/apache2-prefork/mod_alias.so
LoadModule auth_module /usr/lib/apache2-prefork/mod_auth.so
LoadModule auth_dbm_module /usr/lib/apache2-prefork/mod_auth_dbm.so
LoadModule autoindex_module /usr/lib/apache2-prefork/mod_autoindex.so
LoadModule cgi_module /usr/lib/apache2-prefork/mod_cgi.so
LoadModule dir_module /usr/lib/apache2-prefork/mod_dir.so
LoadModule env_module /usr/lib/apache2-prefork/mod_env.so
LoadModule expires_module /usr/lib/apache2-prefork/mod_expires.so
LoadModule include_module /usr/lib/apache2-prefork/mod_include.so
LoadModule log_config_module /usr/lib/apache2-prefork/mod_log_config.so
LoadModule mime_module /usr/lib/apache2-prefork/mod_mime.so
LoadModule negotiation_module /usr/lib/apache2-prefork/mod_negotiation.so
LoadModule php4_module /usr/lib/apache2-prefork/libphp4.so
LoadModule setenvif_module /usr/lib/apache2-prefork/mod_setenvif.so
LoadModule ssl_module /usr/lib/apache2-prefork/mod_ssl.so
LoadModule suexec_module /usr/lib/apache2-prefork/mod_suexec.so
LoadModule userdir_module /usr/lib/apache2-prefork/mod_userdir.so
LoadModule vhost_alias_module /usr/lib/apache2-prefork/mod_vhost_alias.so


## IP addresses / ports to listen on ##

<IfDefine SSL>
<IfDefine !NOSSL>
<IfModule mod-ssl.c>

Listen 443

</IfModule>
</IfDefine>
</IfDefine>

Listen 213.19.186.66:80


## predefined logging formats ##

# Format string: Nickname

LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
LogFormat "%h %l %u %t \"%r\" %>s %b \
\"%{Referer}i\" \"%{User-Agent}i\"" combined

# To use %I and %O, you need to enable mod_logio

<IfModule mod_logio.c>
LogFormat "%h %l %u %t \"%r\" %>s %b \
\"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>

# Use one of these when you want a compact non-error SSL logfile on a virtual
# host basis:

<IfModule mod_ssl.c>
Logformat "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \
\"%r\" %b" ssl_common
Logformat "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \
\"%r\" %b \"%{Referer}i\" \"%{User-Agent}i\"" ssl_combined
</IfModule>


## generated from global settings in /etc/sysconfig/apache2

Timeout 300
ServerSignature on
ServerName utah
UseCanonicalName off
ServerTokens OS
LogLevel warn
CustomLog /var/log/apache2/access_log combined

## optional mod_status, mod_info

# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status

<IfModule mod_status.c>
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
All from localhost
</Location>
</IfModule>

# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).

<IfModule mod_info.c>
<Location /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from localhost
</Location>
</IfModule>

## configuration of server-generated directory listings

# Directives controlling the display of server-generated directory listings.

<IfModule mod_autoindex.c>

IndexOptions FancyIndexing VersionSort NameWidth=*

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

ReadmeName README.html
HeaderName HEADER.html

IndexIgnore .?* *~ *# HEADEr* RCS CVS *,v *,t

</IfModule>


## associate MIME types with filename extensions

TypesConfig /etc/apache2/mime.types
DefaultType text/plain

## mod_mime configuration

# associate various bits of "meta information" with files by their filename extensions

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-CN .zh-cn
AddLanguage hr .hr

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

AddDefaultCharset UTF-8

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

# not mapped to a specific (iso) standard, but helpful nevertheless:

Addcharset GB2313 .gb2313 .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 image/x-icon .ico

AddHandler type-map var

<IfModule mod-mime.magic.c>
MIMEMagicFile /etc/apache2/magic
</IfModule>


# set up (customizable) error responses

Alias /error/ /usr/share/apache2/error.

<IfModule mod_negotiation.c>
<IfModule mod_include.c>
<Directory "/usr/share/apache2/error">
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_SERIVCE_UNAVAILABLE.html.var
ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
</IfModule>
</IfModule>


# global (server-wide) SSL configuration, that is not specific to
# any virtual host

<IfDefine SSL>
<IfDefine !NOSSL>
<IfModule mod_ssl.c>

AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl

SSLPassPhraseDialog builtin

#SSLSessionCache none
#SSLSessionCache dbm:/var/lib/apache2/ssl_scache
#SSLSessionCache shmht:/var/lib/apache2/ssl_scache(512000)
#SSLSessionCache shmcb:/var/lib/apache2/ssl_scache

SSLSessionCache 600

#SSLMutex file:/var/lib/apache2/ssl_mutex

SSLMutex sem

SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
#SSLRandomSeed startup file:/dev/random 512
#SSLRandomSeed connect file:/dev/random 512
#SSLRandomSeed startup file:/dev/urandom 512
#SSLRandomSeed connect file:/dev/urandom 512

</IfModule>
</IfDefine>
</IfDefine>


# forbid access to the entire filesystem by default

<Directory />
Options None
AllowOverride None
Order deny,allow
Deny from all
</Directory>

# use .htaccess files for overriding,

AccessFileName .htaccess

# and never show them

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

# List of resources to look for when the client requests a directory

DirectoryIndex index.html index.htm index.html.var

### 'Main' server configuration #############################################
#
# 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.
#

DocumentRoot /sites/srv/www/htdocs

# Configure the DocumentRoot

<Directory "/sites/srv/www/htdocs">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Alias /icons/ /usr/share/apache2/icons/

<Directory "/usr/share/apache2/icons">
Options Indexes Multiviews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

ScriptAlias /cgi-bin/ "/sites/srv/www/cgi-bin/"

<Directory "/sites/srv/www/cgi-bin">
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>

<IfModule mod_userdir.c>

UserDir disabled root
Include /etc/apache2/mod_userdir.conf

</IfModule>

Include /etc/apache2/conf.d/*.conf
Include /etc/apache2/conf.d/apache2-manual?conf


# Another way to include your own files
#
# The file below is generated from /etc/sysconfig/apache2,
# include arbitrary files as named in APACHE_CONF_INCLUDE_FILES and
# APACHE_CONF_INCLUDE_DIRS


Include /etc/apache2/sysconfig.d/include.conf


### Virtual server configuration ############################################
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#

NameVirtualHost 213.19.186.66:80

<VirtualHost 213.19.186.66:80>
DocumentRoot "/sites/utah"
ServerName utah.tridsl.nl
</VirtualHost>

<VirtualHost 213.19.186.66:80>
DocumentRoot "/sites/linux2"
ServerName linux2.tridsl.nl
</VirtualHost>

TomPé


  • PowerSp00n
  • Registratie: Februari 2002
  • Laatst online: 17-11-2025

PowerSp00n

There is no spoon

Forbidden
You don't have permission to access / on this server.
Gewoon zorgen dat je apache user dus bij de DocumentRoot kan, of je DirectoryIndex goed instellen, of een index.html plaatsen.

[ Voor 21% gewijzigd door PowerSp00n op 21-10-2004 16:34 ]


  • raymondw
  • Registratie: November 2000
  • Laatst online: 00:05
Misschien ook handiger om te linken naar je conf file ipv het verhaal hier te posten....
Krijg bijna RSI van je post ;)

Plaats om te testen een index.html in je dir en geef iedereen rechten (777) op dat file.

to linux or not ,that's my quest... | 5800X | 32GB 3800C15 | X570-Pro | 980 1TB | 7900XTX | PVoutput | Fiets


Verwijderd

Je hebt een combinatie van twee problemen.
1) apache heeft geen rechten om de directory te lezen - rechten probleem
2) je weet niet precies om welke directory het gaat, je bent namelijk met virtual hosts aan het expirimenteren.

Ik weet niet precies hoe het in de logfiles gerapporteerd wordt, maar het is altijd handig om even het staartje van /var/log/httpd/error_log (of waar het ook bij jou staat) te bekijken. Verder kan ik je aanraden om eerst commentaar-regels van de virtual hosts sectie te maken en kijken of je dan nog rechten problemen hebt. Herstart je apache wel na een config-wijziging. Jje zei dat je de apache van je linux diistributie gebruikte, dus ik neem aan dat er eentje geinstalleerd is. Meerdere installaties van apache kan het erg verwarrend maken. Herstarten kan met apachectl restart, /etc/init.d/httpd restart (of hoe je init.d-scriptje voor apache ook heet).
Pagina: 1