Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello. I've installed a simple LAMP server using SSH on a workstation on my network and everything is working fine inside my network but I can't access my server outside of my network. I have read countless linux articles and tutorials but I haven't found the solution to my problem. I have followed the tutorial here howtoforge.com/perfect_setup_ubuntu_6.10_p3 but I think I am not understanding one of the steps when it comes down to binding a static IP to my box so it can be used behind my linksys 4-port router. What settings do I need to put in my /etc/network/interfaces file? The tutorial suggests:
However I'm not sure what I need to put in for each value.
The lan IP i'd like my linux box to use is 192.168.1.9. I can access my router by 192.168.1.1 My netmask is 255.255.255.0. My WAN Ip is 67.49.90.44. Im not sure what I neet to put in for network gateway and broadcast. I was able to access my box from within the network by removing gateway broadcast and network and putting in the same valus I do for my windows maching but I was unable to log in from outside.. I have opened all the ports I needed in my router. I'm pretty sure all I need to figure out is this file.
No, the problem is on the router. If you have assigned 192.168.1.9 to the LAMP server, then the router needs to be configured to port forward any requests it receives at port 80 on the public address on the internal address 192.168.1.9 at port 80.
As long as on the LAN you can see the site by 192.168.1.9 in the address bar, then just get the port forwarding set from the 67.49.90.44 at 80 to 192.168.1.9 at 80.
The gateway is the router's address, which you said is 192.168.1.1, and broadcast is 192.168.1.255. This is all basic networking info. A little google time or a search here would have solved this for you easily.
Thanks a bunch. I have re-installed linux on my server and try to re-do everything fresh. I am still unable to to browse my apache webserver from the internet. I know my server is connected because I am able to download packets via wget. I have added Those lines to my /etc/network/interfaces aswell. I can access my server via PUTTY using my WAN IP but I can't browse my webserver using my wan ip. Seems I have pinpointed the problem with apache there much be a config thats set up improperly. Any suggestions?
Can you see the website on the linux box by sending another computer on your LAN to http://192.168.1.9 ? If that works and going to the WAN address doesn't, then it is 2 possible things.
1) The router is not forwarding correctly
2) Your ISP is blocking connections at port 80
If you only have one site on the machine, and you can reach it locally, then it also has to be fine for the public IP, it just becomes a question of if the public port 80 is correctly mapped to the private IP at port 80. Please double check that the same way you forward port 22 for SSH is also forwarded for port 80.
Hey Jim thanks for your reply. Yes I am able to view the website on my network by visiting 192.168.1.19. In apache's port config file I have port 80 and port 443 as suggested to howtoforge tutorial. Both ports have been opened in my router. It's interesting that I am only having problems with my webserver, my SSH server is working. I am now led to beleive the problem is my ISP blocking port 80 (socal.rr) however less than 2 weeks ago I was able to run a windows web server (abyss web server) on port 80 which worked. S0 either the that's not the problem or out of bad luck my ISP JUST blocked port 80 recently. I am going to try and change ports in the apache config file. Is there a way I can tell if my ISP blocked port 80, or do I just have to call them?
I'd simply call, you're not doing anything wrong by asking if you can run a webserver.
The fact that it worked on windows but not on linux makes it sound even more like you don't have the mapping done right. You didn't mention that in your last post. You have to explicitly map WAN IP port 80 to 192.168.1.9 port 80.
If your ISP is recently blocking you, don't change apache at all. Leave it be at 80, and use your router to translate to port. If 80 is blocked, then have port 81 on the WAN IP forwarded to 192.168.1.9 port 80 on the LAN. The only drag about that is the url will then need to be changed to end with :81. That will be the case regardless of how you change the port if that is the problem. For example, what was http://yoursite.com will now become http://yoursite.com:81
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.