Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache 1.3.23, FreeBSD, cgi problem

Status
Not open for further replies.

Vadim666

MIS
Sep 3, 2003
3
US
Hi there,
I updated apache from 1.3.9 up to 1.3.23 and my cgi files started behave weird. Most of them are not working in Netscape at all. You're able to see the code rather than the page and images. Others just don't work. At the same time if I transfer them to perl, they are working as perl scripts.
Here is a copy of my httpd.conf, please help me if you find anything.


###########################################################################################
# Server configuration

ServerType standalone
ServerRoot /usr/local/apache
PidFile /usr/local/apache/logs/httpd.pid
LockFile /usr/local/apache/logs/httpd.lock

Timeout 300
KeepAlive On
MaxKeepAliveRequests 300
KeepAliveTimeout 15

MinSpareServers 40
MaxSpareServers 50
StartServers 5
MaxClients 600
MaxRequestsPerChild 1000

Port 80
User www
Group www

ServerAdmin repair@adultfrontier.com
ServerName speedy.adultfrontier.net

RewriteCond %{HTTP_REFERER} !^RewriteRule .*\.(jpg|jpeg|gif|rm|ra|mpg)$ [R,L]

###########################################################################################
# Access Configuration

DocumentRoot /usr/local/apache/htdocs

UserDir disabled
DirectoryIndex index.html index.shtml index.phtml index.htm
AccessFileName .htaccess

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

<FilesMatch &quot;\.(htaccess|htpasswd)$&quot;>
Order allow,deny
Deny from all
</FilesMatch>

<Directory &quot;/usr/local/apache/htdocs&quot;>
Options Includes +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Alias /icons/ /usr/local/apache/icons/

<Directory &quot;/usr/local/apache/icons&quot;>
Options MultiViews +ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/local/apache/cgi-bin/
<Directory &quot;/usr/local/apache/cgi-bin&quot;>
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>

<Directory &quot;/web1/users/*/*/&quot;>
Options Includes MultiViews +ExecCGI SymLinksIfOwnerMatch
AllowOverride All
Order allow,deny
Allow from all
</Directory>

<Directory &quot;/web1/users/*/*/members/&quot;>
Options Includes MultiViews +ExecCGI SymLinksIfOwnerMatch
AllowOverride All
Order allow,deny
Allow from all
</Directory>

<Directory &quot;/web1/http-stats/*/&quot;>
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>

ScriptAlias /pub-bin/ /usr/local/pubcgi/sec_1_ret/

Alias /pub-files/ /usr/local/apache/pubfiles/
<Directory &quot;/usr/local/apache/pubfiles&quot;>
Options None
AllowOverride None
Order allow,deny
allow from all
</Directory>

###########################################################################################
# Misc Configuration

HostnameLookups Off
UseCanonicalName Off
ServerSignature Off
IndexOptions FancyIndexing
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

TypesConfig /usr/local/apache/conf/mime.types
DefaultType text/plain

<IfModule mod_mime_magic.c>
MIMEMagicFile /usr/local/apache/conf/magic
</IfModule>

###########################################################################################
# Logs Configuration

#LogLevel warn

LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %>s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; combined
ErrorLog /usr/local/apache/logs/error_log
CustomLog /usr/local/apache/logs/access_log combined

###########################################################################################
# Icons Configuration

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

###########################################################################################
# FileTypes/Language Configuration

AddDescription &quot;GZIP compressed document&quot; .gz
AddDescription &quot;tar archive&quot; .tar
AddDescription &quot;GZIP compressed tar archive&quot; .tgz

ReadmeName README
HeaderName HEADER

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 text/html .shtml .shtm
AddHandler server-parsed .shtml .shtm

###########################################################################################
# PHP4 Configuration
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php3 .php4 .php .phtml


LoadModule php4_module libexec/libphp4.so


###########################################################################################
# FastCGI Configuration

AddHandler fastcgi-script .fcgi
FastCgiSuexec On

FastCgiConfig -listen-queue-depth 30 -maxProcesses 100 -maxClassProcesses 5

###########################################################################################
# Browsers Configuration

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

###########################################################################################
# Web-based Control Panel

NameVirtualHost x.x.x.x

<VirtualHost x.x.x.x>
ServerName admin.speedy.adultfrontier.com
DocumentRoot /usr/local/apache/admin/docs
ScriptAlias /cgi/ /usr/local/apache/admin/cgi/
</VirtualHost>

Alias /site-manager /usr/local/apache/admin/docs/
<Directory &quot;/usr/local/apache/admin&quot;>
Options +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>

###########################################################################################
 
Probably missing the cgiWrap directives?

From one of my srm.conf configs:
+++++++++++++++++++++++++++++++++++
# To use CGI scripts:
Action cgi-wrapper /cgiwrapDir/cgiwrap
#AddHandler cgi-wrapper .cgi
#AddHandler cgi-wrapper .pl
#Added by Laurie for cgi-wrapper debugging 26/08/01 re: raq-faq
Action cgi-wrapperd /cgiwrapDir/cgiwrapd
AddHandler cgi-wrapperd .cgid
AddHandler cgi-wrapperd .pld
+++++++++++++++++++++++++++++++++++

Checkout your pre-update ~httpd/conf files

Good Luck,
Laurie
 
Laurie, thanks for reply.

I've noticed another thing. I have one virtual host, which has the same IP address as the server and cgi is working fine there, but this is the only directory where it works. The configuration is the same for all virtual hosts.
 
Ok, Are you sure you have defined the ScriptAlias inside the other virtual hosts?

I mean the part that defines each virtual hosts cgi-bin >>>

<Virtual .............

ScriptAlias /cgi-bin/ /usr/local/apache/virtual1/cgi-bin/
<Directory &quot;/usr/local/apache/virtual1/cgi-bin&quot;>
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>

</Virtual .............

However I use Sun Cobalts so my Virtuals look slightly different .... like so:

<VirtualHost 123.456.78.910>
ServerName ServerAdmin bob
DocumentRoot /home/sites/site109/web
ServerAlias spooky.co.uk
RewriteEngine on
RewriteCond %{HTTP_HOST} !^123.456.78.910:)80)?$
RewriteCond %{HTTP_HOST} !^RewriteRule ^/(.*) [L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site109/users/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site109/users/$1/web/$3
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
</VirtualHost>

I hope that gives you a little more to work on?

Good Luck,
Laurie.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top