Я настроил сайт, который будет подаваться через SSL на моем сервере, но это не доступно вообще.
$ nmap localhost
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
Мой брандмауэр позволяет порт 443 в, и apache2 услуга работает.
Кажется, существует общая проблема что, хотя включено в apache2.conf
, файл /etc/apache2/sites-enabled/default-ssl.conf
не принят во внимание.
$ 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
ports.conf указывает следующее:
Listen 80
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_ssl.c>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
Исключая прокомментированные строки apache2.conf похож на это:
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
Существует ошибка также, но я не мог решить ее после самого популярного ответа в этом потоке (И я не понимаю, почему envvars должен иметь какое-либо отношение к каталогу, где общедоступные файлы находятся.)
$ 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}