Question

I am not able to install my godaddy ssl certificate on my ubuntu server.

Posted May 15, 2021 97 views
UbuntuApache

As I was following the tutorial https://www.digitalocean.com/community/tutorials/how-to-install-an-ssl-certificate-from-a-commercial-certificate-authority.
I have tried the same steps as mentioned above many times, but my website hasn’t turned to https. Please help me out with this. I have purchased my ssl from godaddy and want to install it on my apache ubuntu server.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hello, @cs19150

Keep in mind that installing the SSL Certificate and setup the redirection from HTTP to HTTPS are separate processes.

Once the SSL is installed you can complete the redirection in your .htaccess file or in the virtual host file. Would you mind sharing your virtual host and the .htaccess file as well? Have you tried to set up the redirection in the Vhost as mentioned in the article:

<VirtualHost *:80>
   ServerName example.com
   Redirect permanent / https://example.com/
</VirtualHost>

Regards,
Alex

  • Yes I have tried the redirection of Vhost in 000-default.conf file.

    The same I have copied below.

    <VirtualHost *:80>
       ServerName codeatrandom.com
       Redirect permanent / https://codeatrandom.com/
    </VirtualHost>
    
    
    <VirtualHost *:443>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        ServerName codeatrandom.com
    
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/codeatrandom.com
        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        SSLEngine on
        SSLCertificateFile /var/www/codeatrandom.com.crt
        SSLCertificateKeyFile /var/www/privatekey.key
        SSLCACertificateFile /var/www/intermediate.crt
    
    
        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
    
    </VirtualHost>
    

    This is the content of my 000-default.conf file

    edited by MattIPv4