2

I want to access my virtual host using my phone or my other computer the problem is I cannot access my site using the server name I can only access the site using the IP address of the server. I changed the port to 7777

When I tried www.tbs.com:7777/index.php I am getting "site cannot be reached"

Virtual Host Config:

<VirtualHost *:7777>
DocumentRoot "c:/xampp/htdocs/TBSApp"
ServerName www.tbs.com
ServerAlias tbs.com
ServerAdmin webmaster@localhost
<Directory "c:/xampp/htdocs/TBSApp">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    order allow,deny
    allow from all
</Directory>
</VirtualHost>

Host Config

192.168.120.9    www.tbs.com
  • you probably need to look at the DNS on network and network naming ( depending if Linux, Mac, Win ) anyhow it is also probably a [duplicate of this question](https://stackoverflow.com/questions/22650186/access-apache-virtual-host-over-lan) – Obmerk Kronen Jan 01 '19 at 04:49
  • @ObmerkKronen I need to configure the DNS? –  Jan 01 '19 at 04:53
  • what computer do you use to access ? did you changed hosts file on windows ? and did you restart apache to take all changes ? firewall config? – Obmerk Kronen Jan 01 '19 at 07:37
  • also, [this answer](https://stackoverflow.com/questions/9682262/how-do-i-connect-to-this-localhost-from-another-computer-on-the-same-network) probably covers most. – Obmerk Kronen Jan 01 '19 at 07:41
  • i am using my laptop and my phone. I changed the host file. What do I do in my firewall? I added inbound and outbound rules for port 7777 what else do I need to do? –  Jan 01 '19 at 10:58

1 Answers1

0

You need to use the ip address instead of the domain as it is a local host configuration. To use the domain across all devices you need to setup a DNS server.

Tyler Wright
  • 126
  • 1
  • 10
  • how about accessing the site using the computer name instead of an ip address is it possible? –  Jan 01 '19 at 05:12
  • I don't think you can. I am fairly sure that is just used in ssh. If you are using windows just do ipconfig in command prompt or in mac/linux do ifconfig in terminal to get your ip address. – Tyler Wright Jan 02 '19 at 15:19