You cannot create another virtual host and use the same IP in the address.
You cannot use the same IP without some method of differentiation between sites. The simple way to get around this is tell Apache to Listen
on other ports (usually in httpd.conf
, but not always) and set up your virtual hosts accordingly.
ex. virtual hosts file
# Enables e.g. 1.2.3.4 (a.k.a 1.2.3.4:80) and 1.2.3.4:1234
# Listen 80 should already be enabled
Listen 1234
<VirtualHost *:80>
# ServerName host1.example.com
# ServerAlias some.example.com
DocumentRoot "C:/path/to/site1/"
</VirtualHost>
<VirtualHost *:1234>
# ServerName host2.example.com
# ServerAlias another.example.com
DocumentRoot "C:/path/to/site2/"
</VirtualHost>
Of course, the drawback to this is that you will need to specify the port for your second site.
I can only access my website from another PC if I use the IP of the PC/WAMP server hosting the website.
You may want to check out a dynamic DNS service that provides subdomain names such as NOIP. Alternately, if you want a completely free domain name, you can try a .tk domain.
1
It's called virtual host.
– Michal Przybylowicz – 2019-09-02T10:02:42.070