VPS IP address for local site

hasanghaforian

I have no experience in about Apache and want to set up Apache Virtual Hosts on Ubuntu 14.04 LTS for a local site on my local machine. I followed this page. But when I try to test http://example.com I got this result in browser:

 Example Domain

 This domain is established to be used for illustrative examples in
 documents. You may use this domain in examples without prior
 coordination or asking for permission.

 More information...

And I expected to get Success! The example.com virtual host is working! as result (as described in followed tutorial).

In that tutorial, I did not understand:

 For the domains that I used in this guide, assuming that my VPS IP
 address is 111.111.111.111, I could add the following lines to the
 bottom of my hosts file

So I used 111.111.111.111 in /etc/hosts and I guess problem is in about that, but I searched in google and did not find any thing about how to get my VPS IP address to use that. Now how I can get that address or I make mistake and I have to set an address and then use it? In second case how can I do that?

user.dz

Step Six — Set Up Local Hosts File (Optional)

If you haven't been using actual domain names that you own to test this procedure and have been using some example domains instead, you can at least test the functionality of this process by temporarily modifying the hosts file on your local computer.

This will intercept any requests for the domains that you configured and point them to your VPS server, just as the DNS system would do if you were using registered domains. This will only work from your computer though, and is simply useful for testing purposes.

Make sure you are operating on your local computer for these steps and not your VPS server. You will need to know the computer's administrative password or otherwise be a member of the administrative group.

If you are on a Mac or Linux computer, edit your local file with administrative privileges by typing:

sudo nano /etc/hosts

He is clearly talking about a second machine not the VPS server. Because if those domains are not yours, you can't have a public DNS to point them to your VPS server. So you can go the other way and trick your second machine using hosts files.

  1. In your VPS server, run ifconfig to get its public IP.
  2. In you second machine, edit /etc/hosts file and add the below line with that IP:

    vps-server-ip example.com
    vps-server-ip test.com
    

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

IPV6 Unique-local address and site local address

分類Dev

Get local IP address from "ip route" cross-platform

分類Dev

Is it possible to access a Firebase hosting site via an IP address?

分類Dev

VPS with multiple ip and iptables

分類Dev

How to know a mac address for a Node knowing its IP on local network?

分類Dev

JavaScript net.connect() - explicitly set local endpoint IP address

分類Dev

APIPA (link-local) IP address in Windows Registry

分類Dev

Getting MAC Address of devices using Local Network IP Address(192.168.xxx.xxx)

分類Dev

Is it possible to SCP from a remote to local whilst logged into the remote and without knowing the local's IP address?

分類Dev

No site configured at this address

分類Dev

Linux/Oracle db: how to access website in same subnet using local IP address?

分類Dev

IP camera RTSP address

分類Dev

binding ip address to hostname

分類Dev

Shared external IP address

分類Dev

Is this subnetted IP address valid?

分類Dev

Is the address of a local variable a constexpr?

分類Dev

Local umbraco site permissions issue

分類Dev

単一のIPでVPSにSSH接続

分類Dev

1 VPS with 2 IP addresses. How to make them independent?

分類Dev

How to setup VPS to forward multiple IPs to a single static IP

分類Dev

Calculate CIDR given an IP address

分類Dev

Retrieving the client request ip address

分類Dev

Retrieving the client request ip address

分類Dev

Create an IP Address as a hex value

分類Dev

How to set static IP address?

分類Dev

VPN without Static IP address

分類Dev

extracting ip address from a file

分類Dev

How to find ip address in codeigniter?

分類Dev

stop access to website by IP address

Related 関連記事

ホットタグ

アーカイブ