PDA

View Full Version : Apache problem! URGENT!!!!!!!!!!!!!!


Csanders
04-24-2004, 01:57 AM
Hi,

I am haveing a problem with apache, as i edited my httpd.conf and broke it, and reinstalled apache useing the build script from this site

here is the error
Starting httpd: Apache:mod_ssl:Error: Private key not found.

The server.key file is where it's supposed to be, and it has the proper permissions and the path in httpd.conf is correct.

I really need help fixing this error, as I am at risk of looseing clients!

Thanks,
Carl

ProWebUK
04-24-2004, 06:56 AM
in httpd.conf look for the SSLCertificateKeyFile line, should be around line 1342.

Check the path there,

ls -la path_from_httpd_conf.key

paste the output :)

Chris

Csanders
04-24-2004, 11:23 AM
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key

[root@bob conf]# ls -la /etc/httpd/conf/ssl.key/server.key
-rwxr-xr-x 1 root root 891 Apr 23 15:37 /etc/httpd/conf/ssl.key/server.key
[root@bob conf]#

ProWebUK
04-24-2004, 12:20 PM
Try to regenerate the key, or restore the previous one (if you have a backup), it appears the key is a few characters over the normal.

Chris

Csanders
04-24-2004, 12:42 PM
Hi,

I have regenerated the key AND tried a backup, but still no luck.

-Carl

ProWebUK
04-24-2004, 01:30 PM
Ive just checked 5 different certificates on my system (all standard generated or purchased ones) and the certificate size is 887b, you add 1 letter additional in there (making it 888+) and it fails to start with the error you get - in other words your key is invalid.... go regenerate it and it should be 887b.... ensure it matches your crt also.

Chris

Csanders
04-24-2004, 02:01 PM
How can I regenerate it?

-Carl

ProWebUK
04-24-2004, 02:38 PM
Originally posted by Csanders
Hi,

I have regenerated

?




openssl req -new -x509 -keyout key.tmp \
-out server.crt



openssl rsa -in key.tmp \
-out server.key



rm -f key.tmp
# Make backups of your previous crt and key before running the folowing commands, unless you wish to overwrite them
mv server.crt /etc/httpd/conf/ssl.crt/server.crt
mv server.key /etc/httpd/conf/ssl.key/server.key


restart apache and see how it goes :)

Chris

Csanders
04-24-2004, 03:13 PM
Hi,

Thanks for the *proper* instructions. as i had been just useing "make certificate" :-)

-Carl

Csanders
04-24-2004, 03:20 PM
Still, no luck

Csanders
04-24-2004, 03:21 PM
Is there any way that I can completely reinstall mod_ssl etc... ?

ProWebUK
04-24-2004, 03:26 PM
still the same error?

cd /usr/local/directadmin/customapache
./build all

Chris

DirectAdmin Support
04-24-2004, 03:55 PM
I'm wondering if it's a user SSL certificate in /usr/local/directadmin/data/users/username/domains/domain.com.key

Check the /var/log/httpd/error_log and /var/log/httpd/domains/*.error.log for clues.

(btw, my apache key is 905 bytes)

You can

ProWebUK
04-24-2004, 04:11 PM
Originally posted by DirectAdmin Support
I'm wondering if it's a user SSL certificate in /usr/local/directadmin/data/users/username/domains/domain.com.key

Check the /var/log/httpd/error_log and /var/log/httpd/domains/*.error.log for clues.

(btw, my apache key is 905 bytes)

You can

Didnt think of the user certificates :D thats likely what it is

(every key I have generated today (2), used from puchased certs, aswell as 5+ sites I checked are 887bytes... thats on multiple servers also, maybe its different... but it's certainly very common ;))

Csanders
04-24-2004, 06:57 PM
*************************************
* *
* All parts have been installed *
* *
*************************************

Type: /sbin/service httpd restart
[root@bob customapache]# /sbin/service httpd restart
Stopping httpd: [FAILED]
Starting httpd: [Sat Apr 24 10:55:07 2004] [warn] module perl_module is already loaded, skipping
Apache:mod_ssl:Error: Private key not found.
**Stopped
[FAILED]
[root@bob customapache]#

ProWebUK
04-24-2004, 07:10 PM
Check the log files as John suggested:

/var/log/httpd/error_log and /var/log/httpd/domains/*.error.log

Chris

Csanders
04-24-2004, 07:35 PM
/var/log/httpd/error_log ends at when the server last worked

/var/log/httpd/domains/*.error.log doesnt even exist

Carl

DirectAdmin Support
04-27-2004, 10:07 AM
Hello,

It should:

cd /var/log/httpd/domains
ls -l
less *.error.log

(* is a wildcard for all the domains, not a file itself)

John