LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Closed Thread
  Search this Thread
Old 08-20-2015, 05:46 AM   #1
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Rep: Reputation: Disabled
How to map my private ip which change dynamically onto my vps_ip in digitaloean's dr


I have create a droplet in digitalocean,there is a vps_ip i can use.
In my home the way connected to the internet is: route+modem+adsl.
I built a wordpress on the local pc on my home.
The net status is as below when to connect to the web.

WAN:
MAC:ommitted for privacy
IP :public_ip PPPoE
subnet mask:255.255.255.255
gateway:153.0.68.1
DNS:114.114.114.114 223.5.5.5

LAN
MAC:ommitted for privacy
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

My goal: let the public access my wordpress site on the home pc with vps_ip digitalocean gave me.

Thank to CrypticDesigns ,https://www.digitalocean.com/communi...ith-my-vps_ip?
I have solved the problem with the help of CrypticDesigns.

In my local network:

On my router portforward port 80 and private ip 192.168.1.100 to the outside of your network.

In public droplet system:

sudo apt-get install nginx
sudo nano /etc/nginx/sites-available/default
server {
listen *:80;
server_name vps_ip;
rewrite .* http://publlic_ip$request_uri permanent;
}
sudo service nginx restart

Anyone who go to the vpsip can browse my wordpress now.
It is important that my ip address on the wan changes about every 30 minutes.How about 30 minutes later?
The publicip will change,the configurration file /etc/nginx/sites-available/default can't work .
I want to make improvements on the problem.
It is my opinion to make the task done that :
1.in my home pc
The command curl ipinfo.io/ip can get my public ip.
Write it into crontab for every 30 minutes.
2.send the vpsip and change the value of publicip in /etc/nginx/sites-available/default
,and restart nginx.

How to express the two steps with shell command to make the process automatic?
 
Old 08-20-2015, 07:23 AM   #2
MCD555
Member
 
Registered: May 2009
Location: Milan, Italy
Distribution: Ubuntu, Debian, Fedora, Oracle Linux
Posts: 109

Rep: Reputation: 10
Hi,

you already get a response to this, please do not open multiple or duplicated thread.
Just deleted my previous answer.

Last edited by MCD555; 08-20-2015 at 07:33 AM. Reason: Already asked/response question
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to map my local ip 192.168.1.100 with my vps_ip? luofeiyu Linux - Server 1 08-19-2015 04:05 PM
Change dynamically internet default interface Tekiano Linux - Networking 5 12-26-2012 05:10 AM
Dynamically change display of an xterm or program patoury Linux - Newbie 1 07-27-2010 05:46 AM
Dynamically change ip address on boot up carolw Linux - Newbie 2 08-05-2003 02:08 AM
change partition size dynamically kodiakmook Linux - General 3 01-07-2002 02:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration