| Author |
Message |
Amirtaiar
Joined: 03 Dec 2011
Posts: 16
Location: Israel
|
| Posted: Sat Dec 03, 2011 4:06 pm Post subject: Enter website through IP and not domain |
|
|
How can I enter a dev website on my linode only through the IP adress and not the domain which don't point to Linode yet?
I have tried - 1.2.3.4/srv/www/domain with no luck.
[1.2.3.4 - Is my IP] |
|
| Back to top |
|
bryantrv
Joined: 11 Dec 2009
Posts: 126
|
| Posted: Sat Dec 03, 2011 9:05 pm Post subject: |
|
|
| I do it by pointing my computers hosts file to the dev ip- for me it is /etc/hosts - win uses something like c:\windows\system32\drivers\etc\hosts |
|
| Back to top |
|
Amirtaiar
Joined: 03 Dec 2011
Posts: 16
Location: Israel
|
| Posted: Sun Dec 04, 2011 12:22 am Post subject: |
|
|
bryantrv wrote: I do it by pointing my computers hosts file to the dev ip- for me it is /etc/hosts - win uses something like c:\windows\system32\drivers\etc\hosts
How do I do it? What are the commands? |
|
| Back to top |
|
NeonNero
Joined: 04 Jan 2005
Posts: 215
Location: Ålesund, Norway
|
| Posted: Sun Dec 04, 2011 5:38 am Post subject: |
|
|
If you're using Windows, run Notepad (or a text editor) as Administrator (Windows Vista or 7 - for XP, it's not necessary), and open the file C:\WINDOWS\system32\drivers\etc\hosts (no file extension, and assuming that C:\WINDOWS is your Windows install folder).
If you're using Linux, use your favorite text editor and open the file /etc/hosts.
If you're using Mac OS X, see this article: Mac OS X: How to Add Hosts to Local Hosts File
When you have your hosts file open, add the following line (replace my examples with your Linode's IP and your domain name):
Code: 1.2.3.4 example.com www.example.com
It doesn't matter how many spaces you have between each of these "words", or if you're using the <tab> key, as long as there's some whitespace between them. |
|
| Back to top |
|
sleddog
Joined: 31 Aug 2008
Posts: 101
|
| Posted: Sun Dec 04, 2011 6:50 am Post subject: |
|
|
Just to add to what NeonNero said...
On Windows, if the hosts file does not exist, create it.
On Windows in Notepad when saving the file, put the filename in quotes -- like "hosts" -- to prevent Windows from automatically adding a .txt extension.
hosts.txt will not work, the file must be named hosts with no extension. |
|
| Back to top |
|
Amirtaiar
Joined: 03 Dec 2011
Posts: 16
Location: Israel
|
| Posted: Sun Dec 04, 2011 8:38 am Post subject: |
|
|
NeonNero wrote:
If you're using Mac OS X, see this article: Mac OS X: How to Add Hosts to Local Hosts File
When you have your hosts file open, add the following line (replace my examples with your Linode's IP and your domain name):
Code: 1.2.3.4 example.com www.example.com
It doesn't matter how many spaces you have between each of these "words", or if you're using the <tab> key, as long as there's some whitespace between them.
I a mac user - The link isn't working but I have edit my local /etc/hosts file and add this follow line:
1.2.3.4 domain.com domain [with the correct details].
I added the linode IP.
Nothing happens when entering this IP in the browser.
What am I missing here? |
|
| Back to top |
|
Amirtaiar
Joined: 03 Dec 2011
Posts: 16
Location: Israel
|
| Posted: Sun Dec 04, 2011 8:46 am Post subject: |
|
|
Forgot sudo...
Working now...
Thank you... |
|
| Back to top |
|
bryantrv
Joined: 11 Dec 2009
Posts: 126
|
| Posted: Sun Dec 04, 2011 9:00 am Post subject: |
|
|
| I keep the required lines in my hosts file and just #comment them out when needed . |
|
| Back to top |
|
| |