0

I have newly installed apache2 and by visiting localhost apache2 is shown to be up and running. I want the same to happen when I put app in the browser. When I do try to go visit app the browser gives a Unable to connect message.

What I have done so far

I changed my etc/hosts/ file to include app.

127.0.0.1   localhost app
127.0.1.1   ubuntu
...

I would then expect http://app/ to resolve to the apache2 page(as I want it to), but that doesn't happen. Therefore I tried to ping app. This worked and was shown to resolve to 127.0.0.1.

Next I tried to restart apache2, but the result stayed the same.

Why do I get Unable to connect message and how do I make it redirect me to apache2?

EDIT:

I've tried to add app here too.

<VirtualHost *:80>
    ServerName app
    ServerAlias www.app
    ServerAdmin webmaster@app
    DocumentRoot /var/www/app

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

I then run the command a2ensite app.conf and then I restart apache2 with systemctl reload apache2.

Still when I put app in the browser field I get a Unable to connect message.

Mr Krisey
  • 3
  • 4

0 Answers0