cd /data/soft wget https://dl.eff.org/certbot-auto chmod a+x certbot-auto
2、生成证书
/data/soft/certbot-auto –apache certonly
1 2 3 4 5
Saving debug log to /var/log/letsencrypt/letsencrypt.log Could not choose appropriate plugin: The apache plugin is not working; there may be problems with your existing configuration. The error was: NoInstallationError('Cannot find Apache executable apachectl',) The apache plugin is not working; there may be problems with your existing configuration. The error was: NoInstallationError('Cannot find Apache executable apachectl',)
Saving debug log to /var/log/letsencrypt/letsencrypt.log Could not choose appropriate plugin: The apache plugin is not working; there may be problems with your existing configuration. The error was: NoInstallationError('Could not find configuration root',) The apache plugin is not working; there may be problems with your existing configuration. The error was: NoInstallationError('Could not find configuration root',)
Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator apache, Installer apache No names were found in your configuration files. Please enter in your domain name(s) (comma and/or space separated) (Enter 'c' to cancel): www.test.com Obtaining a new certificate Performing the following challenges: http-01 challenge for www.test.com Cleaning up challenges Unable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the CA that you control your domain. Please add a virtual host for port 80.
httpd: Syntax error on line 434 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/mod_ssl.so into server: /usr/local/apache2/modules/mod_ssl.so: cannot open shared object file: No such file or directory
httpd: Syntax error on line 434 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/mod_ssl.so into server: /usr/local/apache2/modules/mod_ssl.so:undefined symbol: ap_global_mutex_create
httpd: Syntax error on line 434 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/mod_ssl.so into server: /usr/local/apache2/modules/mod_ssl.so: undefined symbol: ssl_cmd_SSLPassPhraseDialog
需要指定openssl路径,执行以下命令:
1
/usr/local/apache2/bin/apxs -a -i -c -L/usr/lib/openssl/engines/lib -c *.c -lcrypto -lssl -ldl
再次重启apache
1
httpd: Syntax error on line 434 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/mod_ssl.so into server: /usr/local/apache2/modules/mod_ssl.so:undefined symbol: ap_global_mutex_create