LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 03-19-2012, 05:13 AM   #1
tarunchawla
Member
 
Registered: Mar 2010
Location: Haryana,India
Distribution: Ubuntu 10.04 & Debian Wheezy
Posts: 111

Rep: Reputation: 3
How to edit configuration file in apache for hosting website on my machine.


I am using ubuntu 10.04 64 bit on my machine. I have static IP address and I want to use the static IP address to host my web site. I have installed apache2.2.17 on this machine.Now what I have done is when I type localhost it works.

Now I am sitting behind a local network and my local IP is 192.168.1.8
and public IP is some static IP address.I am using DLink switch which connects all these computers.

Now I want to make my computer web server such that when that static Ip is typed in browser anywhere in the world then my index.html file should be opened.

I have a device ADSL2 Router in which a phone cable is coming and has 4 outputs for RJ45 jack and one of the output is connected to Dlink switch from which 4 computers are connected and one computer is mine.Now help me to configure httpd.conf file so that when static IP address is typed in any browser any where in the world my index.html site is opened.

I am new to it so ignore if something is wrong with it,and if you required any other information that is missing I can provide you.

122.176.*.*----->ADSL Router----->Dlink Switch------>192.168.1.8

Last edited by tarunchawla; 03-19-2012 at 05:37 AM.
 
Old 03-19-2012, 05:27 AM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

I advise you to delete the public IP address in your post ASAP. That's asking for trouble. With regard to your setup, you should configure your router to assign always the same IP to your computer OR configure your computer with a static IP as you've done. Next you'll need to tell your router to forward all incoming traffic on port 80 to your LAN IP. And as a last point you'll need to configure Apache to listen on that IP. If you're using Ubuntu than you'll most likely have to edit /etc/apache2/sites-available/default or create a site-specific file to include your IP.

Kind regards,

Eric

Last edited by EricTRA; 03-19-2012 at 05:29 AM.
 
1 members found this post helpful.
Old 03-19-2012, 05:40 AM   #3
tarunchawla
Member
 
Registered: Mar 2010
Location: Haryana,India
Distribution: Ubuntu 10.04 & Debian Wheezy
Posts: 111

Original Poster
Rep: Reputation: 3
Thanks Eric How to forward all incoming traffic on port 80 on my LAN then how to configure apache,could you please elaborate this.
 
Old 03-19-2012, 05:41 AM   #4
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

That would be quite impossible without knowing make and model of your router. I assume you do have access to it (username/password)? In order to learn how to configure Apache to bind to a specific IP, have a look at the documentation.

Kind regards,

Eric

Last edited by EricTRA; 03-19-2012 at 05:43 AM.
 
Old 03-19-2012, 05:42 AM   #5
tarunchawla
Member
 
Registered: Mar 2010
Location: Haryana,India
Distribution: Ubuntu 10.04 & Debian Wheezy
Posts: 111

Original Poster
Rep: Reputation: 3
Yes I have access of it,I am trying to do the same for some time but me not able to find the option.
 
Old 03-19-2012, 05:44 AM   #6
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Quote:
Originally Posted by tarunchawla View Post
Yes I have access of it,I am trying to do the same for some time but me not able to find the option.
Hi,

Again, what's the make and model of the router?

Kind regards,

Eric
 
Old 03-19-2012, 05:45 AM   #7
tarunchawla
Member
 
Registered: Mar 2010
Location: Haryana,India
Distribution: Ubuntu 10.04 & Debian Wheezy
Posts: 111

Original Poster
Rep: Reputation: 3
wait for a minute....
 
Old 03-19-2012, 05:49 AM   #8
tarunchawla
Member
 
Registered: Mar 2010
Location: Haryana,India
Distribution: Ubuntu 10.04 & Debian Wheezy
Posts: 111

Original Poster
Rep: Reputation: 3
Product -ADSL2+CPE
Make-Beetel 450 TC1
This is what written on the router.
 
Old 03-19-2012, 05:54 AM   #9
tarunchawla
Member
 
Registered: Mar 2010
Location: Haryana,India
Distribution: Ubuntu 10.04 & Debian Wheezy
Posts: 111

Original Poster
Rep: Reputation: 3
Sir Is there any thing missing...
 
Old 03-19-2012, 05:57 AM   #10
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

Sorry, I'm not familiar with that type but the principle should be the same for all. Didn't you get a manual with the router? It should be somewhere in the Firewall or Security settings.

Kind regards,

Eric
 
Old 03-19-2012, 11:59 PM   #11
tarunchawla
Member
 
Registered: Mar 2010
Location: Haryana,India
Distribution: Ubuntu 10.04 & Debian Wheezy
Posts: 111

Original Poster
Rep: Reputation: 3
Thanks sir ,I have done it...
 
Old 03-20-2012, 01:29 AM   #12
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

Can you be a bit more specific? Does your post mean that you've configured everything and that it's working as it should or did you only configure the port forwarding on the router? Is there some part left to be configured?

Kind regards,

Eric
 
Old 03-20-2012, 11:52 PM   #13
tarunchawla
Member
 
Registered: Mar 2010
Location: Haryana,India
Distribution: Ubuntu 10.04 & Debian Wheezy
Posts: 111

Original Poster
Rep: Reputation: 3
I have done with port forwarding and listening to that IP and any body can open my webpage when apache is on. I have done port forwarding using access management option--->Porttriggering and virtual server option.
 
Old 03-21-2012, 02:24 AM   #14
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

So if I'm understanding you correctly, you're problem is solved? If that's the fact then please mark the thread as such. Also, since you'll be running a webserver on the internet now would be the perfect time to put in place some necessary security measures to avoid your server being hacked or subject to DOS or DDOS attacks. You never can be to careful.

Kind regards,

Eric
 
  


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
php website hosting problem on apache arafat khaliq Linux - Server 3 11-01-2010 02:50 PM
Hosting apache on a linux machine connected to a Dlink router mylvarab Linux - Newbie 1 05-23-2010 03:06 AM
Hosting a website on apache server metaljed Linux - Software 1 04-29-2009 09:46 AM
hosting asp.NET website on linux based server using Tomcat Apache harrybazeegar Linux - Server 3 06-02-2007 06:47 AM
Website Hosting and file/folder ownership vbfischer Linux - Security 2 07-01-2004 12:31 PM


All times are GMT -5. The time now is 05:43 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