Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 06-29-2007, 02:14 PM   #1
LQ Newbie
Registered: Jun 2007
Location: NY
Distribution: debian
Posts: 6

Rep: Reputation: 0
Debian, apache2, CGI problem

What is the answer on getting /cgi-bin files to work? what files where needed to be edited? I know its 1 or 2 file edits and maybe something with permissions...Something that should take about 5 minutes to have up and running.

The story...
Setting up Apache 2.2.3 on a newly installed debiann 4.0 r0 is fast
becoming an annoyance.

The first problem was that apache (for whatever stupid reason) insists
that web pages be loaded into "/var/www/apache2-default"

which means a web page would show up as .....UGLY

After talking to someone who might know, he took a guess that worked

Go to /etc/apache2/sites-available/, the "default" text file is what you
will need to edit. Then stop and start your apache2 web service

Change your directory to "/etc/init.d/"
STOP the apache service by using the command: apache2 -k stop
START the apache service by using the command: apache2 -k start
Your default web content directory should now be in your new directory

Web page works, all is good. Well, except for one thing...

NOW I need to get my webcounter working again. I had set this up years ago
(after the same struggle at not finding any good, direct docs) but this
time I will write it down.

Im using/like/used/and will continue using this counter:
which requires apache to use cgi files.

It is a well-hidden solution as to how to get apache to find and execute
this cgi file and the web is filled with other people asking about this
and my (earlier) problem above. So at least Im not alone.

There MUST be a simple, straing forward 1,2,3 set of instructions to get
this going without having to read a lengthy diatribe that leaves you with
more questions than when you started.

Which apache configuration file needs editing to allow my or anyother CGI
file to run via the web page?

After my basic debian install this is where things are on my system:

/usr/lib/w3m/cgi-bin and I made a symbolic link to it from /cgi-bin so I
can just say (or type) /cgi-bin and it will go to the right place

The .cgi for the web counter can be found at:

the apache2 FAQ says "In general, you should never use .htaccess files
unless you don't have access to the main server configuration file. There
is, for example, a prevailing misconception that user authentication
should always be done in .htaccess files. This is simply not the case. You
can put user authentication configurations in the main server
configuration, and this is, in fact, the preferred way to do things." so I
guess I wont be using that

My guess is that I need to do somthing in httpd.conf, which on my system
can be found at /etc/apache2/httpd.conf and is empyt except for one line
DocumentRoot "/var/www/" which may or may not be doing anything, being a
left over from one of my many tries of sloving the first problem. Before
this line was added, httpd.conf was EMPTY.

The end

So what is the answer on getting /cgi-bin files to work with this verson
of Apache on a debian directory structure?

THANKS in advance.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian, apache2, CGI problem daviddutch1964 Linux - Networking 1 06-29-2007 03:19 PM
Apache2 on Debian won't execute perl cgi scripts, have tried chmod, Options ExecCGI dewert Linux - Software 1 07-03-2006 12:44 PM
Debian Sarge Apache2 Parse C cgi programs disturbed Debian 4 03-19-2006 10:03 PM
CGI-script problem on Apache2 jkt2000 Linux - Networking 3 01-28-2005 04:38 AM
problem apache2 CGI python MoinMoin (wiki) brasschaat Linux - Software 1 08-11-2004 08:26 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration