LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Home Web Server accessed by Public IP (https://www.linuxquestions.org/questions/linux-server-73/home-web-server-accessed-by-public-ip-888430/)

splinux 06-26-2011 09:11 AM

Home Web Server accessed by Public IP
 
I have configured web server in my home. it is working in LAN.
but every one should be accessed from out site from LAN.

how is possible ? i would like to access as http://123.123.123.123 Then i dont need the host name. ?

My public IP http://123.123.123.123
My LAN IP http://192.168.10.10

i did the port forwarding in my router. when i access the web from outside automatically logging into my ADSL router.

what are the further setting i have to do ?

repo 06-26-2011 09:16 AM

Forward port 80 on the router to the webserver.
Open port 80 in your firewall.
Make sure your provider doesn't block port 80.
Do you have a static IP?

Kind regards

splinux 06-26-2011 09:21 AM

Thanks for interest in my question
I flush the firewall already..my ISP doesnt block the 80 for dynamic ip. my one is dynamic ip.

repo 06-26-2011 09:35 AM

Quote:

when i access the web from outside automatically logging into my ADSL router.
Disable webaccess from the outside on the router, or use another port for your webserver.

Kind regards

splinux 06-26-2011 09:50 AM

I try to disable but There is no option to diable

we can change the port number.. how to change that port number ?
what are the setting i have to do in router and my web server ?

repo 06-26-2011 09:55 AM

If you use apache:
https://lijinjoseji.wordpress.com/20...e-http-server/
On the router, forward the port you configured, on the firewall open the same port.
You can use 8080
Please be aware, you need to add the port when you connect
Kind regards

splinux 06-26-2011 10:00 AM

what is the use of this command ?

cp /etc/httpd/ports.conf /etc/httpd/ports.conf_backupgedit /etc/httpd/ports.conf


what i need to type in /etc/hosts ?

repo 06-26-2011 10:11 AM

Quote:

cp /etc/httpd/ports.conf /etc/httpd/ports.conf_backup
This will make a backup of the original file, so you can put it back in case of problems.
Quote:

gedit /etc/httpd/ports.conf
Find this line
Code:

Listen 80
replace with
Code:

Listen 8080
If
Code:

/etc/httpd/ports.conf
doesn't exist, you need to alter
Code:

/etc/httpd/httpd.conf
restart apache

Kind regards

splinux 06-26-2011 10:16 AM

http://112.135.203.201:8008

i tried but it is showing the centos appache default page only... not showing my page ?


it is not available in my OS /etc/httpd/ports.conf

repo 06-26-2011 10:17 AM

Quote:

If you are the website administrator:

You may now add content to the directory /var/www/html/. Note that until you do so, people visiting your website will see this page and not your content. To prevent this page from ever being used, follow the instructions in the file /etc/httpd/conf.d/welcome.conf.
Kind regards

splinux 06-26-2011 10:23 AM

vim /etc/httpd/conf/httpd.conf

inside that i added these lines in the bottom

<VirtualHost sp2.sp.com:80>
DocumentRoot /var/www/sp2
DirectoryIndex index.html
ServerName sp2.sp.com
</VirtualHost>

i have made a folder in under the /var/www/sp2
created a index.html in that folder but it is working in locally..but why not working out site ?

splinux 06-26-2011 10:46 AM

<VirtualHost sp2.sp.com:8008>
now it is working.. thank for ur help..

repo 06-26-2011 10:57 AM

No problem.
You can mark the thread solved using the thread tools.

Kind regards

pwalden 07-12-2011 08:16 AM

I see your problem is solved. I had the similar problem with a Linksys WRT54G router. I had it set up to forward port 80 to my apache server. This was working, but then it suddenly stopped working and whenever I tried to access the server, I would instead get redirected to the Linksys admin page.

My problem turned out to be that I had UPnP enabled in the router. I also had a new internet webcam that had UPnP enabled. It turned out the cam used UPnP to automatically reconfigure the router to have its port 8081 forwarded to it. However, the Linksys then began to ignore all its manual port forwarding setting. It could not handle a UPnP enabled device and do manual port forwarding. The cure was to disable UPnP on the router. Not sure if this is applicable to you, but it solved my problem.


All times are GMT -5. The time now is 10:06 AM.