I want to set up a website that’ll be accessed via IP. So I created a virtual server and entered the IP as the domain and gave it a directory name. I set that directory as the default page.
When I access the IP, I get the default virtualmin under construction page. When I try to access a PHP file that I uploaded, it shows the source code in plain text. How can I get this to work?
No, don’t put the IP address in the field where Virtualmin is expecting a domain name.
If you want a website associated with a virtual server to show when a visitor enters the IP address of Virtualmin in a web browser, you need to simply do this:
Virtualmin → Server Configuration → Website Options and then check the box captioned Default website for IP address.
I deleted the virtual server and re-created it with a domain name (DNS is still propagating). Virtualmin → Server Configuration → Website Option → Default website for IP address says Yes. No option to edit or select.
I created a PHP script and the output is still plain text.