Ubuntu

操作“configtest”失敗

  • September 17, 2017

我怎樣才能解決這個問題?

我正在使用 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

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

您缺少一個 crt 文件。您應該轉到原始 ec2 實例,找到該文件,然後將其 SCP 到您新啟動的實例中。

sudo vi /etc/apache2/sites-enabled/000-default.conf從 godaddy 下載標準 SSL 證書後,我必須更新 .crt 和 .key 。

現在我得到:

~$ apache2ctl configtest
Syntax OK

引用自:https://serverfault.com/questions/874133