Example apache vhost file

I have repeatedly run through the certbot setup on my ubuntu 16.04/apache2 box but despite the script claiming it was setup successfully when I visit my site I no longer get the default site. I just get:

mysite.example sent an invalid response.
ERR_SSL_PROTOCOL_ERROR

Is there any examples of vhost files I can use to figure out what is going on?
I have many subdomains to also setup but first I need to get the default site working again.

certbot killed all the sites that were working.

1 Like
# PORT 443 SSL CONFIG
# *******************

<IfModule mod_ssl.c>
<VirtualHost *:443>
DocumentRoot /var/www/mysite/
ServerName mysite.com
ServerAlias www.mysite.com
ErrorLog ${APACHE_LOG_DIR}/mysite-error.log
CustomLog ${APACHE_LOG_DIR}/mysite-access.log

<Directory "/var/www/mysite/">
Options +Includes
Options +FollowSymLinks -Indexes
</Directory>

SSLCertificateFile /etc/letsencrypt/live/mysite.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mysite.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/mysite.com/chain.pem
</VirtualHost>
</IfModule>

# PORT 80 REDIRECT CONFIG
# ***********************

<VirtualHost *:80>
ServerName mysite.com
ServerAlias www.mysite.com
ErrorLog ${APACHE_LOG_DIR}/mysite-error.log
CustomLog ${APACHE_LOG_DIR}/mysite-access.log
Redirect permanent / https://mysite.com/
</VirtualHost>
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.