Access my server through my public ip

Issues related to configuring your network
vestea
Posts: 6
Joined: 2018/02/04 22:11:45

Access my server through my public ip

Postby vestea » 2018/02/04 22:53:19

Hello
I installed CentOS server 7 on a dell server, I can access apache through local ip from server, 192.168.100.50.
But I want to access apache files remote through my public ip 92.85.60.x, is this possible? and what should I do? :?:

Thank you!

tunk
Posts: 250
Joined: 2017/02/22 15:08:17

Re: Access my server through my public ip

Postby tunk » 2018/02/05 21:33:11

I would guess that you have to setup your router to route http traffic to your server.

vestea
Posts: 6
Joined: 2018/02/04 22:11:45

Re: Access my server through my public ip

Postby vestea » 2018/02/09 13:15:50

tunk wrote:maybe is

Can I do this from ifcfg-em1 in /etc/sysconfig/network-scripts/ ?
My configurations are here:

Code: Select all

TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="dhcp"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="em1"
UUID="213846b-efa-495-86b-d137"
DEVICE="em1"
ONBOOT="yes"
ZONE=public

em1 inet is 192.168.1.x
and my public ip is 95.77.153.x
Does anyone have any idea?
Last edited by vestea on 2018/02/09 13:23:14, edited 1 time in total.

stevemowbray
Posts: 341
Joined: 2012/06/26 14:20:47

Re: Access my server through my public ip

Postby stevemowbray » 2018/02/09 13:22:48

No. You will have to forward the relevant ports on your router to your server.

vestea
Posts: 6
Joined: 2018/02/04 22:11:45

Re: Access my server through my public ip

Postby vestea » 2018/02/09 13:24:22

stevemowbray wrote:No. You will have to forward the relevant ports on your router to your server.

In my ISP router config?

stevemowbray
Posts: 341
Joined: 2012/06/26 14:20:47

Re: Access my server through my public ip

Postby stevemowbray » 2018/02/09 13:28:17

Whoever controls your router would have to do it, if that is what you are asking.

vestea
Posts: 6
Joined: 2018/02/04 22:11:45

Re: Access my server through my public ip

Postby vestea » 2018/02/09 14:14:49

stevemowbray wrote:Whoever controls your router would have to do it, if that is what you are asking.

Ok my router is a asus RT-AC87U
In what section should I configure?
Image

stevemowbray
Posts: 341
Joined: 2012/06/26 14:20:47

Re: Access my server through my public ip

Postby stevemowbray » 2018/02/09 14:30:05

First it would be a good idea to manually assign a fixed IP address to your server on that page, so that you know that it won't change.

Then find the section that deals with port forwarding and forward ports 80 and/or 443 (depending on whether you're doing http and/or https) to your server. I don't have an Asus router so I can't tell you where that section is to be found.

vestea
Posts: 6
Joined: 2018/02/04 22:11:45

Re: Access my server through my public ip

Postby vestea » 2018/02/09 14:40:03

stevemowbray wrote:First it would be a good idea to manually assign a fixed IP address to your server on that page, so that you know that it won't change.

Then find the section that deals with port forwarding and forward ports 80 and/or 443 (depending on whether you're doing http and/or https) to your server. I don't have an Asus router so I can't tell you where that section is to be found.

I found something Virtual Server/Port Forwarding.

vestea
Posts: 6
Joined: 2018/02/04 22:11:45

Re: Access my server through my public ip

Postby vestea » 2018/02/09 14:46:37

I set up in /etc/sysconfig/network

Code: Select all

HOSTNAME=mysite.com

and in /etc/hosts

Code: Select all

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.x   mysite.com localserver

I hope I did right.