Virtual host not responding, apache2 problem

Roger Ghostraven Posted in Technical Support 6 years ago

I have set up a LAMP server on AWS to reinstall OSSN. I had OSSN running like this for over a year before taking the site down a few months ago. Now it seems I have forgotten what I know about Apache2.

My server name is server01.digilife.gq, there is a PTR record that points to that as well
I have a records for server01.digilife.gq and www.digilife.gq
If I use server1 I can get to the configuration page and all is well
If I use www I get connection refused

My virtualhost file is as follows.

 <VirtualHost *:80>
 ServerAdmin [email protected]
 DocumentRoot /var/www/html/ossn/
 ServerName server01.digilife.gq
 ServerAlias www.digilife.gq
 <Directory /var/www/html/ossn/>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    allow from all
 </Directory>
 ErrorLog /var/log/apache2/ossn_log
 CustomLog /var/log/apache2/ossn_custom_log common

</VirtualHost>

I am stumped. Please help.

Replies
us Roger Ghostraven Replied 6 years ago

Arsalan,

There was something screwed up on my domain name provider. I deleted the entire NS zone and redid the records and it didn't fix it. I got another domain, avatarliving.gq, and it worked. Thank you everyone for the help.

Indonesian Arsalan Shah Replied 6 years ago

The topic you created is about virtual host. Now i can guess that you have installed ossn on server01 , and your www.digi... pointing to same server.

It make sense that when you visit digi... it redirect to server01 becuase ossn redirect it to the installed URL.

Now its me who thinks that the way you trying to setup virtual hosts are not correct. You can find a way to host multiple domains on same server using apache vhost. If you are not sure how to configure these simply install server management tool like cpanel, etc. Free are also available.

gb Rishi B Replied 6 years ago

it could also be a redirect that was setup from wherever you manage your domain's dns info. most dns providers have an option for web redirects, and will usually have separate entries for each node (i.e. www, root, etc), so that might also explain why you have different behavior for the www subdomain and the root domain. I'm pretty sure Z-Man and Arsalan covered all the other possibilities (at least that I can think of).

German Michael Zülsdorff Replied 6 years ago

Running nslookup both on server01.digilife.gq and www.digilife.gq results in the same address (52.14.95.196)
So, your name resolving is basically ok.

Make sure you have no (old?) .htaccess file lying around somewhere with a 301 redirect inside, because I'm getting a 301 redirect when pointing my browser to the www url.

In case you have and removed it: Don't be surprised if your browser still redirects to server01, because browsers remember a permanent redirection forever if you don't clean it manually. See
https://beeznest.com/blog/2017/04/20/remove-301-redirect-cache-in-firefox/

Last not least: Check your /etc/hosts file to include and resolve the www address correctly.

us Roger Ghostraven Replied 6 years ago

Thank you for looking Arsalan. When I used a different browser profile I got the redirect but I don't know where/why it's redirecting. I followed my detailed setup notes from last year and it didn't redirect then. Any suggestions?

Indonesian Arsalan Shah Replied 6 years ago

I checked and found http://www.digilife.gq/ is performing redirection on server01....