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 11-25-2006, 08:37 PM   #1
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,271

Rep: Reputation: 249Reputation: 249Reputation: 249
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, 05:37 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116
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, 06:54 PM   #3
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,271

Original Poster
Rep: Reputation: 249Reputation: 249Reputation: 249
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, 03:10 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

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

Eric
 
  


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
Force ssl in squirrelmail sbabcock23 Linux - Server 3 08-23-2006 09: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 05:11 PM
Protecting Apache from DOS & Brute Force wwnexc Linux - Software 3 11-01-2005 06:30 AM
apache and apache-ssl questions merana Debian 4 03-10-2005 11:10 AM
Slackware + Apache + SSL Pinkdog Linux - Security 2 10-15-2003 10:28 PM

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

All times are GMT -5. The time now is 01:01 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
Open Source Consulting | Domain Registration