You are not logged in.

#1 2018-05-17 02:30:42

CarterCox
Member
From: US
Registered: 2018-02-24
Posts: 113

[SOLVED]httpd.service fails after configuring SSL

Hello! So I have followed this:

https://wiki.archlinux.org/index.php/Ap … #TLS.2FSSL
https://wiki.archlinux.org/index.php/Ap … ertificate

And I obtained the required files, then "pointed" to them in the required files. I didn't do the CSR steps, which means:

I uncommented

LoadModule ssl_module modules/mod_ssl.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
Include conf/extra/httpd-ssl.conf

I ran

# cd /etc/httpd/conf
# openssl req -new -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt -days 1095
# chmod 400 server.key

And completed the required information. Thus, I modified the file in "/etc/httpd/conf/extra/httpd-ssl.conf" like so;

...
SSLCertificateFile "/etc/httpd/conf/server.crt"
...
SSLCertificateKeyFile "/etc/httpd/conf/server.key"
...

And now as the title says, the service fails. Before that everything worked perfectly.

What did I miss?

Error logs:

$ cat /var/log/httpd/error_log 
[Wed May 16 23:05:02.217456 2018] [mpm_prefork:notice] [pid 2424] AH00163: Apache/2.4.33 (Unix) PHP/7.2.5 configured -- resuming normal operations
[Wed May 16 23:05:02.217573 2018] [core:notice] [pid 2424] AH00094: Command line: '/usr/bin/httpd -D FOREGROUND'
[Wed May 16 23:07:53.317126 2018] [mpm_prefork:notice] [pid 2424] AH00170: caught SIGWINCH, shutting down gracefully
[Wed May 16 23:08:34.790934 2018] [mpm_prefork:notice] [pid 794] AH00163: Apache/2.4.33 (Unix) PHP/7.2.5 configured -- resuming normal operations
[Wed May 16 23:08:34.806875 2018] [core:notice] [pid 794] AH00094: Command line: '/usr/bin/httpd -D FOREGROUND'
[Wed May 16 23:14:24.664494 2018] [mpm_prefork:notice] [pid 794] AH00169: caught SIGTERM, shutting down

SOLVED

It was a syntax error. Apparently you can't use comments on the side of the text in httpd.conf, like:

LoadModule ... #hello

Last edited by CarterCox (2018-05-17 12:41:32)

Offline

#2 2018-05-17 02:44:47

loqs
Member
Registered: 2014-03-06
Posts: 5,968

Re: [SOLVED]httpd.service fails after configuring SSL

Apache_HTTP_Server#Apache_Status_and_Logs  What does the log show?

Offline

#3 2018-05-17 02:57:04

CarterCox
Member
From: US
Registered: 2018-02-24
Posts: 113

Re: [SOLVED]httpd.service fails after configuring SSL

loqs wrote:

Probably a good idea. Added it to the OP for newcomers.

Offline

#4 2018-05-17 06:12:30

seth
Member
Registered: 2012-09-03
Posts: 8,453

Re: [SOLVED]httpd.service fails after configuring SSL

How does the service "fail" (status?)
Is there only the error log?
Whom does the certificate belong to and as what user do you run httpd?

Offline

#5 2018-05-17 11:34:01

CarterCox
Member
From: US
Registered: 2018-02-24
Posts: 113

Re: [SOLVED]httpd.service fails after configuring SSL

seth wrote:

How does the service "fail" (status?)
Is there only the error log?
Whom does the certificate belong to and as what user do you run httpd?

I think this is what you mean:

$ systemctl --failed
UNIT          LOAD   ACTIVE SUB    DESCRIPTION                                       
● httpd.service loaded failed failed Apache Web Server

There is also "access_log": https://pastebin.com/raw/w2pdLtvh

And I'm running it as root I guess. I used:

# systemctl enable httpd.service

Oh sorry, the key file belongs to root with permission 400.

Last edited by CarterCox (2018-05-17 11:34:52)

Offline

#6 2018-05-17 12:15:57

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 8,266
Website

Re: [SOLVED]httpd.service fails after configuring SSL

Check

journalctl -u httpd.service

to see why the service is failing.


Sakura:-
Mobo: MSI X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: nVidia GeForce GTX 970 // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 5x 1TB HDD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#7 2018-05-17 12:35:34

seth
Member
Registered: 2012-09-03
Posts: 8,453

Re: [SOLVED]httpd.service fails after configuring SSL

And/or "systemctl status httpd".
Also

I'm running it as root I guess.

don't guess, look. I guess not.

Offline

#8 2018-05-17 12:41:00

CarterCox
Member
From: US
Registered: 2018-02-24
Posts: 113

Re: [SOLVED]httpd.service fails after configuring SSL

Added the stupid solution on the OP.

Thanks everyone.

Offline

Board footer

Powered by FluxBB