Re: [users@httpd] How do I determine my server's name?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



William Rowe wrote, "What a silly app... the right test is to see if the request came in 
through
127.0.0.1 (al la localhost loopback) and distrust the rest :)

ipconfig should tell you your IP, maybe your name on win32."
Sorry, I'm a little confused. It sounds like you're suggesting I'm using the wrong script to begin with? This is it:

if (
$_SERVER['SERVER_NAME'] == 'your local name') {
     
// config options for local host
} else {
    
// config options for online host
}

If I understand correctly, you're suggesting I use IP address in lieu of server name - right?

I Googled for IPConfig, found this page:


http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ipconfig.mspx?mfr=true

...and followed some instructions which revealed my local IP address is 192.168.0.2 (I think). So now I need to somehow change my PHP script so that it works with IP address, rather than SERVER_NAME?

I think I've discovered one advantage to using server name - I would assume it's stable. It looks like my IP address may have changed when I canceled my dial up account and went with DSL and thence to wireless.

At any rate, thanks for the feedback. I'm getting closer - I think? :)


"William A. Rowe, Jr." <wrowe@xxxxxxxxxxxxx> wrote:
What a silly app... the right test is to see if the request came in through
127.0.0.1 (al la localhost loopback) and distrust the rest :)

ipconfig should tell you your IP, maybe your name on win32. Try ifconfig
on Mac. Then nslookup {your ip} to see if it is known, otherwise your
server's 'name' is really it's IP.

David Blomstrom wrote:
> This is probably a dumb question, but how do I determine the name of my
> server (local and online)? I have a PHP script that's supposed to modify
> a value depending on whether a file is online or local, and it requires
> the name of my local server. I'm using Apache in both my PC and my Apple
> laptop, but I wasn't aware that my local server had a name.
>
> Thanks.
>
> ------------------------------------------------------------------------
> Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great
> rates starting at 1¢/min.
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
" from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux