Readers like you help support MUO. When you make a purchase using links on our site, we may earn an affiliate commission. Read More.

Situation: I have Apache2 server with Linux Ubuntu OS 11.10.

Then I install a PhP5, MyAdmin, DNS server, LAMP server, MY SQL server.

This is what I have done:

- check localhost 127.0.0.1 and it works!

- edit index.html default webpage located in /var/www

- change my IP address to static

- restart /etc/init.d/apache2 restart {OK}

- bought a domain name

- turnes off Firewall on my router

Now I need Your HELP!

Please how and what needs to be done that other people around the world can type my domain name and connect to my server and default web page index.html located in /var/www? I do not care about security. I changed permission on /var/www/to 777 for the moment because I want to host my simple website or webpage only on my local server.

MAKEUSEOF VIDEO OF THE DAY
SCROLL TO CONTINUE WITH CONTENT

THANK YOU this is my first server and I guess YOU got the point.

My 3 questions are: How and what I need to do to connect to my server

from internet from any other PC.

RAHUL
2012-09-06 16:20:27
HOST THE WEBSITE ON YOUR PERSONAL WEBSERVER.....----------------------------------------------------------------------1. CONFIGURE YOUR BSNL BROADBAND ROUTER OR ANY OTHER BROADBAND ROUTER BY DOING PORT FORWARDING IN THIS YOU FIND DMZ OPTION....THIS OPTION ALLOW YOU TO USE ON ANY PARTICULAR PC ON WHICH YOU WANT TO HOST YOUR WEBSITE BY ASSIGING IP ADDRESS OF THAT PC2.NOW,CONFIGURE YOUR WEBSERVER WETHER IT IS IIS OR APACHE TOMCAT....NOTE :- CHECK YOUR WEBSITE FROM ANY OTHER PC WHICH IS NOT THE PART OF THIS ROUTERDUE TO NOT HAVING STATIC IP, THE IP ADDRES IS CHANGE AFTER EVERY CONNECTION SO CHECK UR IP ADDRESS BEFORE OPEN THE WEBSITE BY USING IPCONFIG COMMAND IN MSDOS
Patrick Jackson
2012-04-18 12:04:00
There is also a dead simple way:If you have or don't have a static IP, you can use services as DynDNS or FreeDNS (FreeDNS assumes that you have registered a domain, DynDNS has an option to provide a subdomain.). Both the services have apps for computer if you have a dynamic IP so that the website updates itself if your IP changes. But there can come some issues if your router does not forward your IP to the website.Good Luck!
sergii iermolenko
2012-04-18 12:17:00
sudo  nano/etc/network/interfacesauto eth0iface eth0 inet staticaddress 192.168.2.150netmask 255.255.255.0network 192.168.2.0broadcast 192.168.2.255gateway 192.168.2.1---------------------------------------and then I type ifconfig to check IP .Yes my IP now is static ,My question  is do I need to change my internal IP to external IP  like 345.231.567.876. (fake ip) 
Bruce Epper
2012-04-22 12:39:00
I am assuming you have a broadband connection of some sort (cable/dsl) in which case your modem's external interface will have your external IP address.  This is why you need to use port forwarding to get traffic destined for port 80 to go to your webserver.  What you are seeing as the 'gateway' is the internal interface of your router.  I've attached a basic network diagram that probably reflects your situation based on the IP configuration you listed.The solid arrowheads indicate traffic direction to/from devices.Your modem gets its external address from your ISP and arbitrarily takes 192.168.1.1 as the address for it's internal interface.  Your router gets its external address via the DHCP server running on your modem which will normally assign it an address of 192.168.1.2.  This is a mini-network between the 2 devices and it is shared with no other devices.  Your router then takes the address 192.168.2.1 for its internal interface.  All other devices you attach to your router, wireless or wired, will then get addresses on the same network subnet (192.168.2.xxx where xxx will range from 2 to 254).There should be a firewall enabled either on your modem or your router but you probably don't want it enabled on both devices.  Most commonly, the modem's firewall will be off and all of your firewall and routing configuration is handled on one device making it easier to manage.  As illustrated in the diagram, if you disable both firewalls, not only would your server be unprotected, but so is the laptop.With the modem's firewall turned off, all internet traffic that is passed to it will be automatically passed on to the firewall/router.  This is where you need to set up your port forwarding.  The details of how to accomplish that vary depending on the make and model of your router.  You will need to check your documentation for your router or respond here with that information if you need help setting that up.  The basics for port forwarding here is that any traffic that arrives on port 80 (http), you want the router to forward that traffic to 192,168.2.150 (the static address of your server).As long as you have your DNS records taken care of (described by James) or the alternatives provided by Patrick, you should be able to use a computer on the Internet to hit your website.If you think your firewall is the culprit making your website inaccessible, your router may allow you to put it in the DMZ which will effectively put your server outside of the firewall.
sergii iermolenko
2012-04-22 12:47:00
THANK YOU
sergii iermolenko
2012-04-17 07:26:00
. But I'm here to get professional help. I'm learning on the go .I have nothing to hide on my server.But thanks to  Bruce Epper I chmod 755 /var/www.I have no paranoia about security.I can not organize the work of my server.I will open all ports if necessary.I need instractions like cd ...go to directory open this type thatSamething like 1. Create ANAME record in your domain host to point to your home internet IP2. Create a routing rule to send traffic on port 80 to your linux machines internal IP.Not working for me becouse I don't know how .EASY WHEN YOU KNOW HOW.PLEASE TELL ME HOW.All I need is simple instractions to follow.THANK YOU .
Bruce Epper
2012-04-16 08:17:00
I must also sarcastically say "Congratulations!  You have also set yourself up to be hacked in under 30 seconds!"Changing of permissions of /var/www to 777 allows anyone who knows your external IP address or domain name to read, write, and execute ANYTHING in your website's home directory and if you did a recursive chmod for this, every directory under your website's home directory is just as exposed.  This means I could upload a malicious script or program to your server and at a minimum, run it with the same permissions as your apache server daemon.  This could be something as simple as changing anything on your website and possibly taking advantage of other paths to take over your entire computer.  The owner should be the only entity with write permissions; group and world should not be able to write to ANY of those folders.  In other words, the permissions on these folders should be 755.Running bind (DNS server) on this machine is unnecessary and is just exposing another potential attack surface. You want to keep all running services to a minimum especially on servers.Another step that helps out the hacker is disabling your firewall on the router.  If this server is not the only device on your network, you have opened the door to ALL devices on the network.The steps James gives are what you need to do to get your DNS records created/updated and routed to the right machine.  His comment about the irrelevance of the static IP on your server is not entirely correct though.  You don't want this one moving around either otherwise you would need to update your forwarding rule on the router every time it changes, so it is best to be static as well (or permanenty assigned based on MAC address in DHCP).
James Bruce
2012-04-16 11:23:00
Good point. In fairness, he did state he doesnt care about security though. It's possible he's setting up a honeypot of sorts…?
sergii iermolenko
2012-04-16 13:19:00
Speculation is good . But I'm here to get professional help. I'm learning on the go .I have nothing to hide on my server.But thanks to  Bruce Epper I chmod 755 /var/www.I have no paranoia about security.I can not organize the work of my server.I will open all ports if necessary.I need instractions like cd ...go to directory open this type thatSamething like 1. Create ANAME record in your domain host to point to your home internet IP2. Create a routing rule to send traffic on port 80 to your linux machines internal IP.Not working for me becouse I don't know how .EASY WHEN YOU KNOW HOW.PLEASE TELL ME HOW.All I need is simple instractions to follow.THANK YOU .
ha14
2012-04-15 12:18:00
simple dns plus?http://www.simpledns.com/Connect to a Server via Remote Desktophttp://www.hosting.com/support/dedicated/general/rdeskubuntuhttp://ubuntuforums.org/showthread.php?t=899871ran:iptables -I INPUT -p tcp --dport 80 -j ACCEPTCauses of Access-Denied Errorshttp://dev.mysql.com/doc/refman/5.5/en/access-denied.htmlopensshhttp://www.youtube.com/watch?v=hdvvEGShwts
James Bruce
2012-04-15 10:17:00
Sounds like you've just missed the step of changing your domain name servers to point toward your home IP. However, the static IP you set on your computer is not relevant. You need your INTERNET to have a static IP, and then your router needs to forward port 80 to your linux server. So. 1. Create ANAME record in your domain host to point to your home internet IP2. Create a routing rule to send traffic on port 80 to your linux machines internal IP. 
serg
2012-05-01 10:04:41
HOW HOW HOW
James Bruce
2012-05-01 10:10:12
Godaddy, mask a domain to a IP or other domain:http://support.godaddy.com/help/422/forwarding-or-masking-your-domain-nameRouting tutorial: http://www.draytek.co.uk/support/kb_vigor_portforwarding.html