Running virtual hosts on local testing environment

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
webdiva
-


Joined: 09 Sep 2005
Posts: 6

PostPosted: Fri Sep 09, 2005 10:56 pm    Post subject: Running virtual hosts on local testing environment Reply with quote

Hi

This is probably going to sound like a dumb question but I'm getting my knickers in a twist here. I have just bought Abyss server X2 purely for the fact that I want to use virtual hosting. I only want to test my sites locally as this is for development purposes.

It all works fine with localhost, but how do I setup a new website to run locally on my machine (therefore I have no IP or domain name - just the name), and browse to it? Say I wanted:

http://mynewwebsite

and within mynewwebsite I want to use relative URLS that would start from the root (/) which would be mynewwebsite, rather than having to specify the root: /mynewwebsite/. My local sites will eventually be uploaded to hosting and I don't want to have to go through and change all the root paths.

Does this make sense?
Back to top View user's profile Send private message Visit poster's website
Arctic
-


Joined: 24 Sep 2004
Posts: 560

PostPosted: Sat Sep 10, 2005 12:34 am    Post subject: Reply with quote

Use a port number.

Just use /index.html
Back to top View user's profile Send private message ICQ Number
webdiva
-


Joined: 09 Sep 2005
Posts: 6

PostPosted: Sat Sep 10, 2005 12:47 am    Post subject: Reply with quote

Hi

Thanks for the reply. I have tried using:

http://mywebsite:1024

but it doesn't go to my website (it doesn't work).

At the moment, I'm having to run my site on:

http://localhost/mywebsite

which means I'm having to use /mywebsite/index.html instead of just /index.html. If I can sort out this hosting then I'll be able to use relative paths.

I have bound the IP address to my localhost address but my browser is trying to resolve the URL on the www that I'm typing in rather than going to my localhost.

It's late so I'm probably missing the obvious here if anyone would be so kind as to point it out?
Back to top View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Sep 10, 2005 12:42 pm    Post subject: Re: Running virtual hosts on local testing environment Reply with quote

webdiva,

To do the local testing, you should use the hosts file which acts as a local DNS database.

Here is a small tutorial explaining how to declare a host:

* Create a directory in your hard drive where the files of the site should
to be stored. In this example, we'll assume that you will create a new
directory called website1 inside C:\sites .
* In Abyss Web Server console, press Add in the Hosts table.
* Enter 80 in the port field.
* [This step does not concern you since you're only going to do local testing] Enter the name of the new host in the Host name field (for example
www.myhost.com ).

www.myhost.com must be a valid registered domain name. Using your registrar tools, you configure it to (A record) point to your computer's IP address (for example 111.112.113.114). You don't need to have your DNS server for this. Your registrar usually offers this service for you when buying the domain names. If it doesn't, there are some companies that provide the same service such as http://www.zoneedit.com (free for 5 domain names). You can also use a free domain name such those provided by No-IP or DynDNS.

You should also ensure that your firewall (if you have one) accepts
connections made to port 80. You should also configure your router to
forward connections made to its external port 80 to the port 80 of the
computer where Abyss Web Server is running. This is called port forwarding
and the detailed steps to do that are explained in
http://www.portforward.com (choose your router brand/model there for the
exact instructions).

* Enter C:\sites\website1 in Documents Path (or press Browse and locate the
directory where the files of the site are.)
* Enter for example log\website1.log in Log File
* Select the configuration you want to duplicate for the current host in
"Copy Configuration From". If you want to start with the default parameters,
select Default configuration.

Press OK. The new host will be created. All you have to do now is to put the
site files in C:\sites\website1 (using Explorer or FTP.) Do not forget to
start the new host (press Start in its corresponding row in the Hosts
table.)

