开发者

Remote access to apache2 server

I'm trying to test my iPhone application on the device. I have a mac computer which stores my development environment. Right now I can only access PHP files using the http://localhost/PHPFileLocation which does not work when I try to test my app on real device.

How do I configure apache2 to be accessible from outside? Is it possible to configure it to a specific IP addr开发者_开发问答ess?

I want to reach some php scripts located on my development machine running apache2 from my iPhone device.

Thanks


If your computer has a WiFi card then you should be able to attach the iPhone remotely to a ad-hoc Wifi network created on your dev machine.


I'm assuming your Mac is behind a router. You should be able to configure your router to port forward connections to your WAN facing IP address to port 80 (the HTTP port) on your Mac - see http://portforward.com/ for some help.

You may also need to turn the firewall off on your Mac.

Once this is set up correctly you can hit http://yourexternalIP/PHPFileLocation in your iPhone app and this will be directed by your router to the Apache2 server on your Mac. The external IP is normally found on your router's admin page somewhere.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