LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache2 Virtual host on LAN (https://www.linuxquestions.org/questions/linux-software-2/apache2-virtual-host-on-lan-587953/)

jordankoppole 09-28-2007 05:13 AM

Apache2 Virtual host on LAN
 
Hi,

I want to run different apps whose cgi-bins are different. Virtual host configuration gives about the domain name. I access the machine with ip like http://xx.xx.xx.xx/abcd. If I want diff apps on that server I can go with different ports. How do i setup it using ports or urls..


Thanks

acid_kewpie 09-28-2007 05:22 AM

accessing a web server by ip address is never a good idea. can you really not use some form of DNS or local hosts files at worst??

lucastic 09-29-2007 06:45 AM

What exactly is it you are trying to do, perhaps with a few more details we can give you a better answer.

jordankoppole 09-30-2007 10:01 PM

Setup
 
Actually i am trying to run diff versions of a application on the same server. The requests to the apache in turn will be passed to the one of the multiple tomcat servers running. But I use cgi-bin also because of which I need multiple virtual hosts. Hope I am clear

bjagee 10-16-2007 09:57 AM

Add the desired ports to the httpd.conf (or ports.conf file if you have one).

Code:

Listen 80

# Uncomment the following if you will be using SSL
# Listen 443

# Add any additional ports here.
# Listen ??

You can also specify a listen on only one ip/port:
Code:

Listen 192.168.1.1:8000
Next you need to set up virtual hosts on the desired ports. The easiest way to do this is to create a custom .conf file for the host with all of the settings in it and include it at the end of your apache2.conf or httpd.conf.

Code:

include /path/to/virtualhostfile.conf
Code:

<VirtualHost 192.168.1.1:8000>
DocumentRoot /path/to/html
...
</VirtualHost>

It is actually best to use names when you can; if you choose to do that you can do name based hosting. I wrote a post on apache2 with virtual hosting if you need more resources.


All times are GMT -5. The time now is 01:53 AM.