PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, January 14, 2022

[FIXED] Viewing Mac Localhost on a network PC

 January 14, 2022     lamp, localhost, macos, networking, sharing     No comments   

Issue

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 anything else?

I have enabled web sharing

Any thoughts or suggestions appreciated.


Solution

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.



Answered By - Sam Murray-Sutton
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing