LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 09-27-2007, 11:13 PM   #1
jordankoppole
LQ Newbie
 
Registered: Sep 2007
Posts: 9

Rep: Reputation: 0
Running multiple instances of apache2


Hi I want to run multiple instances of apache2 on different ports. Can some one guide me.
 
Old 09-27-2007, 11:23 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 326Reputation: 326Reputation: 326Reputation: 326
You don't want multiple instances of apache, you want multiple virtual servers on different ports. For example (from the above documentation link):

Code:
Listen 80
Listen 8080

NameVirtualHost 172.20.30.40:80
NameVirtualHost 172.20.30.40:8080

<VirtualHost 172.20.30.40:80>
ServerName www.example.com
DocumentRoot /www/domain-80
</VirtualHost>

<VirtualHost 172.20.30.40:8080>
ServerName www.example.com
DocumentRoot /www/domain-8080
</VirtualHost>

<VirtualHost 172.20.30.40:80>
ServerName www.example.org
DocumentRoot /www/otherdomain-80
</VirtualHost>

<VirtualHost 172.20.30.40:8080>
ServerName www.example.org
DocumentRoot /www/otherdomain-8080
</VirtualHost>
 
Old 09-28-2007, 02:17 AM   #3
jordankoppole
LQ Newbie
 
Registered: Sep 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Dear Mace,

Thanks for your reply. I am aware of the virtual hosts. The problem here is I am accesing the server on the lan using IP address. Also the need for this is I have different versions of cgi-bins to be run on different ports. I have connecting taomcat server (multiple) to which the requests will be passed based on the port it has been received.

To summarise I need a set up where
1. Multiple tomcats running on different ports
2. Requestes to these is passed by apache.

As all the apps on each of the tomcat is different I need a seperate apache2.

So I am trying to run multiple apaches on different ports whihc will have a one to one realation with tomcats.

Please let me know which is the best way I can take.

Thanks
 
Old 09-28-2007, 09:20 AM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 326Reputation: 326Reputation: 326Reputation: 326
If virtual hosts are not acceptable, then you need to run virtual systems. The lightest weight and simplest way is UML (User Mode Linux). The more common method these days is via Xen or VMWare.
 
Old 09-30-2007, 10:04 PM   #5
jordankoppole
LQ Newbie
 
Registered: Sep 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Dear Mace,

After going through this I felt it may not be necessary to run multiple apaches. I will try to use Virtual hosts and try to fix my problem. As I said earlier I access the machine on IP in LAN. Not very sure how to configure the virtual hosts.

Thanks
Jordan
 
Old 04-21-2008, 03:30 PM   #6
shakedown
LQ Newbie
 
Registered: Apr 2008
Posts: 2

Rep: Reputation: 0
What if we want to run multiple instances for different things and didn't want one to affect the other and only have one box? Currently I'm trying to run 2 apache instances but keep having issues regarding:

# /usr/sbin/apache2 -f /etc/apachetmp/apache2.conf -k start
(98)Address already in use: make_sock: could not bind to address 192.168.2.151:80
no listening sockets available, shutting down
Unable to open logs

This currently is not bound to anything as far as I know...the other instance uses .150.

Any ideas?
 
Old 04-21-2008, 08:13 PM   #7
bushmannt
LQ Newbie
 
Registered: Dec 2007
Distribution: RHEL5
Posts: 5

Rep: Reputation: 0
you can definitely run multiple versions/instances of apache, as long as they're listening on different IP/port. Just make sure the Listen directive has a proper a.b.c.d:e address/port combo, and the DocumentRoot's of the instances serve out different content. I've ran a setup like that (one apache for one ip/dns entry, and another apache for a whole variety of ip-, port-, and name-based vhosts) for over 5yrs and it worked great, first on 1.3.x, then on 2.0.x
 
Old 04-22-2008, 08:07 AM   #8
shakedown
LQ Newbie
 
Registered: Apr 2008
Posts: 2

Rep: Reputation: 0
Great then you can probably help here:

Do you know why this would occur when using Listen Directive?

WASPDEVDebian01:/etc/apache2# /usr/sbin/apache2 -k start
(98)Address already in use: make_sock: could not bind to address 192.168.2.150:80
no listening sockets available, shutting down
Unable to open logs

Do you know any mods that would prevent this from functioning properly?

Any further assistance you can provide would be greatly appreciated.

Thanks
 
Old 04-23-2008, 04:55 PM   #9
bushmannt
LQ Newbie
 
Registered: Dec 2007
Distribution: RHEL5
Posts: 5

Rep: Reputation: 0
it's apparently trying to start another instance on teh same ip/port. set the Listen directives to different ip/ports and you will be fine.
 
  


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
kickstart; how-to info needed for multiple instances of RH OS's and multiple unique v Joe_Wulf Linux - Server 4 06-21-2007 11:18 PM
Preventing multiple instances of a shell script from running concurrently Dave Lerner Programming 12 01-03-2007 09:27 PM
Multiple instances of Xine shreks Linux - Software 4 12-27-2006 11:35 AM
Why are multiple instances of mysqld running? philpq Linux - Newbie 2 02-17-2005 03:01 PM
Multiple Instances of MPlayer? Levitate Linux - Software 2 01-13-2005 12:04 PM


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