Item8762: 500 Internal Server Error

pencil
Priority: Low
Current State: No Action Required
Released In:
Target Release: n/a
Applies To: SomethingElse
Component:
Branches:
Reported By: NiklasHilmes
Waiting For:
Last Change By: KennethLavrsen
-- NiklasHilmes - 24 Mar 2010 When I want to open the config file of Foswiki I get a error message http://192.168.0.242/bin/configure

The Foswiki is in the path /var/www/Foswiki-1.0.9/

Sorry for the bad formatted text but I'm newbie and it's possible that I can use Foswiki this week so It would be nice to get helpful comments wink

Debian Apache2 installed IP-v4: 192.168.0.242

Windows XP installed IP-v4: 192.168.0.249

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@Foswiki and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log. Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch Server at 192.168.0.242 Port 80

That's the /etc/apache2/apache2.conf

This I had add to the conf:

apache2.conf

# Autogenerated httpd.conf file for Foswiki.
# Generated at http://foswiki.org/Support/ApacheConfigGenerator?vhost=;port=;dir=/var/www/Foswiki-1.0.9;symlink=;pathurl=/fo$

# For Foswiki version 1.0.0






# The Alias defines a url that points to the root of the Foswiki installation.
# The first parameter will be part of the URL to your installation e.g.
# http://my.co.uk/foswiki/bin/view/...
# The second parameter must point to the physical path on your disc.

#ScriptAlias /foswiki/bin "/var/www/Foswiki-1.0.9/bin"

# The following Alias is used to access files in the pub directory (attachments etc)
# It must come _after_ the ScriptAlias.
# If short URLs are enabled, and any other local directories or files need to be accessed directly, #they
# must also be specified in an Alias statement, and must not conflict with a web name.

#Alias /foswiki/pub "/var/www/Foswiki-1.0.9/pub"
#Alias /foswiki/robots.txt "/var/www/Foswiki-1.0.9/robots.txt"



#  Rewriting is required for Short URLs, and Attachment redirecting to viewfile
#RewriteEngine    on
#RewriteLog "/var/log/apache/rewrite.log"
#RewriteLogLevel 0



# short urls
#Alias /foswiki "/var/www/Foswiki-1.0.9/bin/view"
#RewriteRule ^/+foswiki/+bin/+view/+(.*) /foswiki/$1 [L,NE,R]
#RewriteRule ^/+foswiki/+bin/+view$ /foswiki/ [L,NE,R]





# This enables access to the documents in the Foswiki root directory
#<Directory "/var/www/Foswiki-1.0.9">
#    Order Allow,Deny
#    Allow from all
#    Deny from env=blockAccess
#</Directory>



# This specifies the options on the Foswiki scripts directory. The ExecCGI
# and SetHandler tell apache that it contains scripts. "Allow from all"
# lets any IP address access this URL.
# Note:  If you use SELinux, you also have to "Allow httpd cgi support" in your SELinux policies

#<Directory "/var/www/Foswiki-1.0.9/bin">
#    AllowOverride None
#    Order Allow,Deny
#    Allow from all
#   Deny from env=blockAccess
#
#    Options +ExecCGI  +FollowSymLinks
#    SetHandler cgi-script
#
    # Password file for Foswiki users
#    AuthUserFile /var/www/Foswiki-1.0.9/data/.htpasswd
#</Directory>



# This specifies the options on the Foswiki scripts directory. The ExecCGI
# and SetHandler tell apache that it contains scripts. "Allow from all"
# lets any IP address access this URL.
# Note:  If you use SELinux, you also have to "Allow httpd cgi support" in your SELinux policies

#<Directory "/var/www/Foswiki-1.0.9/bin">
#    AllowOverride None
#    Order Allow,Deny
#    Allow from all
#   Deny from env=blockAccess
#
#    Options +ExecCGI  +FollowSymLinks
#    SetHandler cgi-script
#
    # Password file for Foswiki users
#    AuthUserFile /var/www/Foswiki-1.0.9/data/.htpasswd
#    AuthName 'Enter your WikiName: (First name and last name, no space, no dots, capitalized, e.g. #JohnSmith). Cancel to reg$
#    AuthType Basic

    # Limit access to configure to specific IP address(es) or user(s).
    # Make sure configure is not open to the general public.
    # It exposes system details that can help attackers.
    # cf. http://foswiki.org/Support/ProtectingYourConfiguration for details.
#    <FilesMatch "^(configure)$">
#        SetHandler cgi-script
#        Order Deny,Allow
#        Deny from all
#        Allow from localhost 192.168.0.242 192.168.0.249
#
#        Satisfy Any
#    </FilesMatch>
#
#</Directory>

