User Name
Password
AppleNova Forums » Genius Bar »

Apache Web Server


Register Members List Calendar Search FAQ Posting Guidelines
Apache Web Server
Page 1 of 3 [1] 2 3  Next Thread Tools
rasmits
rams it
 
Join Date: Oct 2004
Location: Seattle
 
2005-07-09, 20:56

How can I use the Apache Web Server to host a website?
  quote
staph
Microbial member
 
Join Date: May 2004
Send a message via AIM to staph  
2005-07-09, 21:54

Go to System Preferences > Sharing;

Turn on Personal Web Sharing; and,

Dump the files you want to serve in /Library/WebServer/, or per user, into ~/Sites/

You may want to set up dynamic DNS from somewhere like noip.com or dyndns.com. If you want to do any more tricky configuration of the web server (password authentication, virtual host configuration, etc.) you should go read the documentation at http://httpd.apache.org/docs/
  quote
rasmits
rams it
 
Join Date: Oct 2004
Location: Seattle
 
2005-07-09, 22:53

I set up something on dyndns as instructed, but it still only works for computers on my own network, none outside.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2005-07-09, 23:37

If you are on a LAN with NAT, for anyone outside the network to access your machine, you'll have to set up port forwarding (or a DMZ address) on the router itself.

Check the instructions that came with the router to set this up. Each brand is done differently.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
rasmits
rams it
 
Join Date: Oct 2004
Location: Seattle
 
2005-07-09, 23:43

Sounds confusing. There's no way to just make a "www.blahblahblah.com" address?
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2005-07-10, 00:24

If you're on a local network behind a router, no.

It's not too difficult, though. On my Linksys router, all I have to do is connect to 192.168.1.1 in my web browser, click Advanced, click DMZ Host, and enter the local IP address of the machine that I want exposed to the outside world.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
staph
Microbial member
 
Join Date: May 2004
Send a message via AIM to staph  
2005-07-10, 01:42

Setting up the port forward should be pretty straightforward as well, and perhaps better if you're paranoid about security.

On my Linksys, you go to the configuration interface, click the applications and gaming tab, then enter the start/end ports (80 in both) and the IP address of the server, click the "enable" button, and it's done.

Another cool feature of the Linksys routers is that some of them (such as my WRT54G) have dyndns support built-in, so you can get the router to do the IP address updating. If you have one of these, it's under Setup > DDNS.

BTW: if you want a nice address like my.funkywebsite.com, the dynamic dns companies will allow you to do dynamic DNS for a real registered domain name — the only kicker is that you'll have to pay for the domain name, and the dyndns (it's usually a paid functionality).
  quote
rasmits
rams it
 
Join Date: Oct 2004
Location: Seattle
 
2005-07-10, 19:48

Cool, I think it worked. I set up a DMZ thing and entered my iMac's local ip address.

I'm not too worried about security, because I've got OS X's firewall on and you still need a password to get in.
  quote
staph
Microbial member
 
Join Date: May 2004
Send a message via AIM to staph  
2005-07-10, 20:36

Yeah, I don't think it's a huge risk. If you've got the ssh server turned on (remote login under the Sharing preference pane), you might want to make sure your passwords are secure, but that's about it.
  quote
rasmits
rams it
 
Join Date: Oct 2004
Location: Seattle
 
2005-07-10, 22:52

Okay, I've got it all working. But in order for people to see my webpage, they have to either enter in my ip address, or go to some "name.dyndns.org" address.

Is it difficult to create your own "www.name.com" address, or do I HAVE to buy one?
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2005-07-10, 23:06

Yes, you HAVE to buy one.

To get something like yourname.com to resolve to your IP address, it has to be registered with several major DNS servers around the world. Then it has to propagate through the whole Internet. You have to pay a registrar to get your name on one of those top servers. That's simply how it works. There's no other way.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
atomicbartbeans
reticulating your mom
 
Join Date: Jan 2005
Send a message via AIM to atomicbartbeans  
2005-07-10, 23:27

I wish Apple would publish a simple guide "how to host a web site, using your Mac as a web server".
  quote
rasmits
rams it
 
Join Date: Oct 2004
Location: Seattle
 
2005-07-10, 23:28

Quote:
Originally Posted by Brad
Yes, you HAVE to buy one.

To get something like yourname.com to resolve to your IP address, it has to be registered with several major DNS servers around the world. Then it has to propagate through the whole Internet. You have to pay a registrar to get your name on one of those top servers. That's simply how it works. There's no other way.
okay, thanks for the help.

That's cool though, because registration doesn't cost much these days. I shopped around and saw some for under $10 a year.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2005-07-10, 23:42

