I have a VPS with apache2 installed and I would like to access some PHP projects without a domain name just with the IP address. For example:
http://162.243.93.2
Create a new virtual host file, and setup like this:
ServerAdmin webmaster@localhost
ServerAlias 192.168.1.1
DocumentRoot /somewhere/public_html
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride Authconfig FileInfo
Require all granted
add the serveralias and it will recognize the IP address as well ... if you want to add more IP addresses (like local network second interface), you can add more serveralias lines ...