Thread
Mac as a web host server
I see that I can use my Mac as a webserver, and can even log into it from within my network from other PC's. Right now when I use IE and type in the Macbox's local address 192.168.0.x it comes up with that Apache web page.
But how would I make it visible to the world outside my cable modem? I read this webpage, and it made sense (I know my OSX will be slightly different) however I have a few questions.
The outside world will access the IP address of the router attached to the cable modem, and I can use a DNS service or whatever to match that IP address to whatever .com name I would like to use right?
I leave the router on all the time, so the IP would probably rarely change, but DNS services should allow you to change the actual IP right?
The Mac isn't the only computer on the router so how would I direct the web page requests to the Mac?
Am I missing something important here? It seems like a real easy thing. I'm not planning on anything big, just basically I would like to host my own images and stuff and don't want to have to worry about disk size limitations of a host service, plus it would be much easier to manage my files locally.
BTW: Mac in question is a Mini 1.25Ghz 1gb ram with OSX 10.39. I have 10.4, but have not installed it yet.
But how would I make it visible to the world outside my cable modem? I read this webpage, and it made sense (I know my OSX will be slightly different) however I have a few questions.
The outside world will access the IP address of the router attached to the cable modem, and I can use a DNS service or whatever to match that IP address to whatever .com name I would like to use right?
I leave the router on all the time, so the IP would probably rarely change, but DNS services should allow you to change the actual IP right?
The Mac isn't the only computer on the router so how would I direct the web page requests to the Mac?
Am I missing something important here? It seems like a real easy thing. I'm not planning on anything big, just basically I would like to host my own images and stuff and don't want to have to worry about disk size limitations of a host service, plus it would be much easier to manage my files locally.
BTW: Mac in question is a Mini 1.25Ghz 1gb ram with OSX 10.39. I have 10.4, but have not installed it yet.
Quote:
|
Originally Posted by Chuckit
If your IP is dynamically assigned, you'll want to use DynDNS.
And directing outside requests to your Mac means forwarding port 80 to the computer that you want. |
OK, so port 80 is the Internet port? Will this affect other computers on the network (IE: incoming Internet will be steered to just the Macbox?)
most likely not.
but i would suggest getting a Switch instead. they retain ips better on macs and they send the info directly to that computer instead of all computers as a router does.
with mac os x it is super simple to use your computer as a web host. though installing things such as php and mysql dont always work right for people like me.
just go to system prefs. Sharing. and enable the internet sharing. once you do this. right below it will tell you the default address that the computer gives your website based on ip or an address based on your isp address.
but i would suggest getting a Switch instead. they retain ips better on macs and they send the info directly to that computer instead of all computers as a router does.
with mac os x it is super simple to use your computer as a web host. though installing things such as php and mysql dont always work right for people like me.
just go to system prefs. Sharing. and enable the internet sharing. once you do this. right below it will tell you the default address that the computer gives your website based on ip or an address based on your isp address.
just a side note: port 80 is the typical port for HTTP
so that is the default port that is accessed for web pages
so that is the default port that is accessed for web pages
Quote:
|
Originally Posted by westrock
OK, so port 80 is the Internet port? Will this affect other computers on the network (IE: incoming Internet will be steered to just the Macbox?)
|
Port 80 is the port that the Web server runs on by default. Any outside traffic trying to connect to port 80 will be redirected to that computer, which is what you want. Otherwise it won't affect anything.
Quote:
|
Originally Posted by jay3ld
with mac os x it is super simple to use your computer as a web host. though installing things such as php and mysql dont always work right for people like me.
|
PHP is already installed at least as of 10.3. And MySQL has a package installer now too, so that's double-click simple.
then i must be missing something else to run a phpnuke webpage from my computer.
You do have to edit two lines in your httpd.conf file to make Apache use PHP.
kool worked.
2 questions. were is the database stored
and is there a phpmyadmin for mac?
thanks.
i am really interested in this. i have my own .com and i would like to be able to test mods and addons without screwing up my site. so thats why im trying to get this to work.
oh a 3rd question. how do i install mysql??? or does mac have it? i cant seem to get a phpnuke running but that test.php file they had me do works.
2 questions. were is the database stored
and is there a phpmyadmin for mac?
thanks.
i am really interested in this. i have my own .com and i would like to be able to test mods and addons without screwing up my site. so thats why im trying to get this to work.
oh a 3rd question. how do i install mysql??? or does mac have it? i cant seem to get a phpnuke running but that test.php file they had me do works.
Quote:
|
Originally Posted by jay3ld
were is the database stored
|
What database?
Quote:
|
Originally Posted by jay3ld
and is there a phpmyadmin for mac?
|
VersionTracker tells me so. I use CocoaMySQL, personally.
Quote:
|
Originally Posted by jay3ld
oh a 3rd question. how do i install mysql???
|
Download the Installer package from MySQL.
thanks for all your help but i got the last and hopefully final questions
ok since mysql was installed i got phpmyadmin to work.
but i get these 2 errors.
1. What is this error? and how to fix
2. How do i set this root user password?
EDIT:
OH
i was in the phpmyadmin and...
i was changing root password so that stupid error would stop bothering me and now i cant log in or get it to change the set up files right to log in.
stupidy!!!!
How do i either set up or get back no password?
im so stupid
ok since mysql was installed i got phpmyadmin to work.
but i get these 2 errors.
1. What is this error? and how to fix
code:
The $cfg['PmaAbsoluteUri'] directive MUST be set in your configuration file!
2. How do i set this root user password?
code:
Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole.
EDIT:
OH

i was in the phpmyadmin and...
i was changing root password so that stupid error would stop bothering me and now i cant log in or get it to change the set up files right to log in.
stupidy!!!!How do i either set up or get back no password?
im so stupid
Quote:
|
Originally Posted by jay3ld
What is this error? and how to fix
|
http://www.google.com/search?client...=UTF-8&oe=UTF-8
Quote:
|
Originally Posted by jay3ld
i was in the phpmyadmin and...
i was changing root password so that stupid error would stop bothering me and now i cant log in or get it to change the set up files right to log in. stupidy!!!!How do i either set up or get back no password? |
No need to panic. MySQL has a walkthrough on this. Basically, here's what you do:
1. Stop MySQL (you can do this from the prefpane).
2. Create a text file in your home folder called "fixmysql" and put the following text inside:
code:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');
where MyNewPassword is, of course, your new password.
3. In the Terminal, type
MySQL will restart with the new root password and everything should be gold.code:
/usr/local/mysql/bin/mysqld_safe --init-file=~/fixmysql
that didnt work but i just reinstalled mysql and it works. i didnt have anything important so reinstalling everything wont hurt me
I wasn't real sure what you guys are talking about and whether it applies to me as well.
However I went to the router (linksys WCG200) and under Applications & Gameing > Port Forwarding I madeup an application name and did port 80 for both stop and start and forwarded it to 192.168.0.12. So now when I type in the IP address of the router (http://66.190.70.77/), the browser says it can't connect.
I have not touched anything under /etc. Do I need to change some stuff under there? Also if I just type in the local IP of the Mac I do get the Apache default page.
However I went to the router (linksys WCG200) and under Applications & Gameing > Port Forwarding I madeup an application name and did port 80 for both stop and start and forwarded it to 192.168.0.12. So now when I type in the IP address of the router (http://66.190.70.77/), the browser says it can't connect.
I have not touched anything under /etc. Do I need to change some stuff under there? Also if I just type in the local IP of the Mac I do get the Apache default page.
I get the default Apache page at 66.190.70.77. Try again, maybe?
Hmm, I don't know. I can't see it from a PC that is also behind the wall. It gets a failure to connect error on IE. I placed the PC in the DMZ and didn't make any difference. But if you say it works, then thats a start 
My router is an integrated router/cable modem/wifi, so I can't place one of the PC's in front of the router.

My router is an integrated router/cable modem/wifi, so I can't place one of the PC's in front of the router.
ur site isnt working for me
but ok
i got phpmyadmin running fine. now i want to make it so when i go to the secret fold name that it asks to login like when you go to a web site were the .htaccess is asking you to log in
also how would i do .htaccess? i dont know what to put for AuthUserFile
i have one but when i go to the site nothing happens just loads the page like it cant access the .htaccess but i changed my httpd.conf file to allow that file to override its settings.
but ok
i got phpmyadmin running fine. now i want to make it so when i go to the secret fold name that it asks to login like when you go to a web site were the .htaccess is asking you to log in
also how would i do .htaccess? i dont know what to put for AuthUserFile
i have one but when i go to the site nothing happens just loads the page like it cant access the .htaccess but i changed my httpd.conf file to allow that file to override its settings.
I can't access the site either. I assume his IP has changed or his server has been turned off.
Quote:
|
Originally Posted by jay3ld
ur site isnt working for me
but ok i got phpmyadmin running fine. now i want to make it so when i go to the secret fold name that it asks to login like when you go to a web site were the .htaccess is asking you to log in also how would i do .htaccess? i dont know what to put for AuthUserFile i have one but when i go to the site nothing happens just loads the page like it cant access the .htaccess but i changed my httpd.conf file to allow that file to override its settings. |
This site has info on authentication settings for phpMyAdmin.
As for .htaccess files, the AuthUserFile needs to point to an AuthUserFile (surprise). Check this tutorial for an example of how to create it.
hello all,
sorry to resurrect this thread but i seem to be a bit confused.
i set up a sever at home, and using dns via my domain account features pointed it to my server.
how do insert dyndns.org into this equation? should i use domain url forwarding to point my domain to my dyndns account instead, and then let dyndns do its thing?
thanks all.
here are the 2 sites currently on the server btw: www.joshazzarella.com
www.tiffanycalvert.com
sorry to resurrect this thread but i seem to be a bit confused.
i set up a sever at home, and using dns via my domain account features pointed it to my server.
how do insert dyndns.org into this equation? should i use domain url forwarding to point my domain to my dyndns account instead, and then let dyndns do its thing?
thanks all.
here are the 2 sites currently on the server btw: www.joshazzarella.com
www.tiffanycalvert.com
Does your home computer have a static IP address? If so, you just need to put that IP address in your DNS record for these URL's.
If you don't have a static IP address, you need to pay for Custom DNS services with DynDNS, then use the DynDNS name servers for your DNS resolution. DynDNS has pretty good info on it (or ask back here, or message me directly...)
-Scott
If you don't have a static IP address, you need to pay for Custom DNS services with DynDNS, then use the DynDNS name servers for your DNS resolution. DynDNS has pretty good info on it (or ask back here, or message me directly...)
-Scott
Quote:
|
Originally Posted by genevish
Does your home computer have a static IP address? If so, you just need to put that IP address in your DNS record for these URL's.
If you don't have a static IP address, you need to pay for Custom DNS services with DynDNS, then use the DynDNS name servers for your DNS resolution. DynDNS has pretty good info on it (or ask back here, or message me directly...) -Scott |
Scott,
I have a dynamic ip, but have no problem updating them manually once i get this mess figured out. it's only 2 sites, so i dont think it'll be a big deal.
I guess i'm getting confused with my 2 ip addresses, which is internal / external and which goes where.
they are : 67.85.182.81 and 192.168.0.101
which one goes into the url's dns record? if i go here it gives me the 67.... address. shouldnt this one go in the domain dns since it's external?
then i have to figure out port forwarding on this d link router.
thanks so much for the help,
best,
-j
Yes, the IP address that's visible to the world (the 67.85.x.x one) is the one you should use in your DNS record. If you have more than one computer, you'll want to assign the server a static IP in your LAN so you can forward ports to the internal IP address. (You won't have to do that if you only have one computer, since it should always get the first address available.)
Any clearer?
Any clearer?
My next question is:
why do all 3 computers connected to my network have the same external ip address? wont this simply confuse things?
and can anyone point to a good, thorough tutorial so i dont have to bug all of you nice people?
why do all 3 computers connected to my network have the same external ip address? wont this simply confuse things?
and can anyone point to a good, thorough tutorial so i dont have to bug all of you nice people?
Quote:
|
Originally Posted by jersey
My next question is:
why do all 3 computers connected to my network have the same external ip address? wont this simply confuse things? and can anyone point to a good, thorough tutorial so i dont have to bug all of you nice people? |
They all have the same external IP because the router you are using does NAT, or IP Masquerading. Essentially, you have an internal LAN connected to one of the router's NICs and there's an external one which connects to the Internet. Everything from outside your LAN sees the external NIC and it's your router which figures out where to send packets inside the LAN - so, unless you port-forward requests on certain ports of the router to specific machines on the LAN they are dropped. It's a nice security feature as well: only computers on the LAN can instantiate connections (if there's no user defined port forwarding going on). NAT is also a nice way around the shortage of IPv4 addresses.
Well, that's the gist anyway - check wikipedia or google at large for more info, I suppose.
wikipedia, good suggestion.
This page seems to have the info on how to set up the port forwarding on the D-Link router.
The issue I see is the fact that each ISP caches DNS information. This means that when I go to your website, I'll get the IP address from my ISP's DNS server, not yours. If you change the IP address on your domain name, it will take several hours to several days for the new IP address to propagate throughout the other DNS servers.
The issue I see is the fact that each ISP caches DNS information. This means that when I go to your website, I'll get the IP address from my ISP's DNS server, not yours. If you change the IP address on your domain name, it will take several hours to several days for the new IP address to propagate throughout the other DNS servers.
not to rain on your parade but if it were up to me, i wouldn't use the mac as a server:
http://www.anandtech.com/mac/showdoc.aspx?i=2436&p=8
the mac is quite slow in mysql and php services - choose to use linux instead or heaven forbid, windo......z
http://www.anandtech.com/mac/showdoc.aspx?i=2436&p=8
the mac is quite slow in mysql and php services - choose to use linux instead or heaven forbid, windo......z
Quote:
|
Originally Posted by hhlee
not to rain on your parade but if it were up to me, i wouldn't use the mac as a server:
http://www.anandtech.com/mac/showdoc.aspx?i=2436&p=8 the mac is quite slow in mysql and php services - choose to use linux instead or heaven forbid, windo......z |
Hehe, the man is hosting it on a dynamic IP address and he's planning to update the DNS records manually when the IP address changes. I don't think speed is a great concern. I host my own site on my home Mac and it works fine for my needs...