Virtual Host only works from the Local Machine

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Virtual Host only works from the Local Machine

Postby usar » 03. October 2011 23:59

i added the below lines in httpd-vhosts.conf. if i type the url 'wiki' from the local machine, it works fine and i get redirected to the website. however, if i type the same url from another machine on the same network, it is not able to find the website. what am i doing wrong ? i am new to this and any help would be appreciated.

please note that the computer name which is hosting the server is DPD008640 and typing this from 'another pc (not the local machine)' on the same network, i can access the website..however, i want to replcace DPD008640 to wiki

Thanks.


NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot "F:/ABC/xampp/htdocs"
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "F:/ABC/xampp/htdocs"
ServerName wiki
ServerAlias wiki
<Directory "F:/ABC/xampp/htdocs">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
usar
 
Posts: 14
Joined: 27. September 2011 20:56
Operating System: Windows XP Professional SP3

Re: Virtual Host only works from the Local Machine

Postby Altrea » 04. October 2011 09:27

usar wrote:i want to replcace DPD008640 to wiki

First possibilities:
edit the HOSTS file on EVERY computer. Add an entry with wiki and the IP of the server where the wiki is running

Second possibility:
Install and configure a full DNS Server and let all DomainName requests run through this.

both isn't very handy.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8299
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Virtual Host only works from the Local Machine

Postby usar » 04. October 2011 18:37

Altrea wrote:
usar wrote:i want to replcace DPD008640 to wiki

First possibilities:
edit the HOSTS file on EVERY computer. Add an entry with wiki and the IP of the server where the wiki is running

Second possibility:
Install and configure a full DNS Server and let all DomainName requests run through this.

both isn't very handy.


Thanks for the reply Altrea.

this wiki is going to be used internally at work so ofcourse the first option is out. :--) i can ask our I.T. for support if needed but i will need to know exactly what they need to add from their side.

i don't know much about networking and after i spoke to my I.T. guy he mentioned that i should be able to achieve this by configuring the server side (xampp).

what do you think ? does I.T. also need to make any changes or do i just need to configure the host and conf file on the server (where xampp resides) ?

on a side note, i also looked at the below thread and tried to follow what Sharley suggested but that did not help either. on the local machine (where xampp installed) if i only type wiki as the url it works but not from other machines.

http://community.apachefriends.org/f/viewtopic.php?f=16&t=45484&p=176899&hilit=virtual+host+works+from+local+machine
Last edited by usar on 04. October 2011 18:58, edited 1 time in total.
usar
 
Posts: 14
Joined: 27. September 2011 20:56
Operating System: Windows XP Professional SP3

Re: Virtual Host only works from the Local Machine

Postby usar » 04. October 2011 18:47

^ essentially, i want to use an alias to give it a more meaningful name (say wiki) instead of DPD008640 to access the website.
usar
 
Posts: 14
Joined: 27. September 2011 20:56
Operating System: Windows XP Professional SP3

Re: Virtual Host only works from the Local Machine

Postby usar » 04. October 2011 19:30

DPD008640 is the computer name of the PC where the XAMPP is residing and works the same as typing in the IP address of the machine.
usar
 
Posts: 14
Joined: 27. September 2011 20:56
Operating System: Windows XP Professional SP3

Re: Virtual Host only works from the Local Machine

Postby Altrea » 04. October 2011 20:24

usar wrote:what do you think ? does I.T. also need to make any changes or do i just need to configure the host and conf file on the server (where xampp resides) ?

If you want to use DomainNames (everything alse then IP-Address or ComputerName) then there is no way without a DNS-Server and that means your IT have to do something.

The other possibility is to use the Servers Computername (or IP-Address) and make use of:
- port based VHosts
- or keyword/RegExp mod_rewrite
- or keyword/RegExp Redirects/Alias
in all of that cases there is no way around to use the IP or Computersname (or an existing DNS of your IT have already a DNS-Server and mapped one to this server).

HOSTS files are just like lokal small DNS-Servers, but they just take effect for the requesting computer, not for the server who gets the request (which is clear, the computer have to know where the request can be sended to).
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8299
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Virtual Host only works from the Local Machine

Postby usar » 04. October 2011 20:39

Altrea wrote:
usar wrote:what do you think ? does I.T. also need to make any changes or do i just need to configure the host and conf file on the server (where xampp resides) ?

If you want to use DomainNames (everything alse then IP-Address or ComputerName) then there is no way without a DNS-Server and that means your IT have to do something.

The other possibility is to use the Servers Computername (or IP-Address) and make use of:
- port based VHosts
- or keyword/RegExp mod_rewrite
- or keyword/RegExp Redirects/Alias
in all of that cases there is no way around to use the IP or Computersname (or an existing DNS of your IT have already a DNS-Server and mapped one to this server).

HOSTS files are just like lokal small DNS-Servers, but they just take effect for the requesting computer, not for the server who gets the request (which is clear, the computer have to know where the request can be sended to).



okay i think i understand now. i have created the virtual host configuration on my Apache server and will need I.T. to create the DNS entries on their main DNS server (or whatever it is called).

so for example if i want to use the domain name wiki for DPD008640, I.T. will have to add the below line or something similar to their server:

DPD008640 wiki

please correct me if i am wrong. thanks.
usar
 
Posts: 14
Joined: 27. September 2011 20:56
Operating System: Windows XP Professional SP3

Re: Virtual Host only works from the Local Machine

Postby Altrea » 04. October 2011 20:52

DNS-Server resolving DomainNames to IP-Adresses. Your Computername is a DomainName too.
So the DNS must contain your desired DomainName (for example "wiki") and your Servers IP-Address(es)
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8299
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 40 guests