PDA

View Full Version : server question: ip browsing


symbolic
24-01-2009, 01:53 PM
I need to build a test site on a hosted server (Apache) that has not yet got a domain name associated with it. Using the IP address I was able to gain access via FTP but I am unable to preview the site using a web browser.

So my question is - HOW do I use a web browser to preview a site that has no domain name?

I don't mind how complicated the URL needs to be (if that's the solution), it's only for preview purposes. The reason for this arrangement is that my client wants to go live instantly (when new site is ready) by simply changing DNS settings to the new host.

Thanks!

SteveC
24-01-2009, 02:38 PM
The hosting company should be able to set you up with a virtual URL, for example... we use our domain name followed by the clients domain name... ... your host should be able to set up something similar... if not get them to give you an IP based account... that way you can access the site via the IP address.

kay
24-01-2009, 03:41 PM
If the hosting account is set up for the correct domain name, you can put an entry in your computer's hosts file to trick it into thinking that's where the domain is:

000.000.000.000 www.example.com

If you're on Windows, your hosts file is in /windows/system32/drivers/etc/hosts (there's no extension) and you can edit it in Notepad. You'll probably have to reboot afterwards. From then on, whenever you browse to that domain name, you'll be directed to that IP address. It won't work if the hosting account is not configured for that domain, however.

Just remember to remove the hosts entry when you go live :)

Tekhaus
24-01-2009, 05:49 PM
Kay's suggestion is spot on, it's the easiest approach if your host hasn't provided a test url.

NB: It will only work if you have a static IP for your domain. You don't need to restart windows either, it should pick it up at the very next request.

If you are on a Linux based machine (and it's configured to allow it), chances are your website can be viewed from http://ipaddresshere/~username

Hope that helps

If the hosting account is set up for the correct domain name, you can put an entry in your computer's hosts file to trick it into thinking that's where the domain is:

000.000.000.000 www.example.com

If you're on Windows, your hosts file is in /windows/system32/drivers/etc/hosts (there's no extension) and you can edit it in Notepad. You'll probably have to reboot afterwards. From then on, whenever you browse to that domain name, you'll be directed to that IP address. It won't work if the hosting account is not configured for that domain, however.

Just remember to remove the hosts entry when you go live :)

kay
24-01-2009, 08:21 PM
NB: It will only work if you have a static IP for your domain. You don't need to restart windows either, it should pick it up at the very next request.

That's not correct. It will work for shard IP addresses as well, as long as the domain is configured for the account. If the site had a dedicated IP, you could browse the site directly with the IP address, no need to alter your hosts file.

ashul
25-01-2009, 09:27 AM
Kay you sure do know your stuff :)

symbolic - the reason you can use FTP with just the IP address is because that protocol does not use host headers (ie name resolution) -based on the login details it works out which shared site you are accessing and takes you to the home directory.

When you use http on a server configured to host multiple sites on the same IP it needs a name to be sent to it so it can send you to the correct website (folder) it is just how that protocol works. So inyour hosts file you can create any entry - eg, serverip mytestsite but make sure you tell apache to resolve mytestsite to the site you are developing.

Another way to do this is just create a sub-domain for any domain you already have - client.yourdomain.com.au and use that for the client to use for testing.

temp
25-01-2009, 03:01 PM
host file is the way

kay
26-01-2009, 08:56 AM
Kay you sure do know your stuff :)

Apart from being old school in general, I just recently migrated 35 hosting accounts off one reseller hosting account to a number of others. I have a virtual machine set up with a modified hosts file so I could browse each site on the old and new accounts simultaneously.

It got rather tedious very quickly!

ashul
26-01-2009, 04:38 PM
I really think basic TCP/IP, FTP, SMTP, DNS and HTTP should be thought to web devs in Tafe/Uni or should be there as an elective - Best thing that I ever did on the MCSE path was the initial networking course that was a pre-requisite for everything else - used to be called Networking Essentials - it laid a brilliant foundation for how things work on the Internet..

We have been in the process of moving accounts from one co-lo to another for the last 3 months - it is a nightmare! esp with AD involved (due to SharePoint) and we are migrating from one server farm to a new one, so not a simple case of move boxes over and change IP's..

kay
26-01-2009, 09:21 PM
I really think basic TCP/IP, FTP, SMTP, DNS and HTTP should be thought to web devs in Tafe/Uni

