Apache problem! URGENT!!!!!!!!!!!!!!

Csanders

Verified User
Joined
Apr 24, 2004
Messages
13
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
 
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
 
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]#
 
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
 
Hi,

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

-Carl
 
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 said:
Hi,

I have regenerated

?



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

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

Code:
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
 
Hi,

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

-Carl
 
still the same error?

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

Chris
 
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
 
DirectAdmin Support said:
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 ;))
 
*************************************
* *
* 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]#
 
Check the log files as John suggested:

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

Chris
 
/var/log/httpd/error_log ends at when the server last worked

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

Carl
 
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
 
Back
Top