# This sets the options on the pub directory, which contains attachments and
# other files like CSS stylesheets and icons. AllowOverride None stops a
# user installing a .htaccess file that overrides these options.
# Note that files in pub are *not* protected by Foswiki Access Controls,
# so if you want to control access to files attached to topics you need to
# block access to the specific directories same way as the ApacheConfigGenerator
# blocks access to the pub directory of the Trash web
#<Directory "/var/www/Foswiki-1.0.9/pub">
#    Options None
#    Options +FollowSymLinks
#    AllowOverride None
#    Order Allow,Deny
#    Allow from all
#    Deny from env=blockAccess
#    ErrorDocument 404 /foswiki/bin/viewfile

    # Disable execution of PHP scripts
    php_admin_flag engine off

    # This line will redefine the mime type for the most common types of scripts
    AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi
   #
   #add an Expires header that is sufficiently in the future that the browser does not even ask if #its uptodate
   # reducing the load on the server significantly
   #IF you can, you should enable this - it _will_ improve your Foswiki experience, even if you set #it to under one day.
   # you may need to enable expires_module in your main apache config
   #LoadModule expires_module libexec/httpd/mod_expires.so
   #AddModule mod_expires.c
   #<ifmodule mod_expires.c>
   #  <filesmatch "\.(jpg|gif|png|css|js)$">
   #       ExpiresActive on
   #       ExpiresDefault "access plus 11 days"
   #   </filesmatch>
   #</ifmodule>
   #
   # Serve pre-compressed versions of .js and .css files, if they exist
   # Some browsers do not handle this correctly, which is why it is disabled by default
   # <FilesMatch "\.(js|css)$">
   #         RewriteEngine on
   #         RewriteCond %{HTTP:Accept-encoding} gzip
   #         RewriteCond %{REQUEST_FILENAME}.gz -f
   #         RewriteRule ^(.*)$ %{REQUEST_URI}.gz [L,QSA]
   # </FilesMatch>
   # <FilesMatch "\.(js|css)\?.*$">
   #         RewriteEngine on
   #         RewriteCond %{HTTP:Accept-encoding} gzip
   #         RewriteCond %{REQUEST_FILENAME}.gz -f
   #         RewriteRule ^([^?]*)\?(.*)$ $1.gz?$2 [L]
   # </FilesMatch>
   # <FilesMatch "\.js\.gz(\?.*)?$">
   #         AddEncoding x-gzip .gz
   #         AddType application/x-javascript .gz
   # </FilesMatch>
   # <FilesMatch "\.css\.gz(\?.*)?$">
   #         AddEncoding x-gzip .gz
   #         AddType text/css .gz
   # </FilesMatch>


#</Directory>

# Security note: All other directories should be set so
# that they are *not* visible as URLs, so we set them as =deny from all=.
#<Directory "/var/www/Foswiki-1.0.9/data">
#    deny from all
#        Allow from localhost 192.168.0.242 192.168.0.249
#</Directory>
#
#<Directory "/var/www/Foswiki-1.0.9/templates">
#    deny from all
#        Allow from localhost 192.168.0.242 192.168.0.249
#</Directory>
#
#<Directory "/var/www/Foswiki-1.0.9/lib">
#    deny from all
#        Allow from localhost 192.168.0.242 192.168.0.249
#</Directory>
#
#<Directory "/var/www/Foswiki-1.0.9/locale">
#    deny from all
#        Allow from localhost 192.168.0.242 192.168.0.249
#</Directory>
#
#<Directory "/var/www/Foswiki-1.0.9/tools">
#    deny from all
#        Allow from localhost 192.168.0.242 192.168.0.249
#</Directory>
#
#<Directory "/var/www/Foswiki-1.0.9/working">
#    deny from all
#        Allow from localhost 192.168.0.242 192.168.0.249
#</Directory>
#
# We set an environment variable called blockAccess.
#
# Setting a BrowserMatchNoCase to ^$ is important. It prevents Foswiki from
# including its own topics as URLs and also prevents other Foswikis from
# doing the same. This is important to prevent the most obvious
# Denial of Service attacks.
#
# You can expand this by adding more BrowserMatchNoCase statements to
# block evil browser agents trying the impossible task of mirroring a Foswiki
#
# Example:
# BrowserMatchNoCase ^SiteSucker blockAccess
# BrowserMatchNoCase ^$ blockAccess


#BrowserMatchNoCase ^$ blockAccess

That's the apache2.conf

