LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-25-2004, 05:43 PM   #1
harlow400
LQ Newbie
 
Registered: Jan 2003
Location: South Portland, Maine USA
Distribution: Slackware 9.0
Posts: 12

Rep: Reputation: 0
Angry Apache 2.0 and SSL


hello all. i am trying to configure/start SSL on my apache 2.0 webserver. however, every how-to i have read in the last two weeks tells me something completely different. i would love if someone had a simple, step by step on how to create my public/private keys and a certificate. this is only for a school project, so i want to self-sign the cert. any help on the following would be greatly appreciated:

1. which directory do i run the commands i find here from?

2. how do i test it once it's secure?

thanks!

joe somewhat-newbie
 
Old 02-25-2004, 08:52 PM   #2
retep
Member
 
Registered: Sep 2003
Distribution: RedHat/Debian
Posts: 50

Rep: Reputation: 15
I wrote this howto, it may help:
http://rimuhosting.com/support/micro....jsp?t=ssl#ssl
 
Old 02-26-2004, 12:39 PM   #3
harlow400
LQ Newbie
 
Registered: Jan 2003
Location: South Portland, Maine USA
Distribution: Slackware 9.0
Posts: 12

Original Poster
Rep: Reputation: 0
thx for your response, but that is clear as mud ;-) !! it's probably me just being thickheaded, but these are the things i'm trying to understand:

1. creating a private key
2. creating a certificate
3. creating a certificate request
4. self-signing the request
5. what directories should the above reside in?
6. do i need to modify the configuration files?
7. how can i test to see if it works?

thanks for your patience!

joe
 
Old 03-08-2004, 06:03 AM   #4
johnvoisey
Member
 
Registered: Jun 2002
Location: UK
Distribution: Used many over the years, main ones now "CentOS", Slackware and Arch
Posts: 31

Rep: Reputation: 15
Which distro are you using ?

The info listed by your username in your post suggests you are using slackware 9.0. My (old) slackware 9.0 ISOs have apache 1.3.something and my slackware 9.1 iso's have apache 1.3.28, so arte you really running apache 2.0 .....

I have pc's here running mandrake 9.2 download edition and fedora core 1, both of which have apache 2.0, so I can probably help you out

The key to what you want to do in slackware lies in the mod_ssl package that comes with the 'n' series. Inside there are all the docs you ever need to see, they go into /var/www/htdocs/manual/mod/mod_ssl and more useful still is the setup file that goes in /var/log/setup/apache/mod_ssl

The best overall guide to setting up the keys and so on that I ever found was the mod-ssl site itself www.modssl.org/docs/2.8 but again this talks about ssl for apache 1.3.29, not apache 2.0

There are ways to set up mandrake and fedora, which I can talk you through is that's the distro's you need. I don't want to be accused of trumpetblowing, but if you want proof that you can set up your own ssl certificate, point a browser at https://velvetwood.co.uk

I've had a lot of help from various people on this site, so if there's anything I can do to repay that, so to speak, just ask

Last edited by johnvoisey; 03-08-2004 at 06:12 AM.
 
Old 03-08-2004, 11:32 PM   #5
JSylvia007
LQ Newbie
 
Registered: Aug 2003
Location: USA EAST
Distribution: Mandrake10.0 Community, Gentoo Linux
Posts: 25

Rep: Reputation: 15
I am trying to set up mos_ssl and apache2 on a Mandrake 9.2 box... Want to help me out??

~Jake
 
Old 03-09-2004, 04:45 AM   #6
johnvoisey
Member
 
Registered: Jun 2002
Location: UK
Distribution: Used many over the years, main ones now "CentOS", Slackware and Arch
Posts: 31

Rep: Reputation: 15
Be glad to help if I can. The stuff in here should get you up and running, but you will soon be asking "WHY" is the setup configured this way and for that, grasshopper, you need a linux guru whose knowledge is such that I am (currently) unworthy to tie their shoelaces.

Can I assume before we start that you have done the mandrake install and you have a machine up and running with at least enough of a network to be able to ping 'localhost' or 'localhost.localdomain' from a gnome-terminal window or similar, even if you are not physically connected to the 'net. (If not there's a bit of groundwork needed!)

OK then, my machine here is inside a firewall so you won't be able to see it yourself, but it's IP address on my internal network is 192.168.0.7 and its hostname is ace.velvetwood.co.uk. I have done a pretty standard mandrake linux 9.2 download edition install, except that I chose the 'select individual package' option during the install process and I opted to add the apache2-mod-php items along with apache2-mod-ssl (which I think was already preselected) under the Server => Web/Ftp menu item during the install process.

My main http configuration files are under /etc/httpd/2.0/conf but I don't think I have edited ANYTHING in that directory yet.

The webserver files themselves are in the /var/www heirarchy with the main file appearing to be the index.shtml file in /var/www/html.

With the installation finished and the machine rebooted, I was pleased to see the Mandrake Control Centre (Configuration -> Configure Your Computer) come up. From there under "Network And Internet" the "Drakconnect" icon allowed me to check that my machine was configured the way I wanted it. In the "System" window the "DrakServices" icon showed me that the httpd service was running. Excellent !

Among the applets / icons on the bottom of the screen, there was one called 'galeon' which brought up the galeon browser. By default this opens a "file:///" destination but it was easily persuaded to open http://ace.velvetwood.co.uk (the non-secure welcome page), which of course you won't be able to see as it's inside my firewall

So far, so good.

