You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Michelle Konzack <li...@freenet.de> on 2004/09/20 14:43:57 UTC
[users@httpd] Re: Virtual Hosts and Document Root
Hello Colin,
Am 2004-09-20 13:33:43, schrieb cw:
> This one should be nice and simple and I'm probably missing something.
Allow Apache to follow symlinks :-)
Greetings
Michelle
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack Apt. 917 ICQ #328449886
50, rue de Soultz MSM LinuxMichi
0033/3/88452356 67100 Strasbourg/France IRC #Debian (irc.icq.com)
Re: [users@httpd] Virtual Hosts and Document Root
Posted by cw <ap...@fidei.co.uk>.
Further to this, after two days of getting nowhere I am no closer to
fixing this.
My entire httpd.conf is added below (minus the bulk of the comments)
incase I've cocked something up elsewhere.
I have also noticed that Apache is dying when sent a kill -HUP rather
than restarting. Is this normal?
#Begin httpd.conf
ServerRoot "/var/www"
#LockFile logs/accept.lock
PidFile logs/httpd.pid
ScoreBoardFile logs/apache_runtime_status
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf
TimeOut 300
KeepAlive on
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 0
#Listen 3000
#Listen 12.34.56.78:80
LoadModule php4_module lib/libphp4.so
LoadModule perl_module lib/mod_perl.so
LoadModule frontpage_module lib/mod_frontpage.so
#ExtendedStatus On
# Section 2: 'Main' server configuration
Port 80
User www
Group www
ServerAdmin email@domain.tld
#ServerName new.host.name
DocumentRoot "/var/www/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/var/www/htdocs">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
UserDir public_html
<Directory /var/www/users/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCGI
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
Order deny,allow
Deny from all
</Limit>
</Directory>
DirectoryIndex index.html index.htm
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</Files>
UseCanonicalName Off
TypesConfig conf/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
HostnameLookups 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
CustomLog logs/access_log combined
#CustomLog logs/referer_log referer
#CustomLog logs/agent_log agent
#CustomLog logs/access_log combined
ServerSignature Off
Alias /icons/ "/var/www/icons/"
<Directory "/var/www/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
IndexOptions FancyIndexing
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
HeaderName HEADER
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
AddEncoding x-compress Z
AddEncoding x-gzip gz
AddLanguage en .en
AddLanguage fr .fr
AddLanguage de .de
AddLanguage da .da
AddLanguage el .el
AddLanguage it .it
LanguagePriority en fr de
AddType application/x-httpd-php .php
AddHandler cgi-script .cgi
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
#
# To enable type maps, you might want to use
#
#AddHandler type-map var
#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
#
# MetaDir: specifies the name of the directory in which Apache can find
# meta information files. These files contain additional HTTP headers
# to include when sending the document
#
#MetaDir .web
#
# MetaSuffix: specifies the file name suffix for the file containing the
# meta information.
#
#MetaSuffix .meta
#
# Customizable error response (Apache style)
# these come in three flavors
#
# 1) plain text
#ErrorDocument 500 "
# n.b. the (") marks it as text, it does not get output
#
# 2) local redirects
#ErrorDocument 404 /missing.html
# to redirect to local URL /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
# N.B.: You can redirect to a script or a document using
server-side-includes.
#
# 3) external redirects
#ErrorDocument 402 http://some.other_server.com/subscription_info.html
# N.B.: Many of the environment variables associated with the original
# request will *not* be available to such a script.
#
# 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 browser implementations.
# 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
#
# Allow server status reports, with the URL of
http://servername/server-status
# Change the ".your_domain.com" to match your domain to enable.
#
#<Location /server-status>
# SetHandler server-status
# Order deny,allow
# Deny from all
# Allow from .your_domain.com
#</Location>
#
# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".your_domain.com" to match your domain to enable.
#
#<Location /server-info>
# SetHandler server-info
# Order deny,allow
# Deny from all
# Allow from .your_domain.com
#</Location>
#
# There have been reports of people trying to abuse an old bug from pre-1.1
# days. This bug involved a CGI script distributed as a part of Apache.
# By uncommenting these lines you can redirect these attacks to a logging
# script on phf.apache.org. Or, you can record them yourself, using the
script
# support/phf_abuse_log.cgi.
#
ServerTokens ProductOnly
#NameVirtualHost 172.168.0.2:80
#NameVirtualHost 0.0.0.0
### Section 3: Virtual Hosts
<VirtualHost 172.168.0.2>
User "#1002"
Group "#1002"
ServerName cluestick.co.uk
ServerAlias www.cluestick.co.uk
DocumentRoot "/var/www/users/cluestick/public_html"
ErrorLog /var/www/users/cluestick/logs/error_log
CustomLog /var/www/users/cluestick/logs/access_log common
ScriptAlias /cgi-bin/ /var/www/users/cluestick/cgi-bin/
<Directory "/var/www/users/cluestick/public_html">
Options Indexes IncludesNOEXEC FollowSymLinks
</Directory>
</VirtualHost>
---------------------------------------------------------------------
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
Re: [users@httpd] Re: Re: Virtual Hosts and Document Root
Posted by cw <ap...@fidei.co.uk>.
Tim Burden wrote:
> I think your UserDir command should look like this:
> UserDir /var/www/users/*/public_html
Already tried that and it makes no difference.
:0/
---------------------------------------------------------------------
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
Re: [users@httpd] Re: Re: Virtual Hosts and Document Root
Posted by Tim Burden <ti...@burden.ca>.
I think your UserDir command should look like this:
UserDir /var/www/users/*/public_html
----- Original Message -----
From: "cw" <ap...@fidei.co.uk>
To: <us...@httpd.apache.org>
Sent: Monday, September 20, 2004 11:17 AM
Subject: Re: [users@httpd] Re: Re: Virtual Hosts and Document Root
> Mine is below.
> I do not believe this to be a problem with allowing symlinks as changing
> the Options to not allow symlinks results in a 403 denied message rather
> than the current 404 not found message.
> It still seems to me to have something to do with the error_log
> recording /users/blah rather than /var/www/users/blah but I don't know
> what.
> Are there any options elsewhere that could be affecting this?
>
>
> # Section 2: 'Main' server configuration
> Port 80
> <IfDefine SSL>
> Listen 80
> Listen 443
> </IfDefine>
>
> User www
> Group www
>
> ServerAdmin xxx@xxx.xxx
>
> DocumentRoot "/var/www/htdocs"
>
> <Directory />
> Options FollowSymLinks
> AllowOverride None
> </Directory>
>
> <Directory "/var/www/htdocs">
>
> Options None
> AllowOverride None
>
> Order allow,deny
> Allow from all
> </Directory>
>
> UserDir /var/www/users
>
> <Directory /var/www/users/*/public_html>
> AllowOverride FileInfo AuthConfig Limit
> Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCGI
> <Limit GET POST OPTIONS PROPFIND>
> Order allow,deny
> Allow from all
> </Limit>
> <Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
> Order deny,allow
> Deny from all
> </Limit>
> </Directory>
>
> ---------------------------------------------------------------------
> 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
>
---------------------------------------------------------------------
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
Re: [users@httpd] Re: Re: Virtual Hosts and Document Root
Posted by cw <ap...@fidei.co.uk>.
Mine is below.
I do not believe this to be a problem with allowing symlinks as changing
the Options to not allow symlinks results in a 403 denied message rather
than the current 404 not found message.
It still seems to me to have something to do with the error_log
recording /users/blah rather than /var/www/users/blah but I don't know
what.
Are there any options elsewhere that could be affecting this?
# Section 2: 'Main' server configuration
Port 80
<IfDefine SSL>
Listen 80
Listen 443
</IfDefine>
User www
Group www
ServerAdmin xxx@xxx.xxx
DocumentRoot "/var/www/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/var/www/htdocs">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
UserDir /var/www/users
<Directory /var/www/users/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCGI
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
Order deny,allow
Deny from all
</Limit>
</Directory>
---------------------------------------------------------------------
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
[users@httpd] Re: Re: Virtual Hosts and Document Root
Posted by Michelle Konzack <li...@freenet.de>.
Am 2004-09-20 14:07:13, schrieb cw:
> Michelle Konzack wrote:
> >Allow Apache to follow symlinks :-)
>
> Thanks for the reply Michelle,
> As far as I am aware, Apache is allowed to follow symlinks, at least the
> default is set to allow it.
> /var/www/users/* has SymLinksIfOwnerMatch as opposed to just
> FollowSymLinks, would that make a difference?
Hmmm, I have:
____ ( '/etc/apache/httpd.conf' ) ____________________________________
/
| ### Section 2: 'Main' server configuration
| Port 80
| User www-data
| Group www-data
| ServerAdmin xxxxxx.xxxxxxx.xxxxx@xxxxxxx.xx
| ServerName xxxxxx.xxxxxxx.xxxxx-xxxxx.xxx
| DocumentRoot /home/ftp/public_html/
|
| <Directory />
| Options SymLinksIfOwnerMatch
| AllowOverride None
| </Directory>
|
| <Directory /home/ftp/public_html/>
| Options Indexes Includes FollowSymLinks MultiViews ExecCGI
| AllowOverride None
| Order allow,deny
| Allow from all
| </Directory>
|
| <IfModule mod_userdir.c>
| UserDir public_html
| </IfModule>
|
| <Directory /home/*/public_html>
| AllowOverride FileInfo AuthConfig Limit
| Options ExecCGI MultiViews Indexes SymLinksIfOwnerMatch Includes
| <Limit GET POST OPTIONS PROPFIND>
| Order allow,deny
| Allow from all
| </Limit>
| <Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
| Order deny,allow
| Deny from all
| </Limit>
| </Directory>
\______________________________________________________________________
It works perfectly for me.
> Regards,
> Colin.
Greetings
Michelle
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack Apt. 917 ICQ #328449886
50, rue de Soultz MSM LinuxMichi
0033/3/88452356 67100 Strasbourg/France IRC #Debian (irc.icq.com)
Re: [users@httpd] Re: Virtual Hosts and Document Root
Posted by cw <ap...@fidei.co.uk>.
cw wrote:
> /var/www/users/* has SymLinksIfOwnerMatch as opposed to just
> FollowSymLinks, would that make a difference?
Gollowing up to myself..
It sort of makes a difference changing "SymLinksIfOwnerMatch" to
"FollowSymLinks".
Now when I request / it puts the following error in error_logs:
"(2)No such file or directory: cannot read directory for multi:
/users/cluestick/public_html/"
For any requests other than / it is the same error as before.
---------------------------------------------------------------------
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
Re: [users@httpd] Re: Virtual Hosts and Document Root
Posted by cw <ap...@fidei.co.uk>.
Michelle Konzack wrote:
> Allow Apache to follow symlinks :-)
Thanks for the reply Michelle,
As far as I am aware, Apache is allowed to follow symlinks, at least the
default is set to allow it.
/var/www/users/* has SymLinksIfOwnerMatch as opposed to just
FollowSymLinks, would that make a difference?
Regards,
Colin.
---------------------------------------------------------------------
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