Now I have a foswiki.conf

/etc/apache2/conf.d/foswiki.conf

foswiki.conf

# Autogenerated httpd.conf file for Foswiki.
# Generated at http://foswiki.org/Support/ApacheConfigGenerator?vhost=Foswiki;port=;dir=/var/www/Foswiki-1.0.9;symlink=on;pa$

# For Foswiki version 1.0.0





<VirtualHost *>
    ServerAdmin webmaster@Foswiki
    DocumentRoot /var/www/Foswiki-1.0.9
    ServerName Foswiki
    ServerAlias www.Foswiki         # Optional.  Add to list of redirect hosts in bin/configure


# The Alias defines a url that points to the root of the Foswiki installation.
# The first parameter will be part of the URL to your installation e.g.
# http://my.co.uk/foswiki/bin/view/...
# The second parameter must point to the physical path on your disc.

#ScriptAlias /foswiki/bin/configure "/var/www/Foswiki-1.0.9/bin/configure"

ScriptAlias /foswiki/bin "/var/www/Foswiki-1.0.9/bin"

# The following Alias is used to access files in the pub directory (attachments etc)
# It must come _after_ the ScriptAlias.
# If short URLs are enabled, and any other local directories or files need to be accessed directly, they
# must also be specified in an Alias statement, and must not conflict with a web name.

Alias /foswiki/pub "/var/www/Foswiki-1.0.9/pub"
Alias /foswiki/robots.txt "/var/www/Foswiki-1.0.9/robots.txt"



#  Rewriting is required for Short URLs, and Attachment redirecting to viewfile
RewriteEngine    on
#RewriteLog "/var/log/apache/rewrite.log"
#RewriteLogLevel 0



# short urls
Alias /foswiki "/var/www/Foswiki-1.0.9/bin/view"
RewriteRule ^/+foswiki/+bin/+view/+(.*) /foswiki/$1 [L,NE,R]
RewriteRule ^/+foswiki/+bin/+view$ /foswiki/ [L,NE,R]





# This enables access to the documents in the Foswiki root directory
<Directory "/var/www/Foswiki-1.0.9">
    Order Allow,Deny
    Allow from all
    Deny from env=blockAccess
</Directory>



# This specifies the options on the Foswiki scripts directory. The ExecCGI
# and SetHandler tell apache that it contains scripts. "Allow from all"
# lets any IP address access this URL.
# Note:  If you use SELinux, you also have to "Allow httpd cgi support" in your SELinux policies

<Directory "/var/www/Foswiki-1.0.9/bin">
    AllowOverride None
    Order Allow,Deny
    Allow from all
    Deny from env=blockAccess

    Options +ExecCGI  +FollowSymLinks
    SetHandler cgi-script

    # Password file for Foswiki users
    AuthUserFile /var/www/Foswiki-1.0.9/data/.htpasswd
    AuthName 'Enter your WikiName: (First name and last name, no space, no dots, capitalized, e.g. JohnSmith). Cancel to register if you do not have one.'
    AuthType Basic

    # Limit access to configure to specific IP address(es) or user(s).
    # Make sure configure is not open to the general public.
    # It exposes system details that can help attackers.
    # cf. http://foswiki.org/Support/ProtectingYourConfiguration for details.
    <FilesMatch "^(configure)$">
        SetHandler cgi-script
        Order Deny,Allow
        Deny from all
        Allow from root www-data 192.168.0.242 192.168.0.249

        Satisfy Any
    </FilesMatch>

</Directory>

# This sets the options on the pub directory, which contains attachments and
# other files like CSS stylesheets and icons. AllowOverride None stops a
# user installing a .htaccess file that overrides these options.
# Note that files in pub are *not* protected by Foswiki Access Controls,
# so if you want to control access to files attached to topics you need to
# block access to the specific directories same way as the ApacheConfigGenerator
# blocks access to the pub directory of the Trash web
<Directory "/var/www/Foswiki-1.0.9/pub">
    Options None
    Options +FollowSymLinks
    AllowOverride None
    Order Allow,Deny
    Allow from all
    Deny from env=blockAccess
    ErrorDocument 404 /foswiki/bin/viewfile

    # Disable execution of PHP scripts
    php_admin_flag engine off

    # This line will redefine the mime type for the most common types of scripts
    AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi
   #
   #add an Expires header that is sufficiently in the future that the browser does not even ask if its uptodate
   # reducing the load on the server significantly
   #IF you can, you should enable this - it _will_ improve your Foswiki experience, even if you set it to under one day.
   # you may need to enable expires_module in your main apache config
   #LoadModule expires_module libexec/httpd/mod_expires.so
   #AddModule mod_expires.c
   #<ifmodule mod_expires.c>
   #  <filesmatch "\.(jpg|gif|png|css|js)$">
   #       ExpiresActive on
   #       ExpiresDefault "access plus 11 days"
   #   </filesmatch>
   #</ifmodule>
   #
   # Serve pre-compressed versions of .js and .css files, if they exist
   # Some browsers do not handle this correctly, which is why it is disabled by default
   # <FilesMatch "\.(js|css)$">
   #         RewriteEngine on
   #         RewriteCond %{HTTP:Accept-encoding} gzip
   #         RewriteCond %{REQUEST_FILENAME}.gz -f
   #         RewriteRule ^(.*)$ %{REQUEST_URI}.gz [L,QSA]
   # </FilesMatch>
   # <FilesMatch "\.(js|css)\?.*$">
   #         RewriteEngine on
   #         RewriteCond %{HTTP:Accept-encoding} gzip
   #         RewriteCond %{REQUEST_FILENAME}.gz -f
   #         RewriteRule ^([^?]*)\?(.*)$ $1.gz?$2 [L]
   # </FilesMatch>
   # <FilesMatch "\.js\.gz(\?.*)?$">
   #         AddEncoding x-gzip .gz
   #         AddType application/x-javascript .gz
   # </FilesMatch>
   # <FilesMatch "\.css\.gz(\?.*)?$">
   #         AddEncoding x-gzip .gz
   #         AddType text/css .gz
   # </FilesMatch>
#</Directory>



# Security note: All other directories should be set so
# that they are *not* visible as URLs, so we set them as =deny from all=.
#<Directory "/var/www/Foswiki-1.0.9/data">
#    deny from all
#</Directory>

#<Directory "/var/www/Foswiki-1.0.9/templates">
#    deny from all
#</Directory>
#
#<Directory "/var/www/Foswiki-1.0.9/lib">
#    deny from all
#</Directory>
#
#<Directory "/var/www/Foswiki-1.0.9/locale">
#    deny from all
#</Directory>
#
#<Directory "/var/www/Foswiki-1.0.9/tools">
#    deny from all
#</Directory>
#
#<Directory "/var/www/Foswiki-1.0.9/working">
#    deny from all
#</Directory>

# We set an environment variable called blockAccess.
#
# Setting a BrowserMatchNoCase to ^$ is important. It prevents Foswiki from
# including its own topics as URLs and also prevents other Foswikis from
# doing the same. This is important to prevent the most obvious
# Denial of Service attacks.
#
# You can expand this by adding more BrowserMatchNoCase statements to
# block evil browser agents trying the impossible task of mirroring a Foswiki
#
# Example:
# BrowserMatchNoCase ^SiteSucker blockAccess
# BrowserMatchNoCase ^$ blockAccess


#BrowserMatchNoCase ^$ blockAccess

#</VirtualHost>

So that's my apache2.conf and my foswiki.conf

Here is the error.log of apache2

error.log apache2


/var/log/apache2/error.log

[Wed Mar 24 08:24:13 2010] [notice] Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch configured -- resuming normal operations

[Wed Mar 24 08:24:26 2010] [error] [client 192.168.0.249] (8)Exec format error: exec of '/var/www/Foswiki-1.0.9/bin/configure' failed, referer: http://192.168.0.242/

[Wed Mar 24 08:24:26 2010] [error] [client 192.168.0.249] Premature end of script headers: configure, referer: http://192.168.0.242/

My problem is I don't know whats the problem is. frown, sad smile Of course I have the error.log but there aren't information for me.

It would be nice when anyone could help me...

Greetz -- NiklasHilmes

This should probably have been a support question and not a bug report.

I have added some verbatim tags to get it readable.

-- KennethLavrsen - 24 Mar 2010

Looking at your configs I think you have goofed up a lot.

You talk about apache2.conf and about foswiki.conf. That is nonsense. There is supposed to be ONE config file - not two. I hope you did not alter your normal apache config file.

Second. The first file you show has all lines commented out by # so it does nothing.

The 2nd file has half the settings commented out that should not be.

So I have no clue what you are trying to do. You should start all over from the beginning and follow the installation documentation.

-- KennethLavrsen - 24 Mar 2010
 

ItemTemplate edit

Summary 500 Internal Server Error
ReportedBy NiklasHilmes
Codebase
SVN Range
AppliesTo SomethingElse
Component
Priority Low
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r2 - 24 Mar 2010, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy