LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-06-2005, 02:47 PM   #1
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
Make Apache cgi-bin SSL Only?


Is there a way to make my cgi-bin folder for Apache only respond to SSL requests?. Currently http://www.mydomain.com/cgi-bin/test-cgi and https://www.mydomain.com/cgi-bin/test-cgi both work fine. I want http://www.mydomain.com/cgi-bin/test-cgi to return a 404 or some other error. Doable? Apache 2.0.54.
 
Old 05-07-2005, 12:21 AM   #2
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
Yeah you should be able to do it using the SSLRequireSSL directive when you define the parameters for your cgi-bin directory. For example:
Code:
    <Directory "/usr/local/apache/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
        SSLRequireSSL
    </Directory>
 
Old 05-07-2005, 01:21 PM   #3
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 47
You could also kick the user to the SSL version from the plain version with this:

Code:
RewriteEngine     On
RewriteRule         ^/cgi-bin/(.*)     https://yourdomain.com/cgi-bin/$1 [R]
or something similar
 
Old 05-09-2005, 10:37 AM   #4
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by DaHammer
Yeah you should be able to do it using the SSLRequireSSL directive when you define the parameters for your cgi-bin directory. For example:
Code:
    <Directory "/usr/local/apache/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
        SSLRequireSSL
    </Directory>
Thanks, that did the trick. Couldn't get the mod_rewrite working correctly.
 
  


Reply



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
configuring cgi-bin in apache gtgoku Linux - General 1 01-19-2004 06:22 AM
Redhat 9 / Apache / cgi-bin ???? jeff0628 Linux - General 16 10-18-2003 06:50 AM
Apache server and cgi-bin? WorldBuilder Linux - Networking 15 09-18-2003 12:13 PM
no access to cgi-bin within Apache Mackeral Linux - Software 6 05-14-2002 05:15 AM
apache cgi-bin roadie Linux - General 6 06-16-2001 07:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:20 AM.

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
Open Source Consulting | Domain Registration