Re: localhost or actual domain?
| From: | (Richard Lynch) | Date: | Wed, 06 Sep 2000 05:13:46 +0000 |
| Subject: | Re: localhost or actual domain? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15440@lists.php.net to get a copy of this message | ||
In article <agparscvb0r9jej09kgd7unvnu76h9lf55@4ax.com>, fbaker@olm1.com
(Floyd Baker) wrote:
> I know this is slightly off topic but can someone tell me what happens when
> installing apache on windows and, instead of calling it 'localhost', I use the
> actual domain name instead? As the directions say can be done.
>
> Until today, on my local win98 machine, I have been using the name 'localhost'
> with php3 and mysql and could reach my online domain name and database as well
> as the local databases, etc... If I were to use my online domain name in a
> new local machine installation, how would the two domains get along?
Would the
> local and the isp act as one domain? Or would they conflict? Can someone
> explain what goes on between the local and isp servers in this situation.
I'm confused as to what you're asking, but if it's what I *think* you are
asking, "Don't do that!"
You can use the IP assigned to *your* desktop machine or 127.0.0.1 or
localhost to refer to your desktop machine. The actual IP assigned to
your machine is probably different each time you logon unless your ISP has
given you a "static IP", so you'll have to find out what it is (Surf to a
page that has <?php echo $REMOTE_ADDR;?> in it) and then plug it into your
source code. This is only useful as an exercise -- Do *NOT* leave the IP
in there after you disconnect! It ain't your IP any more, it's somebody
else's!!!
But if you try to name your local desktop machine the same name as some
"real" web-server out there, you are going to confuse the heck out of your
machine, and might even manage to confuse the rest of the Internet, if you
work hard enough at it, as to which machine is which. The directions are
*not* saying to do that.
If your ISP has given you a static IP, and *IF* your web-host is willing
to do it for you, you could probably have laptop.olm1.com (or whatever
unique name you come up with) mapped by your ISP to your Win98 box.
Assuming you can figure out how to make Win98 understand that's its
name...
Your local machine *can* access other databases online, because there is
no rule that says the database server has to live on the same machine as
the web server -- In fact, in high-end, high-volume, high-availability
setups you don't *want* them on the same box. You can split them apart
and throw more hardware at each. So the way your local machine talks to
your remote database is the same way your remote site does. It connects
through the same mechanism; there just happen to be way more machines in
between bouncing the signals around. Your remote machine essentially
"talks to itself" when using the database on it.
Hope I'm making sense...
--
Richard Lynch | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA | http://www.L-I-E.com/artists.htm
http://www.zend.com | (this has nothing to do with Zend,
duh!)