Author |
|
CompleteNewb
Joined: 11 Dec 2020 Posts: 3 Location: Canada, Montreal
|
Posted: Tue 22 Dec '20 0:07 Post subject: virtualhost access |
|
|
Hello
I have set up apache2 on linux ubuntu. The first website I set up I could access it from every computer in my house. Then I configured virtualhost with multiple website and I have been accessing them, including a php form, from my computer browser using the domain name without any problem, but now i can't access them from another computer in my house. I don't understand.
What is the configuration that permits another computer to access a virtualhost website from another computer on the same router?
Please keep in mind that I am a complete Newb
Thank you for your time |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 29 Dec '20 0:02 Post subject: |
|
|
Do you access the second host by domain name? |
|
Back to top |
|
CompleteNewb
Joined: 11 Dec 2020 Posts: 3 Location: Canada, Montreal
|
Posted: Wed 30 Dec '20 20:48 Post subject: |
|
|
I don't understand.
I have set up my virtualhost with two different site.
"www.jackmcmack.com" and "www.testmyphp.com"
I have no problem accessing them in my browser by writing those name in the address bar, but if I do it from another computer in my house it doesn't work.
When I only had one website(www.jackmcmack.com) I could access it from any computer in my house by writing www.jackmcmack.com in the address bar of their browser. And if I remember correctly, I could even access it using the ip address 197.168.1.11 |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 05 Jan '21 16:19 Post subject: |
|
|
I see. How do you handle the DNS? Via the hosts file? if yes, did you update the DNS name in hosts file on all computers? |
|
Back to top |
|
CompleteNewb
Joined: 11 Dec 2020 Posts: 3 Location: Canada, Montreal
|
Posted: Tue 05 Jan '21 23:58 Post subject: |
|
|
Hum, I have a hosts file in /etc directory where i have written:
127.0.0.1 localhost
127.0.1.1 littleboy //the name of my computer
127.0.0.1 app.localhost
127.0.0.1 www.jackcmack.com
127.0.0.1 www.testmyphp.com
last time when i had only one site that was what i did.
Do I have to make something different with multiple site?
I never updated the hosts file on my other computer or devices when I had only one website enabled |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 06 Jan '21 9:39 Post subject: |
|
|
On the other computers you have to add those entries, too, but with the internal IP address.
e.g.
|
|
Back to top |
|