By now I'd already read a lot about ssl from the mod-ssl webpages and google searching, so I had an inkling of what to look for, but mandrake didn't make it easy to find. Eventually I tracked down a directory /etc/ssl which had two subdirectories "apache" and "webmin"

The apache subdirectory had a README file that told me to run a shell script to create my own certificates. Sounded fine to me but before I did so, I tried a few tests.

I went back to the galeon browser and tried to open "https://ace.velvetwood.co.uk", in other words, to see whether anything was already there. I quickly saw an alert message telling me the ssl certificate for this site was issued by "localhost.gobbledegook". Interesting, I thought. Do you get the same message ? If so. you're quids in. if not, you've got some work to do to get there.

With this already set up, I opened a gnome-terminal window, "su'd" to root, and went to the /etc/ssl/apache directory. In there I renamed the server.key and server.crt files found there to something like server.snakeoil.key and server.snakeoil.crt respectively (a naming convention I once saw in a slackware build).

Then whilst still logged in as root I ran the shell script referred to in the readme from the /etc/ssl/apache subdirectory.

I was asked a load of questions and presto a new server.key and server.crt were created.

Using the Mandrake Control Centre DrakServices utility I stopped and restarted the httpd server and with trepidation tried to open "https://ace.velvetwood.co.uk" in a new browser. An alert window just like the last told me to examine the certificate, which was now issued by 'ace.velvetwood.co.uk' and sure enough all the stuff I'd entered in the script was there.

I accepted the certificate and there was my welcome screen, bit with the padlock icon. Yippee !

Two "words of warning".

First, the shell script does not set a pass phrase for the server key. If you read the mod-ssl website documentation, it will explain why this may not be a good idea. The reason is that the Mandrake Control Centre (and for that matter the fedora equivalent) seem unable to handle the processing of a request for a pass phrase and will return an error message. Workrounds for this are documented in this site and others.

Second, you can install this certificate in a galeon/mozilla/netscape browser and it will use it again without complaint if you rewturn to the site in a new window on another occasion. However, Internet Explorer / Windoze will not. No matter how many times you tell Internet Explorer to install the certificate in the "Trusted Root Certificate Authorities" store, it won't, it will put it in the "Intermediate Authorities" store and you'll get a complaint every time.

In stark contrast, my server https://velvetwood.co.uk used to run redhat 9 and currently runs fedora core 1. The self-signed ssl certificate on THAT machine, created by a "make testcert" command, CAN be put in the root certificate store in Windoze IE6.

I am currently trying to understand why this happens. When I do I guess it will be time for me to apply for the next level of "linux guruness" !

I hope this helps you get a system working

Last edited by johnvoisey; 03-09-2004 at 04:47 AM.
 
Old 03-09-2004, 02:50 PM   #7
JSylvia007
LQ Newbie
 
Registered: Aug 2003
Location: USA EAST
Distribution: Mandrake10.0 Community, Gentoo Linux
Posts: 25

Rep: Reputation: 15
Wow... quite thorough... I got everything working... as you can see here: https://merg.umassd.edu I also run into the certificate not storing itself. I believe that this is because it is not "SIGNED" by a CA, and even though I tried to self Sign them, (as you are supposed to be able to) i still have problems. But, I believe, the fact that the certificate window is poping up, will now allow me to begin to use ssl for authentication. THANKS for your help!!

~Jake
 
Old 03-10-2004, 02:03 AM   #8
johnvoisey
Member
 
Registered: Jun 2002
Location: UK
Distribution: Used many over the years, main ones now "CentOS", Slackware and Arch
Posts: 31

Rep: Reputation: 15
Quote:
Originally posted by JSylvia007
Wow... quite thorough...
Thank You but I'm only really summarising what others have already documented in various places, and then adding my personal experiences with my own system(s).

I am now trying to get to the bottom of three separate "quirky" behaviour issues between linux mozilla / galeon and windows internet explorer. All three quirks begin in the same way; all the browsers raise an alert on the first visit to the site in question, mozilla /galeon asks if you want to accept the certificate 'warts and all' and will make subsequent visits to the site without further complaint, whereas windows IE whines on every visit. If you use the 'examine certificate' option and probe the details you will see one of three things.

1) A complaint that the certificate cannot be validated because a valid certificate revocation list cannot be found (seen in slackware 9.1 after following mod-ssl website instructions)

2) A complaint that the certificate cannot be validated because the CA cert used to sign it cannot be identified / trusted (seen in slackware 9.1 after using the slackware-supplied ssl setup script)

I am fairly convinced that these both boil down to a failure on my part to make some necessary change in the apache config files but I have not had enough free time to pursue this.

3) This wierd difference between mandrake and redhat/fedora where mandrake's cert will NOT be put in the Trusted Root Store no matter what you try, but redhat/fedora's CAN be.
 
Old 03-10-2004, 02:56 AM   #9
JSylvia007
LQ Newbie
 
Registered: Aug 2003
Location: USA EAST
Distribution: Mandrake10.0 Community, Gentoo Linux
Posts: 25

Rep: Reputation: 15
I have also experiences all of these issues, using Mandrake 9.2... I wouldnt know where to start to boil them down tho... :-/
 
  


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
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
apache + ssl help! aqoliveira Linux - Software 3 04-18-2005 12:36 PM
apache and apache-ssl questions merana Debian 4 03-10-2005 10:10 AM
Apache and SSL PcHammer Linux - Software 3 02-18-2005 02:33 PM
ssl on apache Finlay Linux - Networking 3 03-20-2003 11:48 AM


All times are GMT -5. The time now is 08:40 PM.

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