I have a website www.example.com
that is hosted on apache2 web server in /var/www/example.com
directory and the virtual host config file is
<VirtualHost *:80>
ServerAdmin admin@gmail.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/public
<Directory /var/www/example.com/public/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml >
</IfModule>
</VirtualHost>
I have installed let's encrypt certificate for this domain.
Now I have to change configuration settings and the config file should be like this:
<VirtualHost *:80>
ServerAdmin admin@gmail.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/dist //here is the change
<Directory /var/www/example.com/dist/> //here is the change
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml >
</IfModule>
</VirtualHost>
I have edited the config file and ran command certbot --apache -d example.com -d www.example.com
. Chose reinstall
and renew
both options and the installation was successful in both cases. But when I go to example.com
then it shows 404 error
. How can I solve my problem?
My domain is: alvismathpoint.com
I ran this command: certbot --apache -d alvismathpoint.com -d www.alvismathpoint.com
It produced this output: Successfully installed certificate
My web server is: apache2
The operating system my web server runs on is: Ubuntu 20.04.1 LTS
My hosting provider is: Digital Ocean
I can login to a root shell on my machine: yes
I'm using a control panel to manage my site: no
The version of my client is:certbot 0.40.0