LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-28-2007, 06:13 AM   #1
LQ Newbie
Registered: Sep 2007
Posts: 9

Rep: Reputation: 0
Apache2 Virtual host on LAN


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..

Old 09-28-2007, 06:22 AM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971
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??
Old 09-29-2007, 07:45 AM   #3
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Rep: Reputation: 30
What exactly is it you are trying to do, perhaps with a few more details we can give you a better answer.
Old 09-30-2007, 11:01 PM   #4
LQ Newbie
Registered: Sep 2007
Posts: 9

Original Poster
Rep: Reputation: 0

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
Old 10-16-2007, 10:57 AM   #5
Registered: Jan 2007
Location: Portland, OR
Distribution: Ubuntu Jaunty / Fedora
Posts: 39

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

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:
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.

include /path/to/virtualhostfile.conf
DocumentRoot /path/to/html
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.


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
Apache2 virtual host. hgb Linux - Networking 10 01-24-2009 03:05 AM
Apache2 Virtual Host SSI problems superscrappy Linux - Software 1 08-30-2005 06:04 PM
apache2 help -Virtual Host- Fredstar *BSD 4 06-06-2005 02:09 PM
Can't do Apache2 virtual host different ports SK_pt Linux - Software 3 01-30-2005 08:04 PM
apache2, virtual host problems rjcrews Linux - Software 13 05-25-2004 09:16 PM

All times are GMT -5. The time now is 04:30 AM.

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