Accessing a website with address

SYSTEM INFORMATION
Debian 12 REQUIRED
2.202 REQUIRED
7.30.3 Pro REQUIRED
Webserver version Apache 2.4.62
Related packages Virtual Server

On Virtualmin there are several virtual servers registered associated with various domains. On each VS there is an active website, mostly Joomla or Wordpress.
How can I access a certain website using only the IP Address of the server instead the domain?

The only way I can think of is to get each vm to listen on a different port e.g domain.1 listens on 1.1 1.1:8880 and 1.1.1.1:8843 and domain.2 listens on 1.1.1.1:8801 and 1.1.1.1:8844, but I cannot see a real world use for this as if you use a domain name to navigate to the vm you may have to append the port it’s listening on, why do you need to do this ?

We have some issues with using the domain that we are working on, but in the meantime I need to access the website.
I have not figured out how to redirect it to a specific port.

sounds like a job for .htaccess and redirection (but it has been years since I dabbled exclusively use nginx)

would editing your local HOSTS file help with your issue?

What does “VS” refer to in this context? Is it a virtual machine or a virtual server (domain)?

If it’s the same virtual machine and it only has one shared IP address, then—no, it won’t be possible to view both of your websites using the IP alone.

Besides, this doesn’t sound quite right—what are you trying to achieve in the first place?

VS = Virtual Server (Apache).
If I type www.example.tld on my PC I get to the virtual server correctly because Virtualmin (and its Apache management) manages the redirection.

I want to be able to access directly without using the domain name, for technical needs or for testing.
From within Virtualmin there is no way to access what is installed on a Virtual Server, for example using a button or some link?

Learn how to use apache is the short answer but add the required ports to listen.cfg then just make a new vs, using webmin, making sure you are using the ip and selected port. If you are using firewalld dont forget to open the ports you have allocated to apache or in fact with whatever firewall management software you use

Don’t do that.

But, if you must, you can make that domain (and only one domain the default domain and it will always appear when no other combination of name:port matches better).

To be clear, it’s a waste of your time to do this.

You can’t get a Let’s Encrypt cert for an IP (and most other TLS cert providers will also refuse to provide a cert for an IP address), so you can’t secure the connection. There is no good reason to ever use an IP.

Then simply use the local /etc/hosts file, which will meet your exact expectations.

I know cpanel had it where you could access websites via the username but as mentioned this methods of access are not ideal.

You can do that with Virtualmin, too, but I don’t recommend it. You can’t do secure execution of applications unless you’re in a VirtualHost that is setup for a specific user and using a specific application server for that user. Using Per-user web directories is only safe for plain HTML. So, it’s unlikely to be useful to most users.

https://httpd.apache.org/docs/2.4/howto/public_html.html

But, that has nothing to do with accessing a domain on an IP address. There is no reason to ever use an IP address (and there is also no reason to use per-user web directories that can overcome the security concerns and limitations).