LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 06-26-2011, 09:11 AM   #1
splinux
Member
 
Registered: Jun 2011
Location: Sri Lanka
Distribution: centos,redhat,ubuntu
Posts: 90

Rep: Reputation: Disabled
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 ?

Last edited by splinux; 06-26-2011 at 09:17 AM.
 
Old 06-26-2011, 09:16 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,511

Rep: Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884
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
 
1 members found this post helpful.
Old 06-26-2011, 09:21 AM   #3
splinux
Member
 
Registered: Jun 2011
Location: Sri Lanka
Distribution: centos,redhat,ubuntu
Posts: 90

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-26-2011, 09:35 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,511

Rep: Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884
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
 
1 members found this post helpful.
Old 06-26-2011, 09:50 AM   #5
splinux
Member
 
Registered: Jun 2011
Location: Sri Lanka
Distribution: centos,redhat,ubuntu
Posts: 90

Original Poster
Rep: Reputation: Disabled
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 ?
 
Old 06-26-2011, 09:55 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,511

Rep: Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884
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
 
Old 06-26-2011, 10:00 AM   #7
splinux
Member
 
Registered: Jun 2011
Location: Sri Lanka
Distribution: centos,redhat,ubuntu
Posts: 90

Original Poster
Rep: Reputation: Disabled
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 ?
 
Old 06-26-2011, 10:11 AM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,511

Rep: Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884
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
 
1 members found this post helpful.
Old 06-26-2011, 10:16 AM   #9
splinux
Member
 
Registered: Jun 2011
Location: Sri Lanka
Distribution: centos,redhat,ubuntu
Posts: 90

Original Poster
Rep: Reputation: Disabled
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

Last edited by splinux; 06-26-2011 at 10:17 AM.
 
Old 06-26-2011, 10:17 AM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,511

Rep: Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884
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
 
1 members found this post helpful.
Old 06-26-2011, 10:23 AM   #11
splinux
Member
 
Registered: Jun 2011
Location: Sri Lanka
Distribution: centos,redhat,ubuntu
Posts: 90

Original Poster
Rep: Reputation: Disabled
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 ?
 
Old 06-26-2011, 10:46 AM   #12
splinux
Member
 
Registered: Jun 2011
Location: Sri Lanka
Distribution: centos,redhat,ubuntu
Posts: 90

Original Poster
Rep: Reputation: Disabled
<VirtualHost sp2.sp.com:8008>
now it is working.. thank for ur help..
 
Old 06-26-2011, 10:57 AM   #13
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,511

Rep: Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884
No problem.
You can mark the thread solved using the thread tools.

Kind regards
 
Old 07-12-2011, 08:16 AM   #14
pwalden
Member
 
Registered: Jun 2003
Location: Washington
Distribution: Fedora FC19, Raspbian
Posts: 289

Rep: Reputation: 38
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Creating the SSH server in home with the dynamic public ip ? splinux Linux - Server 20 06-15-2011 03:00 PM
Do you have a local or public server at home? blahblalblah General 6 03-11-2011 01:48 PM
Public and private NIC for web server vondie Linux - Server 2 08-28-2009 08:24 AM
Setting up a public web/mail server gViscardi Linux - Server 7 03-20-2007 07:46 AM
Same permissions on two files, but only one can be accessed by web server? murr4y Linux - Software 5 06-14-2005 02:59 AM


All times are GMT -5. The time now is 12:38 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration