 |
 |
setting up mac for LAN-based web server
|
 |
|
 |
|
Junior Member
Join Date: Apr 2003
Status:
Offline
|
|
Hi all, I am trying to setup my powermac as a LAN-based server so that I can test websites locally and view them on my powermac and windows pc. I assume this means using apache that came with OS X, but I'm not sure what goes into configuring it to have multiple sites viewable locally.
I came across a utility by patrick gibson that allows me to setup virtualhosts and works great for viewing everything on my powermac. Thus, I have http://site1 and http://site2 pulling up their respective sites perfectly from my apple.
My question is, how can I make it so that my pc with windows xp pro can view http://site1 and http://site2 as well?
The only thing I've found is the windows hosts file that allows me to associate IP addresses with domain names, but apache virtualhosts all use the same ip (127.0.0.1), right? Can xp be altered to view my virtualhosts or is there an alternative approach to configuring apache to setup different IP addresses for each site so then I could alter m hosts file on the windows pc?
Any suggestionis would be greatly appreciated!
|
|
|
| |
|
|
|
 |
|
 |
|
Moderator 
Join Date: Mar 2004
Location: Copenhagen
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status:
Offline
|
|
I have to agree. If you're just testing websites, then it would be easier just to put your sites in separate directories under your webserver's root (Library/WebServer/Documents/) and do that. In fact, that's how I do it. However I just set myself up with a dyndns.org name, and I actually access the mac over the (sometimes) it works, either way really.
|
|
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Apr 2003
Status:
Offline
|
|
Well, the problem arises with certain items that look for the root folder. Some of my scripts look for the root, which in your case would be "localhost/site1", but my scripts would read "localhost" only and obviously break. Patrick Gibson's virtualhost was a lifesaver in that it allows me to setup multiple root directories. Thus, each site gets its own root, just like the web server setup. But, I'm back to my issue with my windows pc not being able to access them using the apache virtualhost.
Believe me, if all I was doing was basic HTML pages, subdirectories would be the way to go. Unfortunately, that's not working in this situation.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Apr 2003
Status:
Offline
|
|
Should I just bite the bullet and purchase Virtual PC? Will this remedy the issue? Would it be able to pick up my virtualhosts?
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Jul 2004
Status:
Offline
|
|
no vpc wouldn't...
the way that is being suggested would be your best bet. You might be able to use mod_rewrite to direct root directories.
But my modem/router unit has the ability to set the virtual directories. May check to see if your does have this. Mine is under DNS setup...
|
|
You shouldn't make fun of nerds... you'll be working for one some day.
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jul 2001
Status:
Offline
|
|
Another possibility is to serve your different websites on different ports. This way you avoid DNS issues and other boxes on your LAN can test the sites thusly: http://192.168.1.11:8000, http://192.168.1.11:8001, ...etc. I'm sorry I can walk you thru the steps, but it is a common apache setup and online documentation should be abundant.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Apr 2003
Status:
Offline
|
|
Originally Posted by datawrangler
Another possibility is to serve your different websites on different ports. This way you avoid DNS issues and other boxes on your LAN can test the sites thusly: http://192.168.1.11:8000, http://192.168.1.11:8001, ...etc. I'm sorry I can walk you thru the steps, but it is a common apache setup and online documentation should be abundant.
Different ports? I haven't thought about that. Anyone here have any experience with this? I'll see what I can find resource-wise on that.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|