I'm using Apache/2.2.22 (Debian) on Google Compute Engine with a Wordpress Install (click-to-deploy).
I'm trying to setup an SSL certificate (https) for the Wordpress install. I've created a static IP, a private key, a CSR and have uploaded SSL & intermediate crt files (from freeSSL.com) to etc/apache2/ssl
(with the private key) and given this folder root:root
permission.
I've followed https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-debian-7 and updated default-ssl config file as instructed (updating pathnames to .crt and .key files, ServerName and ServerAdmin).
I ran a configtest (got syntax OK), enabled default-ssl and rebooted apache. When I visit https://domain
or https://ip-address
, I get a "This Webpage is Unavailable" error (ERR_CONNECTION_CLOSED). The wordpress install still loads ok on http.
The SSL checker at https://www.digicert.com/help/ gives me a "no certificates found" error, although the certificates are there.
Here's what worked for me;
First attempt to enable HTTPS with the checkbox in the Compute | Compute Engine | VM Instances config settings. Should this fail with an error message you can add a firewall rule directly...
On the Compute | Compute Engine | Networks page, select the 'default' network. Then under 'Firewall rules' click 'Add a new rule'. Use the following settings;
All of the above is assuming that you have exhausted all the other apache configuration options (ports.conf, Virtual Hosts etc).
Here is the solution :
Install VM – WordPress (Solution provided by Google cloud servers), my OS is Debian 7 or Built in Google Wordpress.
Dot forgot to allow firewall at Google cloud console
Install Open SSH Key and access SSH (maybe using Putty)
Connect/login ssh (using Putty) or other terminal
Change user (SSL terminal)
$ sudo su
now edit by vi/nano
add this lines
Also all certificate details, which you might need to purchase form provider
SSLCertificateFile /etc/a..../...../..../gulfstatesoftware_com.crt SSLCertificateKeyFile /etc/a..../...../..../gulfstatesoftware_com.key SSLCertificateChainFile /etc/a..../...../..../gulfstatesoftware_com.ca-bundle
and # key which doesn't required.
Save and exit.
Run this commands in terminal :
You might wants to fix Permalink : (www.example.com/my-blog-url), thats also in wordpress.conf file.
# nano /etc/apache2/sites-available/wordpress.conf
Change :AllowOverride All
add .htaccess to /var/www/html
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>