-1

I configured a site to be served via SSL on my server but it's not available at all.

$ nmap localhost
PORT     STATE SERVICE
22/tcp   open  ssh
25/tcp   open  smtp
80/tcp   open  http

My firewall allows port 443 in and the apache2 service is running.

There seems to be the general problem that, although included in the apache2.conf, the file /etc/apache2/sites-enabled/default-ssl.conf is not taken into account.

$ apache2ctl -S
VirtualHost configuration:
1.23.45.67:80         is a NameVirtualHost
         default server 12345.yourvserver.net (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost 12345.yourvserver.net (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost my.doma.in (/etc/apache2/sites-enabled/000-default.conf:31)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex rewrite-map: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl 
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=99
Group: name="www-data" id=99

The ports.conf states the following:

Listen 80

<IfModule ssl_module>
        Listen 443
</IfModule>

<IfModule mod_ssl.c>
        Listen 443
</IfModule>

<IfModule mod_gnutls.c>
        Listen 443
</IfModule>

Excluding the commented lines, apache2.conf looks like this:

ServerName localhost
Mutex file:${APACHE_LOCK_DIR} default
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
Include ports.conf
<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

AccessFileName .htaccess

<FilesMatch "^\.ht">
        Require all denied
</FilesMatch>

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

IncludeOptional conf-enabled/*.conf

IncludeOptional sites-enabled/*.conf

There is an error, too, but I could not solve it following the most popular answer in this thread (And I don't understand why the envvars should have anything to do with the directory where the public files reside.)

$ apache2 -V
[Tue Dec 02 16:31:03.757529 2014] [core:warn] [pid 26148] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Tue Dec 02 16:31:03.757949 2014] [core:warn] [pid 26148] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Tue Dec 02 16:31:03.758019 2014] [core:warn] [pid 26148] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Tue Dec 02 16:31:03.758148 2014] [core:warn] [pid 26148] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Tue Dec 02 16:31:03.758305 2014] [core:warn] [pid 26148] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Tue Dec 02 16:31:03.769627 2014] [core:warn] [pid 26148] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Tue Dec 02 16:31:03.770168 2014] [core:warn] [pid 26148] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Tue Dec 02 16:31:03.770236 2014] [core:warn] [pid 26148] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Tue Dec 02 16:31:03.770376 2014] [core:warn] [pid 26148] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Tue Dec 02 16:31:03.770433 2014] [core:warn] [pid 26148] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}
-1

Okay, this is some kind of embarrassing. I forgot to run a2enmod ssl.

  • I hope voting down my question as "This question does not show any research effort; it is unclear or not useful" AND my answer as "This answer is not useful" made you feel superior or at least contributed to the growth of your ego. Even though it seems like a beginner's error, it might be useful for people. I might not be the first one spending hours on a problem which has a very simple solution. – Steven Dec 11 '14 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.