LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   apache server with static ip can be access globaly (https://www.linuxquestions.org/questions/linux-newbie-8/apache-server-with-static-ip-can-be-access-globaly-4175429061/)

piyushsingh 09-26-2012 02:25 AM

apache server with static ip can be access globaly
 
PLEASE HELP ME...I AM IN BIG TROUBLE...
I HAVE CONFIGURED APACHE SERVER IN RHEL 6 THAT CAN BE ACCESSED LOCALY I HAVE ISP.MY STATIC IP IS 59.177.X.X AND MY LINUX MACHINE TAKES 192.168.1.3 ..I WANT TO MAKE AN APACHE SERVER THAT CAN BE ACCESS GLOBALY ..PLZZ HELP ME.I HAVE ALSO DONE THIS FOR PORT FORWARDING
'iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080'.AND I HAVE ALSO CHANGED IN /etc/httpd/conf/httpd.conf LISTEN 8080.
please help me guys i am in big trouble.my mind is not working now

eSelix 09-26-2012 05:08 AM

You need to change destination IP on router (there where is access to this external IP), like that:
Code:

iptables -t nat -A PREROUTING -p tcp -d 59.177.X.X --dport 80 -j DNAT --to-destination 192.168.1.3:8080
Do not use REDIRECT target, it is for other purposes. If you have no access to router, therefore have no access to external IP, you can't publish your LAN servers. Then you can only talk with your provider to redirect for you one or more ports (but surely no 80), or buy your own public IP address.

P.S. Please do not use capital letters on whole post.

piyushsingh 09-26-2012 05:25 AM

Thanks lot sir..
sir as you said to purchase public ip.i have purchased ip and i mentioned it my static ip is of beetel450tc1 of mtnl.sir please tell me is there any configuration should i do with my beetel 450tc1 router.sir my apache server is accessible localy ..plz tell me the steps that i follow to make my apache server globaly..i will be greatfull to you sir...
please help me out this please

eSelix 09-26-2012 06:17 AM

Sorry, I have no manual for your router. After login to router there should be somewhere option about NAT or port forwarding or port triggering. There you enter external port and your internal IP and port to redirect. Check this link about Port forwarding for Beetel 450TC1.

piyushsingh 09-26-2012 06:49 AM

Apache server with static ip
 
Thanks a lot sir..for showing your interest
sir in my router configuration there is port triggering .you just tell me that what port no should i write there '80' or '8080' as in /etc/httpd/conf/httpd.conf file i have changed it listen 8080...and any other things that i should do with httpd.conf please tell me...as i have told static ip is 59.177.x.x and my linux machine takes 192.168.1.3..please tell me all step that i should after compliting my apache server that is running localy to run it globaly.i mean tell me all step to make apache server run globaly ..please sir ..sorry for any mistakes

eSelix 09-27-2012 04:20 AM

You only need forward port 80 on your router to PC where Apache is installed on proper port, that is: 192.168.1.3:8080. In port triggering you have to enter incomming port or port range (80), destination IP (192.168.1.3) and destination port or port range (8080) and probably any name for this rule. After changing httpd.conf options remember to restart Apache.

piyushsingh 09-28-2012 06:17 AM

i have done all this ..again when i am trying to open http://59.177.x.x:8080 it is not openinig ..please help me .
when i check on portchecker it shows my static ip's 59.177.x.x port 80 is closed..please help me

eSelix 09-28-2012 02:07 PM

Check on PC, where Apache is running if it really works with command
Code:

sudo netstat -4lnp | grep :80
Check if you get response on internal network by writing into browser address "http://192.168.1.3:8080/" Your external addres should be "http://59.177.x.x:80" not "http://59.177.x.x:8080". Check your firewall on server by "iptables -L".


All times are GMT -5. The time now is 11:10 PM.