Does the subdomain test exist? A subdomain is treated EXACTLY like a full fledged domain so it must be “registered” with the DNS and Apache for it to work. Otherwise, it looks okay.
Nope! You MUST declare the subdomain for it to find your Apache and have it serve files. Do you have cPanel? Setup the subdomain there. If this is for your own test server, add test.localhost as a VirtualHost and add it to the hosts file.