Can I have 2 httpd servers running on 2 different ports?

Can I have 2 httpd servers running on 2 different ports?

am 22.02.2010 20:09:10 von Aruna Gummalla

--0-802507148-1266865750=:35702
Content-Type: text/plain; charset=us-ascii

Hi,

Can I have 2 httpd servers running on 2 different ports? If so, what is the configuration change that i need to do.

I tried running apachectl start with different port numbers in httpd.conf. But it says httpd already running.

Please let me know. Thanks in advance.

Thanks & Regards,
Aruna.




--0-802507148-1266865750=:35702
Content-Type: text/html; charset=us-ascii

Hi,

Can I have 2 httpd servers running on 2 different ports? If so, what is the configuration change that i need to do.

I tried running apachectl start with different port numbers in httpd.conf. But it says httpd already running.

Please let me know. Thanks in advance.

Thanks & Regards,
Aruna.





--0-802507148-1266865750=:35702--

Re: Can I have 2 httpd servers running on 2 different ports?

am 22.02.2010 20:16:59 von Dan_Mitton

--=_alternative 0069EC90882576D2_=
Content-Type: text/plain; charset="US-ASCII"

Do you really need two different web servers? You can use 1 web server to
listen on two different ports. Just duplicate the sections with the ports
numbers in the one configuration file.

If in fact you really do want two different web servers, you will need two
completely different configuration files. Add '-f ' to your
apachectl command to point at each configuration file.

Dan



Please respond to users@httpd.apache.org

To: users@httpd.apache.org
cc: (bcc: Dan Mitton/YD/RWDOE)
Subject: [users@httpd] Can I have 2 httpd servers running on 2
different ports?
LSN: Not Relevant
User Filed as: Not a Record

Hi,

Can I have 2 httpd servers running on 2 different ports? If so, what is
the configuration change that i need to do.

I tried running apachectl start with different port numbers in httpd.conf.
But it says httpd already running.

Please let me know. Thanks in advance.

Thanks & Regards,
Aruna.



--=_alternative 0069EC90882576D2_=
Content-Type: text/html; charset="US-ASCII"



Do you really need two different web
servers?  You can use 1 web server to listen on two different ports.
 Just duplicate the sections with the ports numbers in the one configuration
file.




If in fact you really do want two different
web servers, you will need two completely different configuration files.
 Add '-f <filename>' to your apachectl command to point at each
configuration file.




Dan






Please respond to users@httpd.apache.org


To:      
 
users@httpd.apache.org

cc:      
 
(bcc: Dan Mitton/YD/RWDOE)

Subject:    
   
[users@httpd]
Can I have 2 httpd servers running on 2 different ports?



LSN: Not
Relevant


User Filed as: Not
a Record




Hi,



Can I have 2 httpd servers running on 2 different ports? If so, what is
the configuration change that i need to do.



I tried running apachectl start with different port numbers in httpd.conf.
But it says httpd already running.



Please let me know. Thanks in advance.



Thanks & Regards,

Aruna.







--=_alternative 0069EC90882576D2_=--

Re: Can I have 2 httpd servers running on 2 different

am 22.02.2010 21:15:37 von Scott Gifford

--0003255547a2dd0cfb0480361979
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Feb 22, 2010 at 2:09 PM, Aruna Gummalla wrote:

> Hi,
>
> Can I have 2 httpd servers running on 2 different ports?
>

Sure. You'll want to create a new configuration file and start Apache using
that configuration file. You can run Apache by hand, or you can copy
apache2ctl and change the settings in there, then run your copy.

That's a bit vague, I know, but I hope it will get you started. You may
find there's an easier answer if you don't really need two Apache servers,
but can get by with one of the other suggestions from this thread.

-----Scott.

--0003255547a2dd0cfb0480361979
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Mon, Feb 22, 2010 at 2:09 PM, Aruna Gummalla < ef=3D"mailto:aruna_gummalla@yahoo.com">aruna_gummalla@yahoo. com> an> wrote:

style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

ze:12pt">
Hi,

Can I have 2 httpd servers running on 2 different =
ports?

Sure. =A0You'=
ll want to create a new configuration file and start Apache using that conf=
iguration file. =A0You can run Apache by hand, or you can copy apache2ctl a=
nd change the settings in there, then run your copy.



That's a bit vague, I know, but I hope it will get =
you started. =A0You may find there's an easier answer if you don't =
really need two Apache servers, but can get by with one of the other sugges=
tions from this thread.



-----Scott.



--0003255547a2dd0cfb0480361979--

Re: Can I have 2 httpd servers running on 2 differentports?

am 22.02.2010 21:22:54 von Robert Van Horn

Just give the servers different names. apache2 and
apache2-different_port. Means you have to compile each server with that
name and your server with the not 80 address will have a different
Listen port in the httpd.conf file. Start the server with
/usr/local/apache2-different_port/bin/apachectl start. The nice thing
about doing this is that you can put different things in different
servers - say a light server with not much added and then a server with
php and mod-perl to do other things.

bob

