HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   about: tuning apache2 (http://www.howtoforge.com/forums/showthread.php?t=7299)

Ovidiu 6th October 2006 17:51

about: tuning apache2
 
I am refering to this howto: http://www.howtoforge.com/configurin...um_performance

has anyone taken an approach to get it done using a perfekt debian install 3.1 ?

I mean that howto only tells us "roughly" what needs to be done, I still need some advice on how one would go ahead and set up another apache (lightweighted) to server static content...

I mean how to integrate it with ispcfg...

can someone give me some hints?

Ovidiu 6th October 2006 23:04

besides that I did some additional digging and found another similar tutorial:http://servers.linux.com/servers/06/....shtml?tid=118 the only difference is they use lighttpd but still I need some hints on how to use this with ispcfg especially how to adapt the existing vhosts, or how to create or copy those vhosts so that lightpd serves static content for all of them, maybe even fastcgi...

here is another similar article using mongrel instead of lighttpd: http://blog.innerewut.de/articles/20...er-and-mongrel

and another one for mongrel serving ruby on rails applications: http://mongrel.rubyforge.org/docs/apache.html

another one: http://blog.codahale.com/2006/06/19/...trano-and-you/

falko 7th October 2006 14:03

These pages contain some configuration examples: http://forum.lighttpd.net/topic/1711
http://www.serverwatch.com/tutorials...0825_3290851_1
http://undeadly.org/cgi?action=artic...&mode=expanded
http://www.cafesoft.com/products/cam...erseProxy.html

You can put the reverse proxy configuration into the Apache Directives field of the respective web site in ISPConfig.

Ovidiu 7th October 2006 14:32

I started reading through the links you gave me, but can you tell me if its basically possible to do this while still using ispcfg on debian:

have apache2 keep his existing setup and role as a primary server but have him proxy requests for static content to another server and requests for fastcgi to another server?

I will try first to get the part with the static content running on another small webserver going.

the problems I see are basically this:

apache2 is already fully working so I would only need to setup the proxy module for it and have it redirecting requests for i.e. images to the small webserver but that small webserver would need "a copy" of the vhost configuration of apache2 to know which sites and how it is serving, right?

now how would I go ahead and copy this config if I would use lighttpd as a server for static content??
basically the same as asked here: http://forum.lighttpd.net/topic/1167#new

oh and what about having a slim apache2 running in the background serving the static pages? I mean there I could just copy the vhost configurations, that would be the easieast to implement, abd I guess tehre would really be a noticeable difference as my apache2 processes usually have between 12 - 24 MB serving dynamic content...

falko 8th October 2006 15:26

Quote:

Originally Posted by Tenaka
I started reading through the links you gave me, but can you tell me if its basically possible to do this while still using ispcfg on debian:

Sure, just put the configuration in the Apache Directives field.

have apache2 keep his existing setup and role as a primary server but have him proxy requests for static content to another server and requests for fastcgi to another server?

Quote:

Originally Posted by Tenaka
apache2 is already fully working so I would only need to setup the proxy module for it and have it redirecting requests for i.e. images to the small webserver but that small webserver would need "a copy" of the vhost configuration of apache2 to know which sites and how it is serving, right?

In the reverse proxy configuration you can specify a totally different URL and port, so it's totally up to you how you do it:

Code:

<VirtualHost *:80>
      ServerName myrailsdomain.com
      ProxyPass / http://totallydifferentdomain.com:<port, if different from 80>/
      ProxyPassReverse / http://totallydifferentdomain.com:<port, if different from 80>/
      ProxyPreserveHost on
</VirtualHost>

Quote:

Originally Posted by Tenaka
now how would I go ahead and copy this config if I would use lighttpd as a server for static content??
basically the same as asked here: http://forum.lighttpd.net/topic/1167#new

You can use any webserver software you like for serving your static content, this doesn't influence the reverse proxy configuration on your Apache.

Ovidiu 8th October 2006 21:50

well I understood it like this (I hope I got it right:-)

downlaod source of apache2 => /usr/local/src
h898552:/usr/local/src/httpd-2.2.3# ./configure --prefix=/usr/local/apache2 --enable-proxy --enable-proxy-http --enable-cache --enable-mem_cache

these are the modules

still working on it... I thought I might need, then make, folowed by make install


=> I can start it from /usr/local/apache2/bin/apache2ctl start after modifying the "Listen localhost:88" so now it runs on port 88 and the original can continue running on port 80.

next step would be to copy /etc/apache2/apache2.conf to /usr/local/apache2/http.conf and change all relevant paths and ports that might disturb...

falko 9th October 2006 15:15

Quote:

Originally Posted by Tenaka
well I understood it like this (I hope I got it right:-)

downlaod source of apache2 => /usr/local/src
h898552:/usr/local/src/httpd-2.2.3# ./configure --prefix=/usr/local/apache2 --enable-proxy --enable-proxy-http --enable-cache --enable-mem_cache

these are the modules

still working on it... I thought I might need, then make, folowed by make install

Did you check if Debian's Apache package has support for the proxy module? I'm not sure, but you wouldn't need to copmpile your own Apache then...

Ovidiu 9th October 2006 16:02

well, please excuse my lack of knowledge, but the only way of installing Debian packages known to me is: apt-get install apache2 so I thought that I can install only one instance through the packet managing system,....

of course it would be a lot easiear if someone could give me some hints on how to do that.

btw. I succeeded in compiling and installing and I could even start it BUT I am still copying the config file of the "old" apache2, editing and pasting into the new one and its no fun at all....
I am also suspecting that it is not good, that I downloaded my apache2-source from apache2.org,... I did not find the debian specific one!? ;-(

Ovidiu 9th October 2006 23:13

to be honest I got nowhere with the second apache2 install :-(
my next line of thought was, I could install another light web server with only the minimal config, as it needs not serve much, I could just skip the most config steps, I want it to only server static content, so any web serevr would do so I started looking closer at lighttpd and found only this tutorial that gives more info for an install on debian: http://trac.lighttpd.net/trac/wiki/TutorialInstallation and this is an example of a vhost setting for lighttpd:

Quote:

To run lighttpd with multiple domains you would setup virtual hosting. e.g. in lighttpd.conf:

$HTTP["host"] =~ "(www.)?example.com" {
server.document-root = "/var/www/example/current/public/"
server.error-handler-404 = "/dispatch.fcgi"
fastcgi.server = (
".fcgi" => (
"localhost" => (
"socket" => "/var/run/www/example.com-0.socket"
)
)
)
}

$HTTP["host"] =~ "(www.)?example2.com" { server.document-root ="/var/www/example2/current/public/" server.error-handler-404 = "/dispatch.fcgi" fastcgi.server = ( ".fcgi" => ( "localhost" => ( "socket" => "/var/run/www/example2-0.socket" ) ) ) }
besides that it is only available in unstable so I would have to change the status of a lot of stuff from stable to unstable so I just stopped.

is there anyone here who uses a secondary webserver installed on the same machine and can give me some hints on how to do this? I do not really care anymore what is used for the secondary webserver, I just need it to be able to server static content for vhosts...

Ovidiu 10th October 2006 08:39

I finally got a second apache2 up and running and am trying to configure the proxy cfg... first of all in /etc/apache/mods-enabled/proxy.conf there is a proxy on/off switch and nobody has ever mentioned if I have to turn it on there, everybody is only talking about these apache directives to set up proxying....

I want the first apache to reverse proxy all images to a second apache2 server listening on port 88 and I found 2 different aproaches till now in this posts:

a)
Quote:

<VirtualHost *:80>
ServerName myrailsdomain.com
ProxyPass / http://totallydifferentdomain.com:<port, if different from 80>/
ProxyPassReverse / http://totallydifferentdomain.com:<port, if different from 80>/
ProxyPreserveHost on
</VirtualHost>
b)
Quote:

ProxyPassReverse / http://%{HTTP_HOST}:8088/
RewriteEngine on
RewriteCond %{REQUEST_URI} !.*\.(gif|png|jpg)$
RewriteRule ^/(.*) http://%{HTTP_HOST}:8088/$1 [P]
would the second example do what I want if I modified it like this:
Quote:

RewriteCond %{REQUEST_URI} .*\.(gif|png|jpg)$
or how should that line look like?


All times are GMT +2. The time now is 12:05.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.