--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: apache2: fails to start with SSL enabled (ports.conf)
- From: "Pascal A. Dupuis" <Pascal.Dupuis@worldonline.be>
- Date: Wed, 29 Aug 2007 12:30:58 +0200
- Message-id: <20070829103058.22358.9424.reportbug@localhost.>
Package: apache2.2-common
Severity: normal
Hello,
here's a snippet of ports.conf shipped with the package:
---
Listen 80
<IfModule mod_ssl.c>
## Listen 443
</IfModule>
--
if the second 'Listen' directive is uncommented, starting apache2
(/etc/init.d/apache2 [start|reload]) fails with:
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
no listening sockets available, shutting down
Unable to open logs
otherwise, everything run fine. A 'netstat -apn' doesn't show any
process bind to port 443.
A strace of 'apache2ctl start' reveals, for one of the child process,
the following problem:
open("/var/run/apache2.pid", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or
directory)
setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(4, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0
bind(4, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("0.0.0.0")},
16) = 0
listen(4, 511) = 0
setsockopt(6, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(6, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
setsockopt(6, SOL_TCP, TCP_NODELAY, [1], 4) = 0
bind(6, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("0.0.0.0")},
16) = 0
listen(6, 511) = 0
setsockopt(9, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(9, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
setsockopt(9, SOL_TCP, TCP_NODELAY, [1], 4) = 0
bind(9, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("0.0.0.0")},
16) = -1 EADDRINUSE (Address already in use)
write(2, "(98)Address already in use: make"..., 77) = 77
close(9) = 0
write(2, "no listening sockets available, "..., 46) = 46
write(2, "Unable to open logs\n", 20) = 20
Now, the funny part:
1) remove 'Listen 443'
2) restart apache2
3) netstat -ap | grep apache
tcp 0 0 *:www *:* LISTEN 22079/apache2
tcp 0 0 *:https *:* LISTEN 22079/apache2
So ... it seems the 'Listen 443' is automatic with a2enmod ssl ? I
guess the problem is a bad interaction between the
/etc/apache2/ports.conf and some of the installation scripts.
Best regards
Pascal Dupuis
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.22.5
Locale: LANG=fr_BE.UTF-8, LC_CTYPE=fr_BE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
--- End Message ---