开发者

Testing website on localhost server for iphone and ipad

What I'm looking to do is preview what I've built on a custom localhost server (set up with Mamp Pro) on my iphone or ipad. The localhost is under http://devsite:8888 and not http://localhost:8888.

I've tried the instructions for something similar found here. The result was being able to see the files but it was just the list of the files on the server and not picking up index.php—no previews enabled. I've triple checked to make sure I have a proper index in the root directory as well.

Added /etc/apache2/extra/httpd-vhosts.conf file http开发者_如何学Pythons://gist.github.com/07223bf788ef1e2e1411


Put this in your .htaccess or httpd.conf (usually /etc/apache2/httpd.conf on OSX):

DirectoryIndex index.php

If that is put in .htaccess be sure that somewhere in httpd.conf (or whatever customm config file for the web server) you have this (replace /var/www/html with the directory where your .htaccess file is):

## These lines can go anywhere in the main config file:
AccessFileName .htaccess
<Directory "/var/www/html">
    AllowOverride All
</Directory>

Also, make sure your /etc/hosts file includes:

127.0.0.1       devsite
# Or whatever your local computers IP is:
# 192.164.2.164  devsite

so that the hostname will resolve properly.


Edit:

From the comments, it sounds like your virtual hosts may need additional configuration. Can you put the contents of the /etc/apache2/extra/httpd-vhosts.conf file in your question?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