提问人:Domenico 提问时间:10/28/2023 更新时间:10/28/2023 访问量:24
Apache 不以 “SSL 引擎开启” 开头 - Arch linux
Apache doesn’t start with “SSL Engine on” - Arch linux
问:
我正在尝试在虚拟主机上启用 SSL... TSL部分:https://wiki.archlinux.org/title/Apache_HTTP_Server#TLS
我生成证书:
cd /etc/httpd/conf
sudo openssl genpkey -algorithm RSA -out server.key 1 ✘
sudo openssl req -new -sha256 -key server.key -out server.crt
取消在“/etc/httpd/conf/httpd.conf”中的注释:
LoadModule ssl_module modules/mod_ssl.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
Include conf/extra/httpd-ssl.conf <- this cause apache error
Apache (httpd) 不再启动...
一旦我使用:Apache 无法启动......SSLEngine on
我的虚拟主机:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/home/user/www/saniday"
ServerName saniday.test
ServerAlias saniday.test
ErrorLog "/var/log/httpd/saniday.test-error_log"
CustomLog "/var/log/httpd/saniday.test-access_log" common
<Directory "/home/user/www/saniday">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
DirectoryIndex index.php index.html
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php-fpm/php-fpm.sock|fcgi://localhost/"
</FilesMatch>
</VirtualHost>
<VirtualHost *:443>
ServerAdmin [email protected]
DocumentRoot "/home/user/www/saniday"
ServerName saniday.test:443
ServerAlias saniday.test:443
ErrorLog "/var/log/httpd/saniday.test-error_log"
CustomLog "/var/log/httpd/saniday.test-access_log" common
SSLEngine on # <- this cause apache error
SSLCertificateFile "/etc/httpd/conf/server.crt"
SSLCertificateKeyFile "/etc/httpd/conf/server.key"
<Directory "/home/user/www/saniday">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
DirectoryIndex index.php index.html
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php-fpm/php-fpm.sock|fcgi://localhost/"
</FilesMatch>
</VirtualHost>
我的控件...
$ apachectl configtest
> Syntax OK
使用以下命令生成证书:
sudo openssl req -new -newkey rsa:2048 -nodes -keyout /etc/httpd/conf/ssl/server.key -out /etc/httpd/conf/ssl/server.csr
似乎只要我在配置文件中输入“SSLEngine on”,Apache就无法启动。 我需要安装任何软件包吗?
错误:
× httpd.service - Apache Web Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; preset: disabled)
Active: failed (Result: exit-code) since Sat 2023-10-28 16:41:26 CEST; 2s ago
Duration: 30ms
Process: 21651 ExecStart=/usr/bin/httpd -k start -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 21651 (code=exited, status=1/FAILURE)
CPU: 21ms
ott 28 16:41:26 Domenico-PC systemd[1]: Started Apache Web Server.
ott 28 16:41:26 Domenico-PC systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
ott 28 16:41:26 Domenico-PC systemd[1]: httpd.service: Failed with result 'exit-code'.
答: 暂无答案
评论