Score:0

pointing sub domain to AWS EC2 server, website not displaying

br flag

The main domain is pointed on other AWS EC2 instance and due to the subdomain is a staging site so I launch another AWS EC2 instance, installed Apache, added the subdomain vhost to default .conf at /etc/apache2/sites-enabled/000-default.conf

<VirtualHost *:80>
    ServerName subdomain.maindomain.com
    ServerAlias www.subdomain.maindomain.com
    ServerAdmin [email protected]
    DocumentRoot /var/www/html/subdomain

    <Directory /var/www/html/subdomain>
        Options Indexes FollowSymLinks MultiViews
        Require all granted
        #Options -Indexes +FollowSymLinks
        AllowOverride All
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/subdomain.maindomain.com-error.log
    CustomLog ${APACHE_LOG_DIR}/subdomain.maindomain.com-access.log combined
</VirtualHost>

Its been 24 hours already and website is not displaying at all

This site can’t be reached subdomain.maindomain.com refused to connect.

and I ping the subdomain.maindomain.com and it giving me the correct AWS EC2 server IP. What could be wrong here? any help, suggestions, recommendations is greatly appreciated. Thank you

Server is AWS EC2 with ubuntu 20.4 OS

in flag
Just to confirm, you have a `.` before `com` in your `ServerName` and `ServerAlias` values, yes? Have you confirmed that the alias file is being read?
Juliver Galleto avatar
br flag
@matigo my mistake, it should be .com. I wrote it wrong. I updated my post.
in flag
Have you restarted Apache? `sudo service apache2 restart` will re-read all the configurations into memory. Alternatively, you may want to throw some wildcards on your `ServerAlias` to capture all traffic
Juliver Galleto avatar
br flag
@matigo yes does several restarts with no luck
in flag
I was in the midst of writing an answer with a bunch of things to check when I noticed that you are redirecting to `https`, but there is no `*:443` configuration in the contents of the question. Do you have an Apache configuration file that is listening on port 443 and has a valid SSL certificate installed?
Juliver Galleto avatar
br flag
@matigo yes, theres ssl and port :443 but even removing the https and just http alone, still not able to display. I updated my post with just http
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.