我正在开发一个网站,该网站由两个人管理。一个是我,另一个是设计者,通过局域网从不同的机器访问。
配置:php、apache、windows xp、mysql。
文档根目录:d:\www\xampp\htdocs。所有项目都在此作为子文件夹。
我已经设置了虚拟主机,这样我就不会访问所有项目 http://localhost/foldername 但就像 < a href="http://文件夹名称" rel="noreferrer">http://文件夹名称。
但对于其他系统中的设计者来说,他必须访问 http://computername/foldername
例如让我在项目工资单中工作。我将访问它作为 http://payroll 但我的设计师将访问它作为 http://computername/payroll。
我想做的是我希望设计师以我访问的方式进行访问。即 http://payroll。
这样,在设计器系统中,当服务器名称是工资单时,我希望将其定向到我的计算机,然后定向到项目文件夹。因此,如果他提供 http://payroll 那么我系统中的应用程序应该为他运行。
我已经在设计器系统中设置了主机文件以指向我的机器。所以这项工作已经完成,当他给工资单时,我的 http://localhost 就会出现。
我应该怎么做才能让设计师从他的系统中访问我的项目,例如 http://payroll ?
I am developing a site and that that is managed by two. one is me and the other is the designer accessing from different machines across LAN.
Conf: php, apache, windows xp, mysql.
Document root: d:\www\xampp\htdocs. all the projects are under this as subfolders.
I have set up virtual host so that i will not access all the projects as http://localhost/foldername but just as http://foldername.
But for the designer who is in the other system he has to access like http://computername/foldername
For example let me be working in a project payroll. i will access that as http://payroll but my designer will access that as http://computername/payroll.
What i want to do is i want the designer to access the same way i access. that is http://payroll.
so that in the designer system when the server name is payroll i want it to be directed to my machine and then to the project folder. so if he gives http://payroll then the application in my system should run for him.
i have setup the hosts file in the designer system to point to my machine. so this work is done and when he gives payroll my http://localhost is appearing.
what should i do so the designer can access my project like http://payroll form his system?
发布评论
评论(2)
设计者必须将您的 IP 地址和每个
sitename
添加到他的 hosts 文件中 因为没有它,他的浏览器将不知道在哪里寻找该网站。它可能看起来像这样:如果您的 VirtualHosts 没有绑定到特定的 IP 地址,这可能就足够了。这是行不通的: 应该
是这样:
这样,每当 apache 看到主机名
sitename
的请求时,它就会为名为sitename
的站点提供服务,并且无论它是否到达都没关系是否来自同一台计算机。The designer has to add your IP address with each
sitename
to his hosts file as without it his browser won't know where to look for the site. It could look like this:This might be enough if your VirtualHosts are not bound to a specific IP address. This would not work:
It should be:
This way apache will serve the site called
sitename
whenever it sees a request with the hostnamesitename
and it won't matter if it came from the same computer or not.他可以将其放入 \windows\system32\drivers\etc\hosts 文件中:
其中 1.2.3.4 应替换为系统的 IP 号。
Apache site-enabled\000-default 文件应以以下内容开头:
He can put into his \windows\system32\drivers\etc\hosts file:
Where 1.2.3.4 should be replaced with the IP number of the system.
The Apache sites-enabled\000-default file should start with: