3

I'm attempting to create a BookStack site on an Amazon Lightsail instance.

I'm having an issue where my static public IP address attached to my Lightsail instance will go to my site just fine, from any browser or computer. However, my domain address I pointed to that same IP will time out and not work.

The OS is Ubuntu 18.04, IP is [IP], domain is [domain].dev.This is the script BookStack uses to setup on Ubuntu 18.04. Virtual host configuration is below.

I've tried/done the following:

  • I host with Google Domains and I've gone to my DNS and added A records for @ (base domain) and www that points to my static ip. Didn't work.
  • I created a DNS zone through the Lightsail console pointing @ and www to my static IP. I then added the Amazon nameservers to my Google Domain's nameservers instead of Google's. Didn't work.
  • I tried the above again using Route 53 and configuring the nameservers there instead of using Lightsail's DNS zones, but that didn't work either.

When I ping the static IP it times out and I don't get a response, but from what I've read online that can be normal for some website. When I ping my domain it resolves to the right IP address but also doesn't get a response.

I'm confused as to why pinging my domain gives me the right IP address but the website still refuses to load. I've been trying over multiple days so it shouldn't be a propagation issue. The website will load via IP but not by using the domain.

<VirtualHost *:80>
    ServerName [domain].dev

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/bookstack/public/

    <Directory /var/www/bookstack/public/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
        <IfModule mod_rewrite.c>
            <IfModule mod_negotiation.c>
                Options -MultiViews -Indexes
            </IfModule>

            RewriteEngine On

            # Handle Authorization Header
            RewriteCond %{HTTP:Authorization} .
            RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

            # Redirect Trailing Slashes If Not A Folder...
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteCond %{REQUEST_URI} (.+)/$
            RewriteRule ^ %1 [L,R=301]

            # Handle Front Controller...
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^ index.php [L]
        </IfModule>
    </Directory>

    ErrorLog /error.log
    CustomLog /access.log combined

</VirtualHost>
Ash
  • 41
  • 5
  • So you're saying you can access your website by IP, but not by domain? What's your domain name and IP address? What is listening on the port (Nginx, etc) and how is it configured to listen for connections (what's the config)? Please edit your question to give more details to help us help you, rather than putting information in comments. You should look at the firewall regarding ping, ICMP might be not be allowed through either the AWS firewall or the instance firewall. – Tim Jul 11 '19 at 01:28
  • @Tim I can access it by IP, but not by domain yes. I'm using Apache2 as that's what the setup script installs and sets up for you. I'll update the question with a link to the script that is used. I'm not used to all the inner workings of Apache or networking stuff in general so forgive my noob-ness – Ash Jul 11 '19 at 02:48
  • We can't really help with queries like this one without the domain name and IP address. – Tim Jul 11 '19 at 03:21
  • Welcome to ServerFault. Please update the original question with the information you have provided in the comments. Most don't read all the comments. – Pothi Kalimuthu Jul 11 '19 at 03:54
  • I can confirm I can access the site using IP, but not using your domain name. According to MXToolbox DNS is returning an A record with the correct IP for the domain name. Best guess is there's something not right with Apache - you'd have to add your virtual host configuration for someone who knows Apache to look at for you. – Tim Jul 11 '19 at 04:49

1 Answers1

1

So the solution was quite...interesting. To say the least I'm quite frustrated it has taken this long for me to figure this out but here it is:

From what I understand Google owns the .dev TLD and have since required an SSL certificate (https://) to host a domain on a .dev domain. Since I did not have one yet, it wasn't working. So the solution would be to either move to a new domain without .dev or add an SSL certificate to your site.

I've since moved to a different domain I own to make sure it works, and sure enough it does.

Ash
  • 41
  • 5