简体   繁体   English

在本地计算机上托管网站

[英]Hosting website on local computer

I am a web developer. 我是一名网络开发人员。 I want to test how my website work on mobile and on pc. 我想测试我的网站如何在移动设备和PC上运行。 I am using xampp and codeigniter. 我正在使用xampp和codeigniter。

I created a virtual server like: rssfeed.local. 我创建了一个虚拟服务器,如:rssfeed.local。 It works properly on my pc. 它在我的电脑上正常工作。 But I want that when I type above url in safari of my Ipod, It will also work. 但是我希望当我在我的Ipod的safari中输入上面的url时,它也会起作用。

So i change the ip of my pc to a static ip. 所以我将我的电脑的IP更改为静态IP。 Ex: 192.168.1.100 the ipod will understand and go to that website on my pc. 例如:192.168.1.100 ipod会理解并在我的电脑上访问该网站。 But when i type rssfeed.local, the ipod does not understand. 但是当我输入rssfeed.local时,ipod不明白。

Can you show me how to configure the apache for that purpose? 你能告诉我如何为此目的配置apache吗?

You have 4 options here: 这里有4个选项:

  1. You would need to have a server, where you connect to with your iphone and your website and configure the DNS. 您需要有一台服务器,您可以在其中连接到您的iphone和您的网站并配置DNS。

  2. You need a router where you could configure DNS settings in, connect the internal ip address to a DNS. 您需要一个路由器,您可以在其中配置DNS设置,将内部IP地址连接到DNS。

  3. Edit the hosts file on your iphone, and for that you would need to jailbreak it. 编辑你的iPhone上的hosts文件,为此你需要越狱它。

  4. Use some software as a proxy tool, where the tool can translate the url to the internal ip address. 使用某些软件作为代理工具,该工具可以将URL转换为内部IP地址。

you can try change your HOSTS file, its location in the c:\\windows\\system32\\drivers\\etc add an item like "rssfeed.local 192.168.1.100" in the document below. 您可以尝试更改您的HOSTS文件,它在c:\\ windows \\ system32 \\ drivers \\ etc中的位置在下面的文档中添加“rssfeed.local 192.168.1.100”之类的项目。 well,work done. 好了,完成了工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM