I have bought virtual host for one year,they gave me an vps_ip to use. I went surfing the internet this way:my pc connect to a wireless route ,wireless route connect to the adsl. When to input 192.168.1.1 in the firefox,the route status is as the following:
WAN: MAC:A8:64:4D:34:A5:56 IP :153.0.48.32 PPPoE subnet mask:255.255.255.255 gateway:153.0.68.1 DNS:114.114.114.114 223.5.5.5
LAN MAC:A8:10:4D:76:A5:33 IP :192.168.1.1 subnet mask:255.255.255.0 DHCP:active
ifconfig inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
I have build a wordpress on my local 127.0.0.1 . How can i map or say bind 127.0.0.1 with my vps_ip? It is the goal that anyone input my vps_ip in the firefox ,the wordpress in my local 127.0.0.1 will be displayed.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
If I’m not getting your question wrong then you want to host your website on your computer and access it anywhere from the world?
If yes, then it’ a hard process, as your ISP provides different IP’s or dynamic IP’s to you, So it can’t be possible.
You need to have a static IP to get it done. But you can host your website on the system and can access it from any device in the same network using the private IP address like 192.168.1.1
Hello elearn,
If I am understanding this correctly, you would like to use the IP of your droplet here at digitalocean to let the public access your wordpress site with that? If I am right, this is not possible. The IP you are able to use, is only avaiable for the droplet you buy. However you could use your droplet as a little proxy, to redirect the IP of your droplet to your home network. There are 2 sections you need to work on to get this working:
Local network On your router you need to portforward port 80 to the outside of your network. So if you got the wordpress site running on the server with local ip “192.168.1.100” you need to portforward 80 on that machine on TCP. With this, people are able to access the site without being blocked by your router/modem. If you also go a firewall on your webserver machine, you also need to open port 80 on there
Public Droplet System You can let your DO droplet handle redirections to your own local webserver. To get this working you could use nginx for example. Things need to be done:
To install nginx, simply run sudo apt-get install nginx
After the installation of nginx is done, you will be able to find the configuration inside /etc/nginx/sites-available. So now we need to configure nginx, to let it handle and redirect the requests. Nginx will have a default configuration file, wich we will modify:
sudo nano /etc/nginx/sites-available/default
Inside you will probably see some codes and some comments. Delete all of it and use the following:
server {
listen *:80;
server_name 101.202.30.4;
rewrite .* http://153.0.48.32$request_uri permanent;
}
Modify the config to your needs. So change 101.202.30.4 to the VPS IP you got. Also change 153.0.48.32 to your PUBLIC WAN IP. If this is the ip as you say in your question, don’t change this.
Now save the config file and restart nginx
sudo service nginx restart
Thats it! :) Now go to 101.202.30.4 and if everything went well, you should be redirected to 53.0.48.32 Hope this will work for you, if not you can come back here.
Success, do as you say. To make the problem complicated, the ip address of my wan ip (public ip) is dynamics ,it change every 30 minutes, how to fix the code then?
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.