Quote:
Originally Posted by atomicbartbeans
I wish Apple would publish a simple guide "how to host a web site, using your Mac as a web server".
Something like this?

http://docs.info.apple.com/article.html?artnum=151734

Or this?

help:///Library/Documentation/Help/MacHelp.help/Contents/Resources/English.lproj/pgs/mh174.html
  quote
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2005-07-25, 22:23

To carry this a step further and not start a new thread...

I would like to host some files for my dad to download from me. How would I set it up for him to go to my web page (on my Mac which is in the DMZ) and then download from my disk? Can I give him access to an external HDD for example?

I like the idea of getting another domain name for this but I have a dynamic IP from Cox HSI and would have to be able to change the IP with the registry but don't know about that one either. I can learn HTML, or do WYSIWYG building as needed.

I did buy Panic 3 FTP as well, I really like it too! I have been using it for my web space that Cox gives me, but the space isn't big enough for my media files I'm sharing with my family.

MacOSX Firewall; If I turn it, on since the Mac will be in the DMZ, will it prevent my local network from sharing? Since it would be in the DMZ I would assume it needs to have the firewall on like WinXP machines do, but just don't know. I don't want to loose my internal network, though willing to pull it out of the loop if needed during transfer times.

In the words of Neo; uh help, need a little help here!

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.â€
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.

Last edited by turtle : 2005-07-25 at 22:29.
  quote
staph
Microbial member
 
Join Date: May 2004
Send a message via AIM to staph  
2005-07-25, 22:40

Quote:
Originally Posted by turtle2472
To carry this a step further and not start a new thread...

I would like to host some files for my dad to download from me. How would I set it up for him to go to my web page (on my Mac which is in the DMZ) and then download from my disk? Can I give him access to an external HDD for example?
Yes, but it's possibly not a hugely great idea.

Either change the DocumentRoot in the Apache config file (/etc/httpd/httpd.conf) to the path to the volume, or set up a directory alias for it.

Quote:
I like the idea of getting another domain name for this but I have a dynamic IP from Cox HSI and would have to be able to change the IP with the registry but don't know about that one either. I can learn HTML, or do WYSIWYG building as needed.
Virtual Domains are your friend — with a bit of editing in the Apache conf file, you can happily run two domains on the one IP.
  quote
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2005-07-25, 22:49

Quote:
Originally Posted by staph
Yes, but it's possibly not a hugely great idea.
Please give more details. I've not yet learned things I need to but really want to.

Quote:
Originally Posted by staph
Virtual Domains are your friend — with a bit of editing in the Apache conf file, you can happily run two domains on the one IP.
Once again, please bare with me since I'm new to the concept of my Mac hosting instead of something like MS' bCentral, please explain a little more.

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.â€
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.
  quote
staph
Microbial member
 
Join Date: May 2004
Send a message via AIM to staph  
2005-07-25, 23:54

Quote:
Originally Posted by turtle2472
Please give more details. I've not yet learned things I need to but really want to.
Well, basically because it's not a very secure way of sharing stuff… and if you forget to password protect it, Google may well come along and index your hard drive for the whole world to see.

If you're trying to share a whole hard drive you're probably much better off running an FTP or SFTP server, such as PureFTPd.

Quote:
Once again, please bare with me since I'm new to the concept of my Mac hosting instead of something like MS' bCentral, please explain a little more.
Basically, HTTP1.1 requests (and in fact most HTTP1.0 requests via a generally accepted extension) include a line indicating what web server they're actually trying to get to. If you have multiple web sites on the same machine on the same IP, the server will use this information to direct the request to the correct virtual server.

You can find information on how to configure it here. You have to edit httpd.conf on the command line as root, so for example you might want to use:

sudo nano /etc/httpd/httpd.conf

to edit the file.
  quote
Gargoyle
http://ga.rgoyle.com
 
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
 
2005-07-26, 03:42

SFTP is built in. Just setup another user account (not an admin account) for your family with a good strong password. Then enable remote login - SFTP works through the same system as the remote login (SSH).

Then your family should be able to use Transmit or other decent ftp program to create a secure ftp connection to your powerbook. You will have to do the same port forwarding as you did for the apache stuff but this time on port 22.

OK, I have given up keeping this sig up to date. Lets just say I'm the guy that installs every latest version as soon as its available!
  quote
staph
Microbial member
 
Join Date: May 2004
Send a message via AIM to staph  
2005-07-26, 05:06

Yeah, but the advantage of running a dedicated FTP server is that you can set up arbitrary users/passwords and sharepoints, which seems a more elegant solution.

Of course, it hadn't occurred to me that SFTP was built in…
  quote
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2005-07-26, 06:27

Well then it sounds like the SFTP is the way to go for me. I'm sure my dad can get FTP software. I think I'll set up both though, one account (new non-admin) for SFTP and then a regular web page for my iPhoto exports so the family can see our pictures. Would that be a better way to do this?
Then I would port forward for the web page and then again for the SFTP?

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.â€
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.
  quote
staph
Microbial member
 
Join Date: May 2004
Send a message via AIM to staph  
2005-07-26, 07:02

Yep, you'll need to forward port 80 (http) and port 22 (ssh)
  quote
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2005-07-26, 09:27

Quote:
Originally Posted by staph
Yep, you'll need to forward port 80 (http) and port 22 (ssh)
One more for the networking security newB;
How do I port forward? I have been all through apple.com, their forums and even done searches on here. When I select to edit the settings for my firewall on OSX it says I can't edit them because they are in use. Do I have to disable them and then start them after editing? I'm trying to walk my wife through this over the phone and it isn't working well since she knows little about computers and I'm not even sure what I'm trying to tell her to do. Since I have the Mac in the DMZ I know the router port forwarding is not an issue, so how do I set the forwarding through OSX software forwarding? Is this my only issue. I'm not meaning to ask too much, but if you do screen shots it would be cool since I could refer my wife to this thread fo assistance while I'm on the phone with her. Thanks..
Tony

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.â€
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.
  quote
staph
Microbial member
 
Join Date: May 2004
Send a message via AIM to staph  
2005-07-26, 14:41

Turning on a service in System Preferences > Sharing will automatically open the firewall exception, because Apple assume that if you're turning a service on you want people to use it.

As for port forwarding, what exactly is your network topology?

If it's:

teh intarweb ---> modem/router ----> computer connecting via PPPoE

you don't need to do port forwarding, everything is going to that computer.

If it's:

teh intarweb ---> modem/router ----> computer connecting via DHCP

you can either do a DMZ pointing to the machine, in which case every port is forwarded to that machine, or you can choose to forward individual ports. How you do that is dependent on the brand of your modem or router. There are brief instructions as to how to do it on a Linksys above…

If you want to hand-edit the firewall config file, you should probably shut down the firewall first (in System Preferences > Sharing > Firewall), and you'll need to be root to edit that file. I suspect you also need to start the service from the command line. I know there are instructions as to how to do this somewhere, you might want to google for them. I assume that the introduction of launchd in 10.4 may have changed things a little. Alternatively, you could use Brickhouse as a convenient graphical editor for it. If you have actually started the firewall from the command line, you can't edit or turn on/off the firewall in Sharing preferences, because Apple reasonably assumes you're using a third-party firewall.

Edit: misread your post, ignore the stuff about port forwarding above. As for making sure that there's something listening correct port on the machine, simply turning on the service should be all you have to do, even if the firewall is on. The operating system will automatically forward anything not firewalled on a relevant port to the service which is listening on that port.

Last edited by staph : 2005-07-26 at 14:51.
  quote
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2005-07-27, 21:22

Well I'm moving in the right direction I think. I actually got a domain name from Yahoo for $5 per year and got it for 5 years. All it allows is forwarding or single Yahoo template page if you don't turn on forwarding. So this will serve to allow people to go to the same address all the time even if my Dynamic IP address changes. Now that I have that I still seem to be having a challenge getting to my "site" from the net.

Basic setup for Mac: Net/Cable Modem -> Linksys BEFSX41 -> Linksys EZXS88W -> Mac Mini

Now the Mini is 192.168.1.105 which has been set up to be in the DMZ on the BEFSX41. That being the case, if someone goes to my IP address then they should see my web page, right? I haven't changed the Apache stock one yet, but I should at least see that one right? I'm not and seem to be stuck just now. What am I doing wrong? I looked through the first few messages in this thread but it didn't do it for me. I guess I just don't know enough yet for it to make sense. Any ideas? Thanks.
Tony

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.â€
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.
  quote
staph
Microbial member
 
Join Date: May 2004
Send a message via AIM to staph  
2005-07-28, 02:56

Quote:
Originally Posted by turtle2472
Well I'm moving in the right direction I think. I actually got a domain name from Yahoo for $5 per year and got it for 5 years. All it allows is forwarding or single Yahoo template page if you don't turn on forwarding. So this will serve to allow people to go to the same address all the time even if my Dynamic IP address changes. Now that I have that I still seem to be having a challenge getting to my "site" from the net.

Basic setup for Mac: Net/Cable Modem -> Linksys BEFSX41 -> Linksys EZXS88W -> Mac Mini

