how do I access a virtual site on a local lan?

This sounds to me like there was likely an Apache configuration file that was set up to point all bare IP requests to the /var/www directory. By appending the directory name of the site that you were seeking, you could load the page normally. In order to do something similar, you'll need a "bare" Apache config file to exist.

Here's how you make one:

  1. Open Terminal (if it's not already open)
  2. Navigate to the Apache sites-available directory:
    cd /etc/apache2/sites-available
    
  3. Create a new file that will be used internally. Perhaps you can call it something like 000-local.conf:
    sudo vi 000-local.conf
    
    Note: Feel free to use any text editor that you are comfortable with. The example of vi above is more a force of habit than a direct endorsement.
  4. Paste the following into your new file:
    <VirtualHost *:80>
            ServerAdmin [email protected]
            DocumentRoot /var/www
    
            ServerName 192.168.1.2
            ServerAlias 192.168.1.2 192.168.1.*
            DirectoryIndex index.php index.html
    
            ErrorLog ${APACHE_LOG_DIR}/local-error.log
            CustomLog ${APACHE_LOG_DIR}/local-access.log combined
    </VirtualHost>
    
    <Directory /var/www>
            Options FollowSymLinks
            AllowOverride All
    
            Order Allow,Deny
            Allow From All
    </Directory>
    
  5. Save the file
  6. Enable the config file:
    sudo a2ensite 000-local.conf
    
  7. Restart (or reload) Apache:
    sudo service apache2 restart
    
  8. Give it a go in your browser of choice

Some things to note:

  • if any other configuration file has 192.168.1.2 as its ServerName, then there will be a conflict. You will want to ensure that every other site has a FQDN (Fully Qualified Domain Name — Something like website.com) as its ServerName value.
  • if a configuration file is configured to listen for * in the ServerAlias, then you'll want to ensure it appears after 000-local.conf alphabetically in the directory.

So long as the sites contained in the directory will not force a redirection from 192.168.1.2/website.com to website.com, then you should be able to access these resources locally without first performing a DNS lookup outside the network.