LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 11-25-2006, 07:37 PM   #1
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,259

Rep: Reputation: 231Reputation: 231Reputation: 231
Force SSL on Apache - Slackware 11


Ok, I've been trying to set set up a server which it will use SSL. I've been having problems getting the mod_rewrite to work. I'm trying to force every connection to a certain directory to be on port 443 (SSL). I wrote a mod-rewrite.conf rule. It doesn't work. I have tried everything that I have found online, but no dice.

I have changed the AllowOverride "None" to "All" before the .htaccess section. The mod_rewrite module also loads correctly.

This is my sample mod-rewrite.conf file:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/my_directory/(.*) https://%{SERVER_NAME}/my_directory/$1 [R,L]

What am I doing wrong?
 
Old 11-26-2006, 04:37 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
This is the slackware forum but the "mod-rewrite.conf" makes me think you're trying this with Redhat/FC experiences (Slackware does not use separate config files). Try editing httpd.conf instead.
Try
Code:
    RewriteEngine On
    RewriteCond %{SERVER_PORT}          !^443$
    RewriteRule ^/my_directory/(.*)     https://%{SERVER_NAME}/my_directory/$1 [L,R]
Eric
 
Old 11-27-2006, 05:54 PM   #3
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,259

Original Poster
Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by Alien Bob
This is the slackware forum but the "mod-rewrite.conf" makes me think you're trying this with Redhat/FC experiences (Slackware does not use separate config files). Try editing httpd.conf instead.
Try
Code:
    RewriteEngine On
    RewriteCond %{SERVER_PORT}          !^443$
    RewriteRule ^/my_directory/(.*)     https://%{SERVER_NAME}/my_directory/$1 [L,R]
Eric
Thanks Alien Bob! I think that was my problem. Now, is there anywhere specific that I need to insert this part of the code? Or does it matter?
 
Old 11-28-2006, 02:10 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Put it in the global section of your httpd.conf

Eric
 
  


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
Force ssl in squirrelmail sbabcock23 Linux - Server 3 08-23-2006 08:27 PM
Apache 1.3.33 (debian built) and Apache SSL does not respond to the proper ports lqorg_user Linux - Networking 0 11-06-2005 04:11 PM
Protecting Apache from DOS & Brute Force wwnexc Linux - Software 3 11-01-2005 05:30 AM
apache and apache-ssl questions merana Debian 4 03-10-2005 10:10 AM
Slackware + Apache + SSL Pinkdog Linux - Security 2 10-15-2003 09:28 PM

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

All times are GMT -5. The time now is 05:45 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