Solved

Creating a CGI directory for each User ---problem (Not working ..i just get to see the source code)

Posted on 2004-08-04
10
273 Views
Last Modified: 2010-03-04
Hello ..I am trying out somethings on my laptop (learning ...).I was able to configure the httpd server for CGI etc ...

Now I want to do the same for the "user" on my laptop.

I am unable to do so ...please help me on this

This is what I did...
******************************************************************************************************
1. Configured the server to take html files such that the user can access his html files by  "http://localhost/~bob/"

I did this  by  
a) Uncommenting the UserDir
b) Adding this
<Directory /home/*/html>
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>

This worked good

2.Next I tried to add CGI previlages to the user
I did the following ( I got this from the net)

<Directory /home/*/html/cgi-bin/>
    Options ExecCGI
    SetHandler cgi-script
</Directory>

*********************************************************************************************************
This does not work what I see is the source code that is in the sample cgi file.

Am I doing something wrong
0
Comment
Question by:micro_learner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 4

Expert Comment

by:TomDavidson
ID: 11716999
Do cgi applications work on the main location (without the /~user/)?
0
 

Author Comment

by:micro_learner
ID: 11718262
The CGI works for the main location ....

http://localhost/cgi-bin/test.cgi  works


Normal HTML files work for the user

http://localhost/~user/test.html   works


CGI for the User show the source code in the browser

http://localhost/~user/cgi-bin/test.cgi  shows the source code
0
 
LVL 4

Accepted Solution

by:
TomDavidson earned 168 total points
ID: 11720562
Try:
AddHandler cgi-script cgi pl
instead of:
SetHandler cgi-script
in the <Directory> block
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:micro_learner
ID: 11722104
I am sorry but ..the problem has changed track..I mean I get a different error now.(even before i did the above..not sure why .)

It says :Premature end of Script headers:test.cgi
Error 500

I thought it could be a script problem but this does not work for even html files!
The html file that works for say http://localhost/~bob/test     
does not work  for http://localhost/~bob/cgi-bin/test   gives the same error 500

These are the permissions I currently have

/home drwxr-wr-w
/home/bob   drwxr-wr-w
/home/bob/html drwxrwxr-x
/home/bob/html/cgi-bin  drwxr-xr-x

all the files in the cgi-bin are rwxr-xr-x

P.S : This may not be a problem with the script as I am using the same script that works for http://localhost/cgi-bin/test
0
 
LVL 38

Assisted Solution

by:yuzh
yuzh earned 166 total points
ID: 11724167
Have a look at this "Apache Tutorial: Dynamic Content with CGI"
http://webauthv3.stanford.edu/manual/howto/cgi.html
0
 
LVL 15

Assisted Solution

by:samri
samri earned 166 total points
ID: 11829060
micro_learner,

in addition to the link that yuzh provided, you need to ensure that the CGI program actuall runs.  The easiest thing would be trying to copy the cgi file to the standard CGI folder, and see if it runs there.

The error "Premature end of..." typically the result of incorrectly written CGI, or the CGI program is sending out wrong header.  try with a simple CGI (and adjust the perl line to match those on your system):

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, World.";


and try to use Options +ExecCGI, this would cause the ExecCGI to be added to the existing optiosn - rather than replacing all previous options.

-- and if there is still problem - check server error_log, perhaps you could post it here.

cheers.
0
 
LVL 4

Expert Comment

by:TomDavidson
ID: 12146047
Split between all 3?
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question