You are not logged in.

#1 2011-12-04 21:12:03

pyarch
Member
Registered: 2011-09-30
Posts: 169

How to get my apache server running on my ip address?

I am new to apache server. I installed apache server as described in :
https://wiki.archlinux.org/index.php/LAMP

Firstly where do I store the files that I want to open using my apache server and how do I like map my public ip to apache server?
say my public ip is x.x.x.x
how do I get it work such that next time in browser instead of typing http://localhost/ if I type my public ip it shows the contents on my server.
Thanks

Offline

#2 2011-12-04 21:13:30

swanson
Member
From: Sweden
Registered: 2011-02-05
Posts: 759

Re: How to get my apache server running on my ip address?

Check out no-ip.com

Offline

#3 2011-12-04 22:23:02

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How to get my apache server running on my ip address?

And you need to forward the required port(s) on your router (nothing to do with arch).

Offline

#4 2011-12-05 15:09:04

gopichand
Member
From: Bowling Green, KY
Registered: 2010-02-04
Posts: 31

Re: How to get my apache server running on my ip address?

Read completely before trying.....

1. Register an account at www.dyndns.org, its free, up to two domains.
2. Login to dyndns and create a domain of your choice.
3. This dyndns keeps track of your router IP addresses which is typically dynamic.
4. Now we need to update the ip addresses of the domain when ever it changes. It generally changes every time we restart the router. In order to do it automatically we will setup the dyndns account on the router.
5. On the router, login as admin to change/setup the settings. The router can be reached with the ip 192.168.1.1, this ip addresses changes with the manufacturer, like for belkin its 192.168.2.1
6. On the router check for something which says DDNS, here you can setup the dyndns.
7. Give the login details for your dyndns and the domain name.
8. So, now you have linked your router to your dyndns and you can reach the router from anywhere in the world by type the domain name. The ip is not reliable since its dynamic and so it changes.
9. No to use an application on a computer connected to the router. You need to use port forwarding.
10. By using port forwarding, we can make the router redirect the requests to a computer on the network.
11. Now again, your computer is typically connected to router using DHCP or dynamic ip. So need a static ip address for the computer as well so that it will remain constant all the times and the router can redirect the requests to this ip.
12. Make the computer acquire a static ip. Configure your system for static ip. You just need to specify some ip address out of the dhcp range. So a static ip address can be 192.168.1.101 (as first 100 are for dhcp).
13. Now on the router look for Port-Forwarding or Virtual Servers etc...
14. You will be able to see a list of text boxes for ip and port.
15. Now specify ip address of the static ip address computer and any port number like 8080. Make the private port or the internal port as the port number of your application. Application name can be anything. Type can be UDP or Choose Both, use TCP only if your are connected with a LAN cable.
16. Here is an example...

If we are using a webserver on our computer which runs on port 8080, we use it by typing..
http://localhost:8080

If someone on the same router whats to use our webserver they can type in:
http://<ip-address>:8080 which can be http://192.168.1.5:8080
Here as you can see, the ip address is dynamic, so change it to 101 from 5. When you choose static, the OS will ask you to specify the ip address, then just specify the ip as 101.

Now you can access the web server by using the ip:
http://192.168.1.101:8080

But this can be done only by the people connected to the same router. Now we need to make it accessible by anyone in the world. So we need to make people access your computer which is behind the router.
So first we need to make people access the router. But since the router's public IP is dynamic. We need something to keep track of the ever changing ip address of the router. Such kind of service is the dyndns.org
By specifying the login details and domain from dyndns inside the router, the router uploads the new IP everytime it changes to the dyndns servers. The dyndns keeps track of the ip address.

lets say our domain is registerd as: project.dyndns.org
we provide this domain and login details to our router, and the router updates the ip address in case of any changes.

We will now be able to reach the router by typing:
http://project.dyndns.org

we dont have to worry about the ip address any more.

But still we need to get to the computer to access the web server.

So we have to link the router to the computer. As we know our computer is at IP 192.168.1.101
Now we will setup the port forwarding so that any request to a port A on the router will be redirected to a port B of the IP 192.168.1.101, which is the computer itself.

Here port B is 8080 on the computer with the IP 192.168.1.101

So we need to link a port say 8090 on the router to the 8080 on the computer.
So, configure your router for port forwarding so that the 8090 on the router will point to 8080 on 192.168.1.101

Now, anyone can access the router by typing:
http://project.dyndns.org
But to reach the computer we need to type the port as well, so type:
http://project.dyndns.org:8090

So any request to 8090 will be redirected to the 8080 on the computer which is handled by the webserver on the computer.


EDIT:
Once everything is setup, you can use the domain for SSH and other remote access tools. Just do the port forwarding for the required tools separately.

Last edited by gopichand (2011-12-05 15:16:23)


Open your mind, use OpenSource!

Offline

#5 2011-12-05 15:21:45

swanson
Member
From: Sweden
Registered: 2011-02-05
Posts: 759

Re: How to get my apache server running on my ip address?

I don't think dynddns is free anymore.

Offline

#6 2011-12-05 15:38:37

gopichand
Member
From: Bowling Green, KY
Registered: 2010-02-04
Posts: 31

Re: How to get my apache server running on my ip address?

I just registered with a new email address and checked.
From what I understand, if you try the PRO then you can keep one domain for FREE.
So, you might want to try.

If you do not want to try the dyndns, you can use the no-ip.com as pointed by swanson. or write a script which will get the public ip address from no-ip(you need to get a webpage), redirect that output/file to a folder like dropbox (if you have any) so that you can find those ip address in your drop box if you are away from your home network.

@swanson: you were right, I did not realize that its not free anymore as my domain was working all the way. As I said, if you try the pro you can keep the free domain.

EDIT: I think its not free, though you can purchase, the website is asking for Credit card info, which I will not be OK with.
So we need to use something like no-ip.com

Last edited by gopichand (2011-12-05 15:56:31)


Open your mind, use OpenSource!

Offline

Board footer

Powered by FluxBB