Interestingly (to me, anyway), I was taught Perl and HTML in the same unit in (I think it was) second year of the ECU multimedia course - the original course, which looks nothing like the current (we're talking 1997 here). We used Macs with System 7 (which is where I developed my intense dislike of Apple machines) and the tools we had were Quid Pro Quo, a free web server for Macs which we had to install at the beginning of each session, and Simpletext (this is predating Dreamweaver by quite some time). So a fair whack of HTTP was involved in that unit, which everyone else hated but I adored (cept for the Macs).

When Dreamweaver 1 was released, we used to install the trial in the labs at the beginning of each session (the machines got restored from a disk image on every login) because it was the *only* HTML editor that didn't change your code every time you turned around (Claris Homepage and Adobe Pagemill being the worst offenders). DW gets bagged so much now, but the reason it's still so popular and one of the reasons I still love it so much is that it was the first true IDE for web development.

Um anyway, what were we talking about?

ashul
26-01-2009, 10:43 PM
Um anyway, what were we talking about?
umm hic fireworks? that is some software that macromedia created? just been and back from south perth and they were like the most awesome too much to drink :)

Franki
27-01-2009, 10:00 AM
I need to build a test site on a hosted server (Apache) that has not yet got a domain name associated with it. Using the IP address I was able to gain access via FTP but I am unable to preview the site using a web browser.

So my question is - HOW do I use a web browser to preview a site that has no domain name?

I don't mind how complicated the URL needs to be (if that's the solution), it's only for preview purposes. The reason for this arrangement is that my client wants to go live instantly (when new site is ready) by simply changing DNS settings to the new host.

Thanks!

DNS switch is not instantaneous.

You're likely to be a virtual hosting enviroment. So try http://ip/~username ("~" is required. username is the same as your FTP username).

If one makes website, one really need to acquire some basic knowledge of how web server works...

tolranet
29-01-2009, 10:50 PM
DNS switch is not instantaneous.
You can get it pretty quick if you have sufficient access to the DNS zone files or your host is helpful.

Assuming you do have access then the day before you want to go live, may be more depending on the current settings, you edit the zone and lower all the A records, MX and TXT as well depending on the final mail server settings, to 60 seconds. Then when you want to make the new site live just edit the IPs to be those of the new server, for the most part the new site is live in 60 seconds or so.

Once you're happy the new site is working you either restore the TTL values to something sensible or update the name server fields on the domain, depending on your requirements. If the new site fails horribly just change the IPs back and a minute or so later the old site is in place again.

Apart from a few heavy handed DNS caches total change time of old to new site 60 seconds ish. Also works when moving a site between servers and hides the 24 - 48 hours name server updates can take.

Franki
30-01-2009, 12:59 PM
That's correct, but you're also "assuming" that all ISPs do actually adhere DNS time settings and not cache them.

Cindy
30-01-2009, 01:23 PM
That's correct, but you're also "assuming" that all ISPs do actually adhere DNS time settings and not cache them.
Goes back to your earlier comment

If one makes website, one really need to acquire some basic knowledge of how web server works...
If you have a basic knowledge you would know what to look for in web hosts. I've had about 50 successful "instantaneous" DNS moves this year between about 10 different servers.

Sometimes it just involves a nice little chat with the hosts if necessary.

Franki
30-01-2009, 04:50 PM
Goes back to your earlier comment


If you have a basic knowledge you would know what to look for in web hosts. I've had about 50 successful "instantaneous" DNS moves this year between about 10 different servers.

Sometimes it just involves a nice little chat with the hosts if necessary.

Do you know the difference between a web host and an ISP Cindy? DNS caching has got nothing to do with web hosts.

FYI, I've been a web host and in web hosting for probably as long as you been on the web... are you taking it personal because I've smacked you down somewhere? so yeah whateveeeer.

edit/add: you may have been lucky that your ISP didn't cached DNS/following standards. Not all ISP adhere to standards and cache DNS to save traffic and loads. So just because it's instant on your end doesn't mean that it's instant for all users across the world, hence you'll find many web hosts will tell you to take "DNS propagation" into consideration when moving IP/server. so yeah, whateverrrrr Cindy :P

tolranet
30-01-2009, 06:21 PM
That's correct, but you're also "assuming" that all ISPs do actually adhere DNS time settings and not cache them.
Yep, which is why I did say "Apart from a few heavy handed DNS caches ..." be it ISPs or in the users Firewall or whatever, but for the most part doing the above I only see traffic to the old site for a few minutes at worst, there's always going to be exceptions but I'm going to guess the bulk adhere or that's been my experience to date.

