I'can reach my site after i try to install ssl certificate.

August 16, 2018 2.4k views
WordPress Apache DigitalOcean Linux Commands Ubuntu 16.04

Hi, i have a LAMP server and i install it Wordpress and there is no problem in my site until 2 weeks ago, i bought ssl certificate from godaddy.com and i did whatever https://www.digitalocean.com/community/tutorials/how-to-install-an-ssl-certificate-from-a-commercial-certificate-authority
this tutorial says. And it didin’t work and after i did this things i cant reach my site anymore. So i try some other things but none of them works.

My site: http://gobokolektif.com/ or https://gobokolektif.com/

My “000-default.conf” looks like this:

<VirtualHost *:80>
        ServerName gobokolektif.com
        ServerAlias www.gobokolektif.com


      DocumentRoot /var/www/html
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/html>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
                Require all granted
    </Directory>

</VirtualHost>

<VirtualHost *:443>
        ServerName gobokolektif.com
        ServerAlias www.gobokolektif.com


    <Directory /var/www/html>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
                Require all granted
    </Directory>


        ServerAdmin root@gobokolektif.com
        DocumentRoot /var/www/html
        SSLEngine on
        SSLCertificateFile /etc/ssl/gobokolektif.com.crt
        SSLCertificateKeyFile /etc/ssl/gobokolektif.com.key
        SSLCACertificateFile  /etc/ssl/intermediate.crt


        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

My “default-ssl.conf” looks like this:

<IfModule mod_ssl.c>
    <VirtualHost _default_:443>
        ServerAdmin root@localhost
                ServerName gobokolektif.com:443

        DocumentRoot /var/www/html
        <Directory /var/www/html>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
                        Require all granted
             </Directory>


        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

                SSLEngine on
                SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
        SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key


        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>
        <Directory /usr/lib/cgi-bin>
                SSLOptions +StdEnvVars
        </Directory>


    </VirtualHost>
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

My ports.conf looks like this:

Listen 80



<IfModule ssl_module>

Listen 443
</IfModule>

<IfModule mod_gnutls.c>
Listen 443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

My “apache2.conf” looks like this:

Mutex file:${APACHE_LOCK_DIR} default

PidFile ${APACHE_PID_FILE}

Timeout 300

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 5


User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

HostnameLookups Off


ErrorLog ${APACHE_LOG_DIR}/error.log


LogLevel warn


IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf


Include ports.conf


<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

#<Directory /srv/>
#   Options Indexes FollowSymLinks
#   AllowOverride None
#   Require all granted
#</Directory>


AccessFileName .htaccess


<FilesMatch "^\.ht">
    Require all denied
</FilesMatch>



LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent




IncludeOptional conf-enabled/*.conf


IncludeOptional sites-enabled/*.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
ServerName localhost

My ssl certtificates are in : /etc/ssl/

https://ibb.co/kjEn39

When i try to write “-f /var/log/apache2/error.log” for what happening its says:

https://ibb.co/gqkGwU

I’m exhausted i dont know how to fix this mess, anybody can help me ?

1 Answer

Heya,

It seems that the ports 80 and 443 are not open on the server your domain points to. The main reason that might be is that the webserver is not running. What does /etc/init.d/apache2 start or service httpd start say?

  • it says : [ ok ] Starting apache2 (via systemctl): apache2.service.

    • Ok so it seems that the 80 and 443 are closed for some reason by a firewall(maybe?) Try running iptables-save and you should be able to see if those 2 ports are being rejected. Or if ubuntu firewall is active(assuming your OS is ubuntu) you may want to run ufw disable to see if maybe it has been set to reject those 2 ports. I’ve run a scan on the ip your domain resolves to with nmap and i get a “closed” result on 80 and 443 which can only mean that the firewall is rejecting the traffic on these 2 ports for some reason. Let me know if you are successful in resolving this issue.

Have another answer? Share your knowledge.