LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to edit configuration file in apache for hosting website on my machine. (https://www.linuxquestions.org/questions/linux-networking-3/how-to-edit-configuration-file-in-apache-for-hosting-website-on-my-machine-935245/)

tarunchawla 03-19-2012 05:13 AM

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

EricTRA 03-19-2012 05:27 AM

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

tarunchawla 03-19-2012 05:40 AM

Thanks Eric How to forward all incoming traffic on port 80 on my LAN then how to configure apache,could you please elaborate this.

EricTRA 03-19-2012 05:41 AM

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

tarunchawla 03-19-2012 05:42 AM

Yes I have access of it,I am trying to do the same for some time but me not able to find the option.

EricTRA 03-19-2012 05:44 AM

Quote:

Originally Posted by tarunchawla (Post 4630424)
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

tarunchawla 03-19-2012 05:45 AM

wait for a minute....

tarunchawla 03-19-2012 05:49 AM

Product -ADSL2+CPE
Make-Beetel 450 TC1
This is what written on the router.

tarunchawla 03-19-2012 05:54 AM

Sir Is there any thing missing...

EricTRA 03-19-2012 05:57 AM

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

tarunchawla 03-19-2012 11:59 PM

Thanks sir ,I have done it...

EricTRA 03-20-2012 01:29 AM

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

tarunchawla 03-20-2012 11:52 PM

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.

EricTRA 03-21-2012 02:24 AM

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


All times are GMT -5. The time now is 05:54 AM.