iMac Apache question

OldSkool

Registered
I am pretty new to Macs and have a new iMac and been messing around with the Apache that comes on it (I don't know what version it is really). I have my iMac and a PC behind a Linksys router and cable modem. I put an index.html webpage I made in the Sites folder but could only display on my pc in Network but outside people could not display. I tried to set up Port Forwarding for an HTTP request using the Router but could not get that to work either. I set up and everything with static IP's and I finally got something to work and I am wondering if it is the proper way or if it is safe or I should so some different configuring to make it safer.
Here is my setup that is working right now: I have a DynDNS.org name set to point to my cable modems main IP and I also set my internal Mac IP as a DMZ Host thru the Router. People outside are able to access my page now. I am not sure though if I need that DMZ set up? Also with this setup is there danger to my PC and others on my network? If I get my own domain name can I get it to work like this also? Also since I dont know much about this Apache on the iMac how powerful is it and what can/should I be doing with it? Just basic webpages or full blown sites are fine? Can I host my own message board? Lots of questions I know. Thanks for any help.
 
im not that very familiar with networking stuff... but once u can get your apache, php, mysql run on your server... u can have ur own message board... =)
 
Ok a few things:
1. Apache is a VERY powerful web server, and in fact, I've heard also the most popular out there (more than MS IIS).
2. Get MySQL and PHP installed and you can do whatever serving your hardware will tolerate.

Ok now about your configuration. I understand that you use your router as a DHCP server, and mapped your iMac's MAC address to a static IP, and them DMZed that IP? But if port forwarding doesn't work (aka Virtual Server), then how do outside clients connect to your iMac at all? Does your router just assume that the DMZ host is mapped directly on to your outside IP, without the need for port forwarding? (I'm not familiar with your model router--but mine doesn't do that).

Security: If you set up DHCP like that, then DMZing one (or any) nodes shouldn't affect the other nodes on your network, since they are still in the militarized zone. You should, of course, configure your software firewall on your iMac to keep it protected, since it is at highest risk (being a published address).

About getting versions and stuff, just install PHP 4.3.0 and create the following script, it will tell you everything about your server software. Unless you have changed anything with Jaguar, you have Apache 1.3.27 installed (no PHP or MySQL though).
PHP:
<?php
     phpinfo();
?>
 
Originally posted by michaelsanford
Ok a few things:
1. Apache is a VERY powerful web server, and in fact, I've heard also the most popular out there (more than MS IIS).
2. Get MySQL and PHP installed and you can do whatever serving your hardware will tolerate.

Ok now about your configuration. I understand that you use your router as a DHCP server, and mapped your iMac's MAC address to a static IP, and them DMZed that IP? But if port forwarding doesn't work (aka Virtual Server), then how do outside clients connect to your iMac at all? Does your router just assume that the DMZ host is mapped directly on to your outside IP, without the need for port forwarding? (I'm not familiar with your model router--but mine doesn't do that).

Security: If you set up DHCP like that, then DMZing one (or any) nodes shouldn't affect the other nodes on your network, since they are still in the militarized zone. You should, of course, configure your software firewall on your iMac to keep it protected, since it is at highest risk (being a published address).

About getting versions and stuff, just install PHP 4.3.0 and create the following script, it will tell you everything about your server software. Unless you have changed anything with Jaguar, you have Apache 1.3.27 installed (no PHP or MySQL though).
PHP:
<?php
     phpinfo();
?>

Hey thanks for all the info and input.
About the DMZ being mapped directly to my outside IP...i have know idea...apparently it is doing something like that because I have tripled checked to make sure that I had all forwarding off and only DMZ on and somehow my server can be seen outside. For DMZ on the Linksys BEFW11S4 there is only a place to put one IP and turn it on. All i could find in the manual was that it made that IP able to be seen outside, so I guess like you said it must somehow just map it to my default gateway maybe?
I did make sure to configure my iMac Software Firewall and I am using DynDNS so I think that helps with people knowing my actual IP?
As far as MySQL and PHP I really don't know anything about them but have just heard about them. I don't know if they are something that I can just download and play with or if I really need to know alot to do something?
Thanks again. Any other info or resources about MySQL or PHP you think of would be great.
 
DynDNS is good, i use no-ip myself (personal site in sig) but whatever suits your needs...

Ok some links for MySQL and PHP, here we go:
www.mysql.com
www.php.net
www.entropy.ch
http://www.versiontracker.com/mp/ne...e=Quick&OS_Filter=MacOSX&search=mysql&x=0&y=0
http://www.versiontracker.com/mp/ne...ode=Quick&OS_Filter=MacOSX&search=php&x=0&y=0

PS If you come across the CompleteMySQL, CompletePHP, CompleteApache suite from aaronfaby.com, I would strongly suggest steering clear form it; it wrecked my system. The configuration panels they come with are so basic as to be completely useless, even, in my opinion, to a complete novice (they only let you start and stop the servers, they don't provide any configuration interface). It's always good to learn the terminal commands.... That is MY experience; maybe other people like it, but I sure don't :p

There are lots of package installers for MySQL and PHP that you can use, or entropy.ch's simple 5-line terminal command installation...
 
By the way, on reflection, DMZing probably does just map the router straight onto the internal IP. I think mine does that, but actually I'm not sure. I don't have a router here, but I do at my parent's house a few hundred km away--can't really check it out for confirmation...
 
ok, michaelsanford - just wanted to point this out to you. it's OT but here you go:
Profr*essional - Hosted on XServes

typo! take out the r man :) how many Xserves are there? those are heavy machines :)
 
Hmm that's funny, I noticed the typo and took it out, guess I clicked back and forward instead of submitting or something :confused:

Oh my host uses XServes, my site only uses one, or probably more like %0,1 of one...

Is that better :p
 
Hi guys,

I'm a bit confused here!

I am using DynDns to route a static hostname to my computer, and I'm using DNS Update to keep my IP up to date on their system.

My broadband connection is going through a LinkSys router, so I've set it up to route all incoming traffic on port 80 to my computer (192.168.1.100 - i.e. the first of the router's DHCP clients).

This works great. When I go to myusername.homeip.net I get access to my /Library/Webserver/Documents directory.

My question is this:

What is the difference in function between /Library/Webserver/Documents and /Users/myusername/Sites in this instance? Is it possible for me to access the /Users/myusername/Sites with my DynDns hostname, plus the correct suffix?

I've tried myusername.homeip.net/~myusername, but that doesn't work. I wasn't really expecting it to!

Is the Sites directory not really used for web hosting? Is the only solution to put everything in the /Library/Webserver/Documents directory?

Or, can I change the router's port forwarding to direct certain enquiries to my Sites directory?

Any help would be gratefully appreciated![/b]
 
You're right, /Library/WebServer/Documents/ aliases to http://localhost/ (or your hostname without any other folder names). /~username/ is your /Users/username/Sites/ folder.

I don't know why it's not working. Can you access your pages from your own computer with localhost?
 
Back
Top