Cindy
30-01-2009, 07:30 PM
are you taking it personal because I've smacked you down somewhere? so yeah whateveeeer.
I can really see why you disagreeing with me somewhere else over a totally different subject is going to influence what I say here. Here's a novelty, I might just say something because I would like to say it :)

Personal jabs bore me.

Franki
31-01-2009, 09:55 AM
Personal jabs bore me.

At least you've now walked off with some knowledge :B

Franki
31-01-2009, 10:05 AM
Yep, which is why I did say "Apart from a few heavy handed DNS caches ..." be it ISPs or in the users Firewall or whatever, but for the most part doing the above I only see traffic to the old site for a few minutes at worst, there's always going to be exceptions but I'm going to guess the bulk adhere or that's been my experience to date.

ISP are getting better, no doubt about that. As a matter of fact, a few of the larger WA ISPs used to be some of the worse culprits in extended DNS caching, and if it wouldn't be for web hosts like myself coming down on them (getting sysadmins on the phone and insist that they flush the cache while I'm waiting), they would have drag their feet a bit more...

When you're a web host and you're NOT dealing with a single point of entry, the problem is much much more apparent.

ashul
31-01-2009, 10:48 AM
edit/add: you may have been lucky that your ISP didn't cached DNS/following standards. Not all ISP adhere to standards and cache DNS to save traffic and loads. So just because it's instant on your end doesn't mean that it's instant for all users across the world, hence you'll find many web hosts will tell you to take "DNS propagation" into consideration when moving IP/server.

i actually tested how long some isp's cache the dns for last year when we changed the public ip for the www hostname of the eduka domain. i left the old ip enabled with the website still available on it for a year and we had traffic to it for nearly 5 months - for the first 2 it was mostly from places where ip bandwidth is still hard to get or expensive and then surprise surprise was bots not going to the ip address but getting there via the hostname - so there is nothing instantenous on the internet it is all virtually instantenous

tolranet
31-01-2009, 10:53 AM
When you're a web host and you're NOT dealing with a single point of entry, the problem is much much more apparent.
Actually I am a web host and have been for a good few years, so yes I know it happens, I know things like old versions of outpost firewall cached DNS on the users PC and there's still software about doing that.

I've just found the majority of traffic switches when told, stragglers get the old site until their ISP/software updates unless you route the traffic over on the servers or as you say get hold of the offender and have them flush their cache.

Mr C
05-02-2009, 03:19 AM
Interestingly (to me, anyway), I was taught Perl and HTML in the same unit in (I think it was) second year of the ECU multimedia course - the original course, which looks nothing like the current (we're talking 1997 here). We used Macs with System 7 (which is where I developed my intense dislike of Apple machines) and the tools we had were Quid Pro Quo, a free web server for Macs which we had to install at the beginning of each session, and Simpletext (this is predating Dreamweaver by quite some time). So a fair whack of HTTP was involved in that unit, which everyone else hated but I adored (cept for the Macs).


Ah the memories. I was there in 97 too (Comp Sci major, IMM minor). Didn't you hate it when when wanted to use a Mac and all the 3D students had hogged all the machine and left "Rendering, do not touch" notes on the keyboards.

I hated those macs. Don't mind the modern ones. Have gotten quite used to OS X.

kay
05-02-2009, 10:07 AM
I hated those macs. Don't mind the modern ones. Have gotten quite used to OS X.

Yeah, System 7/8/9 was 'orrible. My first experience with a Mac was it freezing and then the tutor not being able to make it restart (it didn't have an on/off switch, only the keyboard button) so crawling under the desk to pull the power cable out :)

scross
05-02-2009, 12:07 PM
I really think basic TCP/IP, FTP, SMTP, DNS and HTTP should be thought to web devs in Tafe/Uni or should be there as an elective - .

I absolutely agree! I've just complete my interactive multimedia degree and have been working as helpdesk in web hosting while studying, so I've been able to get the best from both world, client side and server side. A unit on how the internet works is sorely lacking in the degree and an elective unit would be so valuable to developer's education.

It would sure stop me from having to answer so many questions :)

chase
26-02-2009, 03:58 PM
Yeah, System 7/8/9 was 'orrible. My first experience with a Mac was it freezing and then the tutor not being able to make it restart (it didn't have an on/off switch, only the keyboard button) so crawling under the desk to pull the power cable out :)

Oh I remember those from high school. I have vague memories of finding ways to make it crash and doing so religiously to drive my poor IT teacher crazy. I couldn't love OSX more, being a unix girl at heart.

I'm always surprised when I see webdev's with no clue about the very protocols that enable them to do their work. That is pure laziness in my not so humble opinion. ;)