LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-18-2009, 09:11 AM   #1
arfon
Member
 
Registered: Apr 2004
Location: Texas
Distribution: Slackware
Posts: 166

Rep: Reputation: Disabled
Apache2, Slack 12.2 and CGI Directories.....?


I've just noticed that Patrick has changed the default cgi-bin directory (since the last time I messed with this) to /srv/httpd/cgi-bin via an alias-

/etc/httpd/httpd.conf:
Code:
ScriptAlias /cgi-bin/ "/srv/httpd/cgi-bin/"
...
#
# "/srv/httpd/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/srv/httpd/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

Apparently, things have changed in httpd.conf since the last time I set these features up... What I want to do is give each user (virtual host) his own cgi-bin directory under /home/*/public_html/cgi-bin.

Let me clarify... Right now, my default host is in /var/www/htdocs and all virtual hosts fall under /home/vhost/public_html (when I add a domain, I make a user for that domain).

I would like each virtual host/user to be able to use /home/*/public_html/cgi-bin but keep the server's default host's cgi-bin directory at /var/www/cgi-bin.

Ideas?
 
Old 03-18-2009, 10:40 AM   #2
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 640

Rep: Reputation: 36
To my knowledge Slackware has not changed the default apache setup, as this is pretty much the default.

You need however to add a few statements to each of your virtual hosts to allow cgi-scripts there:

Code:
ScriptAlias        /cgi-bin/  "/home/username/public_html/cgi-bin/"
    AddHandler         cgi-script .cgi
    <Directory "/home/username/public_html/cgi-bin">
         AllowOverride      None
         Options            None
         Order              allow,deny
         Allow              from all
    </Directory>
That allows you to control cgi access for each of your virtual hosts, turning it off and on as needs be.

PS. This is free from memory, so it might be one or two typos in there, but you should get the overall idea

-y1
 
Old 03-18-2009, 10:45 AM   #3
arfon
Member
 
Registered: Apr 2004
Location: Texas
Distribution: Slackware
Posts: 166

Original Poster
Rep: Reputation: Disabled
The answer

THE ANSWER-

After playing with this a bit, I found that the answer is to add:
Code:
<Directory /home/*/public_html/cgi-bin/>
Options ExecCGI
SetHandler cgi-script
</Directory>
...to the /etc/httpd/extra/httpd-users.conf file so it looks like:

Code:
# Settings for user home directories
#
# Required module: mod_userdir

#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.  Note that you must also set
# the default access control for these directories, as in the example below.
#
UserDir public_html

#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory "/home/*/public_html">
    AllowOverride FileInfo AuthConfig Limit Indexes
    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>

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


Reply


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
Apache2, enabling user cgi-bin directories...? arfon Slackware 2 01-30-2009 08:58 AM
cgi is not running through Apache2 ----- help xudonw1 Linux - Server 2 04-07-2007 06:42 AM
cgi on apache2? sharadshankar Linux - Software 5 02-19-2006 05:40 PM
CGI With Apache2 karthik85nitt Linux - Newbie 2 07-15-2005 05:11 AM
CGI apache2 question gothrog Linux - Software 1 09-16-2004 03:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:29 PM.

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