操作“configtest”失败

操作“configtest”失败

我怎样才能解决这个问题?

我正在使用 Amazon EC2,它是另一个 EC2 实例的映像:

ubuntu@ip:~/LabelMeAnnotationTool-master$ sudo apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  apache2-bin apache2-data
Suggested packages:
  apache2-doc apache2-suexec-pristine apache2-suexec-custom apache2-utils
The following packages will be upgraded:
  apache2 apache2-bin apache2-data
3 upgraded, 0 newly installed, 0 to remove and 269 not upgraded.
Need to get 1,092 kB of archives.
After this operation, 18.4 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main apache2 amd64 2.4.7-1ubuntu4.17 [87.4 kB]
Get:2 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main apache2-bin amd64 2.4.7-1ubuntu4.17 [845 kB]
Get:3 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main apache2-data all 2.4.7-1ubuntu4.17 [160 kB]
Fetched 1,092 kB in 0s (22.3 MB/s)
(Reading database ... 96282 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.7-1ubuntu4.17_amd64.deb ...
Unpacking apache2 (2.4.7-1ubuntu4.17) over (2.4.7-1ubuntu4.8) ...
Preparing to unpack .../apache2-bin_2.4.7-1ubuntu4.17_amd64.deb ...
Unpacking apache2-bin (2.4.7-1ubuntu4.17) over (2.4.7-1ubuntu4.8) ...
Preparing to unpack .../apache2-data_2.4.7-1ubuntu4.17_all.deb ...
Unpacking apache2-data (2.4.7-1ubuntu4.17) over (2.4.7-1ubuntu4.8) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up apache2-bin (2.4.7-1ubuntu4.17) ...
Setting up apache2-data (2.4.7-1ubuntu4.17) ...
Setting up apache2 (2.4.7-1ubuntu4.17) ...
Installing new version of config file /etc/apache2/mods-available/mpm_prefork.load ...
Installing new version of config file /etc/apache2/mods-available/mpm_event.load ...
Installing new version of config file /etc/apache2/mods-available/mpm_worker.load ...
 * Restarting web server apache2                                                                                             [fail]
 * The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 61 of /etc/apache2/sites-enabled/000-default.conf:
SSLCertificateFile: file '/etc/apache2/ssl/d288922d35efb1b0.crt' does not exist or is empty
Action 'configtest' failed.
The Apache error log may have more information.
invoke-rc.d: initscript apache2, action "restart" failed.
ubuntu@ip:~/LabelMeAnnotationTool-master$ sudo ^C
ubuntu@ip:~/LabelMeAnnotationTool-master$ apache2ctl configtest
AH00526: Syntax error on line 61 of /etc/apache2/sites-enabled/000-default.conf:
SSLCertificateFile: file '/etc/apache2/ssl/d288922d35efb1b0.crt' does not exist or is empty
Action 'configtest' failed.
The Apache error log may have more information.

我正在尝试按照本教程第 2 页末尾的说明进行操作: http://cs-people.bu.edu/sameki/blog1.pdf

答案1

SSLCertificateFile: file '/etc/apache2/ssl/d288922d35efb1b0.crt' does not exist or is empty
Action 'configtest' failed.

您缺少一个 crt 文件。您应该转到原始 ec2 实例,找到该文件,然后将其 SCP 到您新启动的实例。

答案2

sudo vi /etc/apache2/sites-enabled/000-default.conf从 godaddy 下载标准 SSL 证书后,我必须更新 .crt 和 .key。

现在我得到:

~$ apache2ctl configtest
Syntax OK

相关内容