hey ill try to keep this succinct, if youre busy no worries, i can work on this in coming week. got my domain to redirect to www prefix, using this rewrite snippet, however it only worked if ServerName was www.skylinedev.net. Not sure if this is correct/bad, but ran into some issues in the lets encrypt wizard, which in this guide is made to look so painless :
(Firstly I set up two A records on digitalocean, for @ MYSITESIPADDRESS and www MYSITESIPADDRESS) https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-16-04 # Allow All for .htaccess sudo nano /etc/apache2/sites-available/000-default.conf <Directory /var/www/html> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> sudo a2enmod rewrite sudo nano /var/www/html/.htaccess RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] <VirtualHost *:80> ServerName www.skylinedev.net WSGIDaemonProcess sld python-home=/var/www/ SkylineDevelopment/FlaskApp/FlaskApp/venv WSGIProcessGroup sld WSGIApplicationGroup %{GLOBAL} WSGIScriptAlias / /var/www/SkylineDevelopment/FlaskApp/flaskapp.wsgi <Directory /var/www/SkylineDevelopment/FlaskApp/> Order allow,deny Allow from all </Directory> Alias /static /var/www/SkylineDevelopment/FlaskApp/FlaskApp/static <Directory /var/www/SkylineDevelopment/FlaskApp/FlaskApp/static/> Order allow,deny Allow from all </Directory> ErrorLog /var/www/SkylineDevelopment/logs/error.log LogLevel warn CustomLog /var/www/SkylineDevelopment/logs/access.log combined </VirtualHost> # test rewrite curl -I http://skylinedev.net HTTP/1.1 301 Moved Permanently Date: Sat, 31 Dec 2016 05:55:32 GMT Server: Apache/2.4.18 (Ubuntu) Location: http://www.skylinedev.net/ Content-Type: text/html; charset=iso-8859-1 If i run letsencrypt wizard command, i get this error. (Also checking the cert here shows MISMATCH, although I think cert is real https://www.ssllabs.com/ssltest/analyze.html?d=skylinedev.net&latest ) the wizard should run me through other options like forcing https etc, but fails. also said something wrong about line 4 of vhost as well. sudo letsencrypt --apache -d skylinedev.net <http://www.skylinedev.net/>-d www.skylinedev.net error: The selected vhost would conflict with other HTTPS VirtualHosts within Apache. Please select another vhost or add ServerNames to your configuration. # not used yet <VirtualHost *:443> ServerName www.skylinedev.net SSLEngine on SSLCertificateFile "/etc/letsencrypt/live/" SSLCertificateKeyFile "/etc/letsencrypt/keys/" </VirtualHost> -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/d/optout.
