I want to use Letsencrypt.
My web site name is "mydomain.net" ==> It is an example.
When I installed the CentOS 8, I left the domain setting default (localhost.localdomain) and I installed and configured the LAMP and Letsencrypt. Everything worked correctly till I changed my "hostname" and "hosts" files as below:
Code: Select all
# cat /etc/hostname
#localhost.localdomain
mydomain
# cat /etc/hosts
#127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
"My Server IP" mydomain.net mydomain
After it my server show me "Your connection is not private" error and I can't browse my website.
I googled and find a page that told it is because of "localhost.key" and "localhost.crt" files. because I changed the default hostname.
I removed these files and "certbot":
Code: Select all
# rm /etc/pki/tls/private/localhost.key
# rm /etc/pki/tls/private/mydomain.key
# rm /etc/ssl/certs/mydomain.crt
# rm /etc/ssl/certs/localhost.crt
And after it I used below command to generate a default key:
This command, generated "localhost" files and I want to configure my Virtual Host from start.
In "httpd.conf":
And Virtual Host file is as below:
Code: Select all
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName mydomain.net
DocumentRoot /var/www/wordpress
<Directory "/var/www/wordpress">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
ErrorLog /var/log/httpd/wordpress_error.log
CustomLog /var/log/httpd/wordpress_access.log common
</VirtualHost>
Is everything OK to use "certbot"?