gpt4 book ai didi

http - 当我尝试访问 ssl.conf 文件时服务器停止工作

转载 作者:太空宇宙 更新时间:2023-11-03 15:12:33 24 4
gpt4 key购买 nike

我目前正在尝试在 Debian 平台上使用 apache2 创建一个页面来托管一个应用程序,但是当我使用 a2ensite HTTP 版本时它就不起作用了,当我启用 ssl 时,整个服务器都停止工作,即使是与该页面无关的页面。两个 conf 文件都很好,我卡住了,知道哪里出了问题吗?

编辑:日志显示,在 09:06:37,我 a2ensite,并停止工作,在 09:07:01,我 a2dissite,它再次工作:

[Fri Jul 13 09:06:37.059026 2018] [mpm_prefork:notice] [pid 20067] AH00171: 
Graceful restart requested, doing restart
[Fri Jul 13 09:06:37.245485 2018] [mpm_prefork:notice] [pid 20067] AH00163:
Apache/2.4.10 (Debian) OpenSSL/1.0.1t configured -- resuming normal operations
[Fri Jul 13 09:06:37.245513 2018] [core:notice] [pid 20067] AH00094: Command
line: '/usr/sbin/apache2'
[Fri Jul 13 09:07:01.050648 2018] [mpm_prefork:notice] [pid 20067] AH00171:
Graceful restart requested, doing restart
[Fri Jul 13 09:07:01.171448 2018] [mpm_prefork:notice] [pid 20067] AH00163:
Apache/2.4.10 (Debian) OpenSSL/1.0.1t configured -- resuming normal
operations
[Fri Jul 13 09:07:01.171475 2018] [core:notice] [pid 20067] AH00094: Command
line: '/usr/sbin/apache2'

编辑:两个 .Conf 文件内容:

<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerAdmin (...)
DocumentRoot /var/www/html/(site)
ServerName (site)

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf

<Directory "/var/www/html/(site)">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>

RewriteEngine on
RewriteCond %{SERVER_NAME} =(site)
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

SSL 之一:

<IfModule mod_ssl.c>
<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerAdmin (...)
DocumentRoot /var/www/html/(site)
ServerName (site)

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf

<Directory "/var/www/html/(site)">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>


</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
</IfModule>

最佳答案

1. disable site like: a2dissite default-ssl.conf
2. Restart apache like: service apache2 reload
3. Now enable site like: a2ensite default-ssl.conf 5 Restart apache again like: service apache2 reload

关于http - 当我尝试访问 ssl.conf 文件时服务器停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51299184/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com