Apache 2 refusing to connect on VirtualHost - SOLVED

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
LuckyLinux1

Apache 2 refusing to connect on VirtualHost - SOLVED

Post by LuckyLinux1 »

Confused, I've done this a dozen times on other servers but can't get it working in Linux Mint.

This is a test environment. The apache2 server is the same as the client PC.

I've installed apache2 and can get to the test page.
I copied 000-default to a new file called test.conf and only changed the servername/alias (same document root):

<VirtualHost *:80>
ServerName test.foo
ServerAlias www.test.foo
DocumentRoot /var/www/html
</VirtualHost>

I enabled the site with a2ensite enable test

I disabled the firewall (ufw disable) as this is a test environment.
I edited /etc/hosts and added in 127.0.0.1 test.foo

When I try to visit http://test.foo, the site can't be reached (refused to connect).

What am I doing wrong? I can't seem to get a virtual host working and don't know how to troubleshoot.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
LuckyLinux1

Re: Apache 2 refusing to connect on VirtualHost

Post by LuckyLinux1 »

Scratch that, using .foo as a domain was the killer. Changed it to test.local and it was fine.
Locked

Return to “Software & Applications”