[This paragraph does not concern you since you're only going to do local testing] Now to see if it works, use an external site such as http://www.proxify.com
to test if http://www.myhost.com is accessible from the rest of the
Internet. Notice that you cannot test it locally as most routers doesn't
know how to do loopback.

To test your site locally using its domain name, we suggest using this tip:
For example, let's say you want to test the host http://www.myhost.com
locally. In the computer where you used to browse http://127.0.0.1 to get
the web site (which doesn't work anymore since the host has a name), open
the file C:\WINNT\system32\drivers\etc\hosts (or C:\Windows\hosts if you're on Windows 95/98/ME) with Notepad (or any text
editor) and add at the end of the file the line:

127.0.0.1 www.myhost.com

You can also add another line for another host name if you want:

127.0.0.1 www.mysecondsite.com

Save the file and browse http://www.mysite.com locally . You should see
the web site.

This file act like a local domain names database. The system does a lookup
in it before contacting an external DNS server to resolve the domain name
requested in the browser.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
webdiva
-


Joined: 09 Sep 2005
Posts: 6

PostPosted: Sun Sep 11, 2005 11:26 pm    Post subject: Reply with quote

Okay thanks. I will give these instructions a go.
Back to top View user's profile Send private message Visit poster's website
webdiva
-


Joined: 09 Sep 2005
Posts: 6

PostPosted: Tue Sep 13, 2005 10:47 pm    Post subject: Reply with quote

Okay. I have followed what you said and have added my site in the hosts file. Now instead of trying to resolve the domain name externally, it goes to the right place.

But my browser is treating the index.asp page as a download and is asking me where to save it. How do I get this to be served via the Abyss web server? (I have activeHTML installed and licenced).
Back to top View user's profile Send private message Visit poster's website
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1295

PostPosted: Tue Sep 13, 2005 10:58 pm    Post subject: Reply with quote

webdiva wrote:
But my browser is treating the index.asp page as a download and is asking me where to save it. How do I get this to be served via the Abyss web server? (I have activeHTML installed and licenced).

Are you sure that you have followed exactly all the instructions in http://www.aprelium.com/abyssws/asp.html for every host that should have ASP support?
If the problem persists, please send your abyss.conf file to support@aprelium.com and add a reference to this forum message.
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
webdiva
-


Joined: 09 Sep 2005
Posts: 6

PostPosted: Tue Sep 13, 2005 11:11 pm    Post subject: Reply with quote

Thank you - being a muppet I hadn't added that in so I deleted my host and started again and this time made sure to copy the localhost configuration. That done the problem still persists so it looks like I will have to go to support.
Back to top View user's profile Send private message Visit poster's website
webdiva
-


Joined: 09 Sep 2005
Posts: 6

PostPosted: Tue Sep 13, 2005 11:24 pm    Post subject: Reply with quote

Ah. Actually I take it back - it works in IE but not Firefox - just found out! It appears to also work in Opera - looks like I need to find out how to get it working in Firefox unless anyone has any ideas...?


Thanks
Back to top View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Wed Sep 14, 2005 11:21 am    Post subject: Reply with quote

webdiva wrote:
Ah. Actually I take it back - it works in IE but not Firefox - just found out! It appears to also work in Opera - looks like I need to find out how to get it working in Firefox unless anyone has any ideas...?

Try flushing FireFox' cache and retrying.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Wed Sep 14, 2005 12:08 pm    Post subject: Reply with quote

I usually find that I need to totally close Firefox/Mozilla and reopen it before any changes to my hosts file are picked up, even flushing the cache doesn't usually help.
_________________

"Invent an idiot proof webserver and they'll invent a better idiot..."
Back to top View user's profile Send private message
dtbradio
-


Joined: 10 Oct 2004
Posts: 10

PostPosted: Tue Oct 25, 2005 9:05 pm    Post subject: Reply with quote

I've found that Firefox or Any Mozilla browser generally needs to be shut donw and restarted AFTER clearing the cache. I run into the same issues when testing new domain structures and paths, believe me. It is SOOO annoying!
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group