开发者

Viewing Mac Localhost on a network PC

开发者 https://www.devze.com 2023-03-05 01:56 出处:网络
I am developing some websites on my Mac (Standard LAMP setup, with PHP5, Using Remy Sharp\'s LAMP setup instructions). I can see these sites locally by going to (eg http:// apple.dev).

I am developing some websites on my Mac (Standard LAMP setup, with PHP5, Using Remy Sharp's LAMP setup instructions). I can see these sites locally by going to (eg http:// apple.dev).

I was just wondering how I view these sites on a connected network PC.

I have tried: http:// MY-IP-ADDRESS/~MYUSERNAME/apple.dev

But this just returns the file directory structure for the website.

I can see the default webpage by just going to: http:// MY-IP-ADDRESS/~MYUSERNAME/

Am I doing anything wrong or do I need to do anythi开发者_高级运维ng else?

I have enabled web sharing

Any thoughts or suggestions appreciated.


It sounds like you have a server alias setup for this site already. In which case the answer is pretty simple. Just edit the hosts file on your pc and enter the ip of your pc together with the server alias in the usual fashion, e.g.

xxx.xxx.xx.xx  apple.dev

Where xxx.xxx.xx.xx = your mac's ip address, as found in web sharing.

If this is done, then your pc should find the site when you browse to that alias in its web browser.

0

精彩评论

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

关注公众号