1

I installed Apache on my EC2 instance to serve my website. I bought the domain for the website from GoDaddy.

To serve the website on AWS hosted EC2 instance, I created a hosted zone in Route53 for the purchased domain from GoDaddy.

I updated the nameservers that I got after creating the hosted zone in Route53 in the GoDaddy DNS Panel.

After this nameserver updation, I created an A record in the hosted zone of Route53 pointing to the public IP of the EC2 instance created for serving my website.

But still, I am not able to access my website served on the EC2 instance using Apache through the domain.

enter image description here

I updated the nameservers in the GoDaddy Panel on Monday (26-February-2024) and it has been almost 2 days since the update but still the website is not being served on the intended domain.

Here, is my Apache config file:

<VirtualHost *:80>
        # 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 www.example.com

        ServerAdmin webmaster@localhost
        ServerName test.instabook.app
        DocumentRoot /var/www/html

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

        # 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

        # 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
        RewriteEngine on
        RewriteCond %{SERVER_NAME} =test.instabook.app
        RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

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

I am not able to understand why the website is not being served despite performing all the needed tasks.

0

1 Answer 1

1

The Apache config is only set for HTTP (80) and browsers are attempting to connect via HTTPS (443).

Your best solution is to purchase an SSL certificate an install it on the server. You can test with a self-signed SSL certificate.

Checking DNS propagation on DNS Checker shows the DNS properly propagated; all nodes point to the destination address:

3.110.225.226

I further tested your site by running the following Curl command; and it quickly returned clean response headers via basic HTTP:

curl -ILk http://test.instabook.app

Which results in this:

HTTP/1.1 200 OK
Date: Thu, 29 Feb 2024 04:14:16 GMT
Server: Apache/2.4.52 (Ubuntu)
Last-Modified: Wed, 28 Feb 2024 11:33:38 GMT
ETag: "1268-6126f83916814"
Accept-Ranges: bytes
Content-Length: 4712
Vary: Accept-Encoding
Content-Type: text/html

But it always hangs until timeout if I use HTTPS:

curl -ILk https://test.instabook.app

Hangs a long while and then returns:

curl: (28) Failed to connect to test.instabook.app port 443: Operation timed out

The problem is most probably your browser is attempting to force HTTPS when you are only running the sever (currently) on plain on HTTP.

Your best solution is to purchase an SSL certificate an install it on the server. You can test the Apache setup with a self-signed SSL certificate; but please get a real certificate for your site.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .