Justin Bedard on Wed, 4 Aug 1999 10:17:57 -0400 (EDT)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [Plug] quick apache question


Or take it one step further and add the stuff just for a specific directory:

<Directory /mydocs>
  Options ExecCGI Includes
  DirectoryIndex index.html index.shtml index.cgi index.php
  AddType text/html .shtml
  AddHandler server-parsed .shtml
</Directory>

That should allow you to execute CGI programs in that directory and handle .shtml
files.  Well, at least in theory.  ;-)  Remember, the error log is your friend.

Justin

Kevin Hill wrote:

> All you have to do is modify httpd.conf.  It's a two step process:
>
> 1. Make sure you have "ExecCGI" enabled for the document root
> directory.  This is accomplished by adding it to the "Options" list
> underneath the document root.
>
> 2. Add the name of your CGI program to the "DirectoryIndex" directive
> before the index.html and whatever else is there.
>
> Once you restart Apache, the webserver will use the name list under
> "DirectoryIndex" to determine your homepage.  It will find the CGI
> program first (as a result of step 2)  and be able to execute it (as a
> result of step 1).
>
> The only caveat is that you have now enabled CGI programs to run in the
> document root which could pose a nice security hole unless you've
> already locked everything down.
>
> - khill
>
> adam wrote:
> >
> > I am using not cgi but .shtml
> > in my ~public_html file
> > resides a file called
> > ".htaccess"
> > in this file I put
> > DirectoryIndex index.shtml
> > Of course, my buddy upgraded apache
> > and forgot to add SSI support, so my
> > page looks like hell right now :)
> >
> > Kevin Falcone wrote:
> >
> > > >>>>> "CB" == Christian Betz <shux@subculture.org> writes:
> > >
> > >   CB> I have a quick apache question. From a standard distribution and with
> > >   CB> apache and cgi scripts already working, how would I go about making the
> > >   CB> default document a cgi script instead of index.html? I've been wondering
> > >   CB> this for ages and believe it or not, I have looked through the docs,
> > >   CB> though perhaps not vigorously enough.
> > >
> > >   CB> All I want is for the script to run when I go to http://localhost instead
> > >   CB> of showing index.html
> > >
> > > Well, my homepage is a php script, but I'm sure that you can figure
> > > out the difference.  In the config file, there is a line with
> > > DirectoryIndex, and you need to add the filename you want to use
> > > (index.cgi?) to it. Mine looks like this.
> > >
> > > DirectoryIndex index.php index.html index.cgi
> > >
> > > The .php extension is bound to PHP, so apache knows what to do, you
> > > need to do something similar for the .cgi extension, and then put
> > > index.cgi first in the list, and then everything should work.  I
> > > believe you need an AddHandler for the .cgi extension, but its been a
> > > while.
> > >
> > > -kevin
> > >
> > > --
> > > Kevin Falcone <kevinfal@seas.upenn.edu>
> > >
> > > "The gene pool could use a little chlorine"
> > >
> > > _______________________________________________
> > > Plug maillist  -  Plug@lists.nothinbut.net
> > > http://lists.nothinbut.net/mail/listinfo/plug
> >
> > --
> > Adam
> >
> > ____________________
> > ++ATH0
> > http://adam.looney.com
> >
> > /-\ |\ /-\ (\/)
> >
> > Will Network for a Vespa.
> >
> > _______________________________________________
> > Plug maillist  -  Plug@lists.nothinbut.net
> > http://lists.nothinbut.net/mail/listinfo/plug


_______________________________________________
Plug maillist  -  Plug@lists.nothinbut.net
http://lists.nothinbut.net/mail/listinfo/plug