Aruna Gummalla wrote:
> Hi,
>
> Can I have 2 httpd servers running on 2 different ports? If so, what
> is the configuration change that i need to do.
>
> I tried running apachectl start with different port numbers in
> httpd.conf. But it says httpd already running.
>
> Please let me know. Thanks in advance.
>
> Thanks & Regards,
> Aruna.
>


------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Can I have 2 httpd servers running on 2 differentports?

am 24.02.2010 17:37:21 von mcguire

Yes, you can[1]; you'll need to use different port numbers (or limit them to
different IP addresses) and there is a PID file (or lock file, I cannot
remember at the moment) that has to be different. The only changes you need
are in the configuration and startup scripts.

[1] We have an OpenSSO policy agent in one server and a separate server for
the stuff that actually has to work.

Aruna Gummalla wrote:
> Hi,
>
> Can I have 2 httpd servers running on 2 different ports? If so, what is
> the configuration change that i need to do.
>
> I tried running apachectl start with different port numbers in
> httpd.conf. But it says httpd already running.
>
> Please let me know. Thanks in advance.
>
> Thanks & Regards,
> Aruna.
>


--
Tommy M. McGuire
mcguire@crsr.net

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Can I have 2 httpd servers running on 2 different ports?

am 24.02.2010 18:49:38 von sheryl

bob wrote:

> Just give the servers different names. apache2 and
> apache2-different_port. Means you have to compile each server with that
> name and your server with the not 80 address will have a different
> Listen port in the httpd.conf file.

Compiling individually is not necessary. We run dozens of servers off one
compile.

Instead, just have a different directory for each instance. For instance

/usr/local/apache -- where you install your software

/opt/server1 -- first server
bin, build, error, icons, include, lib, man, manual, modules,
mime-types, magic are links to equivalent in /usr/local/apache
cgi-bin, conf, htdocs, logs are directories; conf should be a copy of
/usr/local/apache/conf

/opt/server2 -- set up the same way

Edit /opt/servername/conf/httpd.conf and replace all occurrences of
/usr/local/apache with /opt/servername/apache

Then when you start up use -d /opt/servername/apache -f
/opt/servername/apache/conf in addition to any other flags you'd pass
apachectl.

Sheryl


> Start the server with
> /usr/local/apache2-different_port/bin/apachectl start. The nice thing
> about doing this is that you can put different things in different
> servers - say a light server with not much added and then a server with
> php and mod-perl to do other things.
>
> bob
>
> Aruna Gummalla wrote:
>> Hi,
>>
>> Can I have 2 httpd servers running on 2 different ports? If so, what
>> is the configuration change that i need to do.
>>
>> I tried running apachectl start with different port numbers in
>> httpd.conf. But it says httpd already running.
>>
>> Please let me know. Thanks in advance.
>>
>> Thanks & Regards,
>> Aruna.
>>
>
>
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Can I have 2 httpd servers running on 2 differentports?

am 24.02.2010 19:14:44 von Paul McFerrin

Did you miss out on the file?? With this, you only need
one server to serve all of those hosts. They all will have same port
numbers and you don't have to play with the PID file. I've been serving
multiple hosts for years.

- Paul

Tommy M. McGuire wrote:
> Yes, you can[1]; you'll need to use different port numbers (or limit them to
> different IP addresses) and there is a PID file (or lock file, I cannot
> remember at the moment) that has to be different. The only changes you need
> are in the configuration and startup scripts.
>
> [1] We have an OpenSSO policy agent in one server and a separate server for
> the stuff that actually has to work.
>
> Aruna Gummalla wrote:
>
>> Hi,
>>
>> Can I have 2 httpd servers running on 2 different ports? If so, what is
>> the configuration change that i need to do.
>>
>> I tried running apachectl start with different port numbers in
>> httpd.conf. But it says httpd already running.
>>
>> Please let me know. Thanks in advance.
>>
>> Thanks & Regards,
>> Aruna.
>>
>>
>
>
>
> ------------------------------------------------------------ ------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.733 / Virus Database: 271.1.1/2707 - Release Date: 02/24/10 02:34:00
>
>


------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Can I have 2 httpd servers running on 2 different ports?

am 25.02.2010 15:00:29 von LuKreme

On 24-Feb-10 10:49, Sheryl wrote:
> Instead, just have a different directory for each instance. For instance
>
> /usr/local/apache -- where you install your software
>
> /opt/server1 -- first server
> bin, build, error, icons, include, lib, man, manual, modules,
> mime-types, magic are links to equivalent in /usr/local/apache
> cgi-bin, conf, htdocs, logs are directories; conf should be a copy of
> /usr/local/apache/conf

What benefit does this give you over running VirtualHost?

--
NO. I CANNOT BE BIDDEN. I CANNOT BE FORCED. I WILL DO ONLY THAT WHICH I
KNOW TO BE RIGHT. --Mort

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Re: Can I have 2 httpd servers running on 2

am 25.02.2010 15:56:29 von Tom Evans

On Thu, Feb 25, 2010 at 2:00 PM, LuKreme wrote:
> On 24-Feb-10 10:49, Sheryl wrote:
>>
>> Instead, just have a different directory for each instance.  For in=
stance
>>
>> /usr/local/apache -- where you install your software
>>
>> /opt/server1 -- first server
>>     bin, build, error, icons, include, lib, man, manual, modul=
es,
>> mime-types, magic are links to equivalent in /usr/local/apache
>>     cgi-bin, conf, htdocs, logs are directories; conf should b=
e a copy of
>> /usr/local/apache/conf
>
> What benefit does this give you over running VirtualHost?
>

(I wouldn't set up a second instance like suggested, but..)

1) You can load different modules in different instances
2) Separation of concerns
3) Different global configuration options
4) Different compile time options

For instance, on our reverse proxies, we run two instances of apache,
one handles SSL and runs prefork MPM, and one handles regular HTTP and
runs the event MPM.

Cheers

Tom

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Re: Can I have 2 httpd servers running on 2 different ports?

am 25.02.2010 20:00:11 von sheryl

>> What benefit does this give you over running VirtualHost?
>>
>
> (I wouldn't set up a second instance like suggested, but..)

Curious about why not...

BTW, my example was a little simplified. In practice we actually make a
link "base" which points to the apache directory and the link bin to
base/bin, etc. That way, when we compile a new version we put it in its
own directory and change the link. Easy to upgrade, easy to back off if
it doesn't work.

More recently we have been moving toward multiple compiles because we're
trying to put everything in its own stack in preparation for moving to
VMs. But we still do the linking in order to make upgrades easier.

> 1) You can load different modules in different instances
> 2) Separation of concerns
> 3) Different global configuration options
> 4) Different compile time options

All of those apply, but most of it has to do with what I assume you mean
by (2). We have several different customer groups and many applications.
Although we do run VirtualHost, each instance of apache belongs to one
organizational entity. That way, two groups with different missions don't
have to agree on a restart for changing a paramter (and for that matter
don't have to agree to the change, which relates to (3) above). Also,
easier to co-ordinate software upgrades.

> For instance, on our reverse proxies, we run two instances of apache,
> one handles SSL and runs prefork MPM, and one handles regular HTTP and
> runs the event MPM.
>
> Cheers
>
> Tom
>
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Re: Can I have 2 httpd servers running on 2

am 26.02.2010 10:56:12 von Tom Evans

On Thu, Feb 25, 2010 at 7:00 PM, Sheryl wrote:
>
>>> What benefit does this give you over running VirtualHost?
>>>
>>
>> (I wouldn't set up a second instance like suggested, but..)
>
> Curious about why not...
>
> BTW, my example was a little simplified.  In practice we actually ma=
ke a
> link "base" which points to the apache directory and the link bin to
> base/bin, etc.  That way, when we compile a new version we put it in=
its
> own directory and change the link.  Easy to upgrade, easy to back of=
f if
> it doesn't work.
>

Because it isn't needed. If you don't need to change compile time
options, all apache needs to run is a different config file, not a
replication of the /usr/local/ hierarchy.

In fact, we use freebsd, and install apache from ports, using the
supplied rc script to manage 'profiles', which define the separate
instances of apache to run, with all necessary configuration in
/usr/local/etc/apache22-{profile-name}. No crazy symlinks required!

When a developers needs an apache instance to play with, they would
typically just do something like this:
'/usr/local/sbin/httpd -f /home/foo/proj/conf/httpd.conf'. The only
things they need in conf are the httpd.conf, mime.types and magic.
Typically, they'll declare a server root in the conf file, with a logs
folder below server root. That's pretty muc hall that is needed.

However, we don't do this so much anymore. Now typically, we will
configure a separate freebsd jail for each service.

Cheers

Tom

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Re: Can I have 2 httpd servers running on 2 different ports?

am 03.03.2010 01:21:37 von sheryl

> When a developers needs an apache instance to play with, they would
> typically just do something like this:
> '/usr/local/sbin/httpd -f /home/foo/proj/conf/httpd.conf'. The only
> things they need in conf are the httpd.conf, mime.types and magic.
> Typically, they'll declare a server root in the conf file, with a logs
> folder below server root. That's pretty muc hall that is needed.

Developer playgrounds are something else, and they run them as they please
on their workstations. I was describing what we do for shared servers
with dev/qa/production workflow stacks. Per security policy, nobody is
allowed to run a site out of their home directory (or even have a login on
QA or production), and we don't have any of the stack software in
/usr/local even on sites which haven't been merged into an
/opt/site/sitename stack so they can easily be copied from machine to
machine.

As with anything else, YMMV with your environment. I probably would
consider your setup a little crazy with the kind of superficial exposure
we get here, starting with running httpd out of /usr/local (assuming
you'll ever want to compile a second version for any reason).

> However, we don't do this so much anymore. Now typically, we will
> configure a separate freebsd jail for each service.

I'd like to be doing something like that, or VMs, but unfortunately those
methods have not been so easy to get approved.

Sheryl


------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org