Now the Mini is 192.168.1.105 which has been set up to be in the DMZ on the BEFSX41. That being the case, if someone goes to my IP address then they should see my web page, right? I haven't changed the Apache stock one yet, but I should at least see that one right? I'm not and seem to be stuck just now. What am I doing wrong? I looked through the first few messages in this thread but it didn't do it for me. I guess I just don't know enough yet for it to make sense. Any ideas? Thanks.
Tony
How is the router connecting to the internet via the modem? Are you using PPPoE, or is just a DHCP client.

If it's the latter, you need to set port forwards from the modem to the router, as well as from the router to your Mini.

Have you tried putting your IP address directly into a browser to get to the machine (to make sure it isn't just a DNS issue)?
  quote
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2005-07-28, 05:34

Quote:
Originally Posted by staph
How is the router connecting to the internet via the modem? Are you using PPPoE, or is just a DHCP client.

If it's the latter, you need to set port forwards from the modem to the router, as well as from the router to your Mini.

Have you tried putting your IP address directly into a browser to get to the machine (to make sure it isn't just a DNS issue)?
The modem connection is DHCP. As for the IP, if I'm on any computer in my network I can type the IP (192.168.1.105/~Tony/) into the bar and it goes right there. So it works well within my network. Now it is just a matter of getting it to the outside world. I thought putting it in the DMZ did that without having to do forwarding, what do I need to do?

Up until last night I didn't have a domain for this so all I was doing was putting in the IP address directly. I still do not have the domain (www.kellyent.com) forwarding to my IP, just the standard Yahoo starter page, this should rule out DNS.

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.â€
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.

Last edited by turtle : 2005-07-28 at 05:37.
  quote
staph
Microbial member
 
Join Date: May 2004
Send a message via AIM to staph  
2005-07-28, 06:43

Quote:
Originally Posted by turtle2472
The modem connection is DHCP. As for the IP, if I'm on any computer in my network I can type the IP (192.168.1.105/~Tony/) into the bar and it goes right there. So it works well within my network. Now it is just a matter of getting it to the outside world. I thought putting it in the DMZ did that without having to do forwarding, what do I need to do?
So have you tried getting to it from the outside world on your network's public IP address (i.e. the IP address you get if you visit http://whatismyip.com/ or similar)? Being able to get to the private IP on your own network is no indication that port forwarding is working, btw.

The DMZ set up on the router will only forward packets to machines downstream from the router; the router obviously can't instruct the modem to forward packets to it — that has to be configured on the modem. You'll need to go into the modem configuration interface and make sure it's forwarding the relevant ports to the router, as well as then having the router forward packets to the actual machine running the web server.

To be honest, I always get my router to connect directly to the internet (via the modem) using PPPoE, because it eliminates one of the port forwarding steps.

So you should end up with a topology like this:
Code:
Internet------>Modem (public IP) ----------------> Router (private IP) -----------------> HTTP Server (private IP) DHCP DHCP DMZ to Router DMZ to HTTP Server
The packet from the wibbly wobbly web comes in to your modem, which has the actual public IP associated with your DNS name; it knows to forward it to the router, since you've now told it to, and the router then forwards it to the server, again because you've told it to.

Last edited by staph : 2005-07-28 at 06:50.
  quote
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2005-07-28, 07:08

I don't have the option for going PPPoE though with a dynamic IP do I?
I think I have configured the port forwarding. I'll have to test it while I'm at work... I'll let you know what I find. Thanks for your help with this, I really want to get this going.

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.â€
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.
  quote
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2005-07-28, 08:12

Well my FTP is working. I'm now at work and have been browsing my pictures on my Mac from the FTP client I have installed on my computer here. So I know the connection works for FTP (How do I know if it is SFTP?). I know I need to change some of my info for better security and create another account so my Dad can't see everything in the Mini. Any pointers on this? I'm going to have to really see what I can do to get the HTTP working. I mean, if I can FTP in then it isn't all bad and seems to me it would be my router blocking traffic. Would you agree?

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.â€
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Page 1 of 3 [1] 2 3  Next

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
Wait a second, did I read that right? OSX for Intel? And other musings. HOM Speculation and Rumors 96 2005-05-26 16:35
OSX Server or Client? smiley Apple Products 1 2005-02-24 12:48
go get your security update thegelding Apple Products 8 2004-10-05 08:49
Mac OS X Tiger... Server MacUsers Apple Products 1 2004-06-28 18:26
OSX Web Server? Akumulator General Discussion 16 2004-06-24 02:35


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 19:17.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova