LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-10-2006, 07:38 PM   #1
micro_xii
Member
 
Registered: Sep 2006
Posts: 140

Rep: Reputation: 15
Question forcing to use SSL


Greetings;

Im using SLES9 , apache2

I want to force my webserver to use https. When I browse https://domain.com...it works properly...and If I type http://domain.com..still it appears and this I dont want to happen..I want to force it to use https
 
Old 11-10-2006, 08:45 PM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
Https listens at port 443 usually, and regular http listens at 80.

You have a few choices. To be drastic, you can configure apache to only listen to port 443. Then if somebody tries http://yourdomain.com, they would get host not found, or some such error. A more friendly solution would be to create a page at http that forces a redirect to https, but that wouldn't be absolute. People could still browse to pages other than the first page under http.

Peace,
JimBass
 
Old 11-10-2006, 10:38 PM   #3
micro_xii
Member
 
Registered: Sep 2006
Posts: 140

Original Poster
Rep: Reputation: 15
Question use 443

Quote:
Originally Posted by JimBass
Https listens at port 443 usually, and regular http listens at 80.

You have a few choices. To be drastic, you can configure apache to only listen to port 443. Then if somebody tries http://yourdomain.com, they would get host not found, or some such error. A more friendly solution would be to create a page at http that forces a redirect to https, but that wouldn't be absolute. People could still browse to pages other than the first page under http.

Peace,
JimBass
Now if I enable apache to use only 443....and if a user tries http://domain.com, he will not recieve errors but he will be redirected to https://....Is this possible.How?
 
Old 11-10-2006, 11:22 PM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
No, that isn't possible. If you don't listen at 80, how would you redirect from 80 to 443? Something would need to receive the request at port 80, and give a link on to 443. If that is what you want, then you have to have a page at port 80 that catches the http request and changes it to https. A simple 1 line page that is just a hyperlink to the https address would be fine, or you can get fancy and do one of those "you will be redirected in X seconds" jobs.

Peace,
JimBass
 
Old 11-11-2006, 12:29 AM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,030

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Quote:
Originally Posted by JimBass
If you don't listen at 80, how would you redirect from 80 to 443?
The firewall can probably do it. Query Google with some combination of the words "transparent proxy iptables redirect" and I'm sure there will be tons of hits. I can't remember the exact iptables command off the top of my head. It probably uses the PREROUTING or FORWARD chain.
 
  


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
vsFTPd - SSL connection and dynamic SSL ports toxoplasme Linux - Server 11 08-22-2008 11:50 PM
creating an SSL page under non SSL site with apache1.33? taiwf Linux - Software 1 06-27-2006 02:06 AM
SSL Connections / second and SSL Accelerator Cards on Linux LinuxGeek Linux - Networking 0 06-10-2006 09:18 AM
need help with apach virtual hosts ssl/non ssl sites danthach Linux - Networking 3 05-25-2006 07:40 AM
Forcing a directory tree to be SSL only leongoogs Linux - Newbie 1 05-11-2004 08:36 AM


All times are GMT -5. The time now is 09:55 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration