#1  
Old 11th July 2008, 20:06
DualFusion DualFusion is offline
Member
 
Join Date: Dec 2007
Posts: 67
Thanks: 4
Thanked 1 Time in 1 Post
Default Two Apache Clusters

Hi,

I have 5 servers:
1) Loadbalancer/Root
2) Apache node
3) Apache node
4) NFS
5) Mail

And I have been trying to get server1 to transfer data to each Apache node depending on there file type, not just what folder they are in. For example I may want to have PHP go to Apache node1 and Ruby into Apache node2

I have looked at the two tutorials with no success:
http://www.howtoforge.com/set-up-a-l...ter-ubuntu8.04
http://www.howtoforge.com/reduce-apa...pd-debian-etch

Thanks,
Kevin.
Reply With Quote
Sponsored Links
  #2  
Old 12th July 2008, 01:27
DualFusion DualFusion is offline
Member
 
Join Date: Dec 2007
Posts: 67
Thanks: 4
Thanked 1 Time in 1 Post
Default

Forgot to note that I also want server1 to be DNS. So I basically want a solution that would let me install DNS and would also load-balance between my 2 apache nodes, but will make sure all PHP files go to node1 while all Ruby goes to node2.

Thanks,
Kevin.
Reply With Quote
  #3  
Old 12th July 2008, 20:38
DualFusion DualFusion is offline
Member
 
Join Date: Dec 2007
Posts: 67
Thanks: 4
Thanked 1 Time in 1 Post
Default

**bump bump**
Reply With Quote
  #4  
Old 14th July 2008, 01:21
DualFusion DualFusion is offline
Member
 
Join Date: Dec 2007
Posts: 67
Thanks: 4
Thanked 1 Time in 1 Post
Default

Can't someone help? Please? This is really important and can't continue without this step. I have been stuck with this problem for a couple days now. Any help is much appreciated.

Thanks,
Kevin.
Reply With Quote
  #5  
Old 14th July 2008, 01:29
tmaleshafske tmaleshafske is offline
Member
 
Join Date: Feb 2008
Posts: 39
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Have you looked in to using squid as a reverse proxy
Squid has options where you can filter by different types of contents.
__________________
Thomas
"Helping Computers with People Problems since 2000"
Reply With Quote
The Following User Says Thank You to tmaleshafske For This Useful Post:
DualFusion (15th July 2008)
  #6  
Old 14th July 2008, 03:17
DualFusion DualFusion is offline
Member
 
Join Date: Dec 2007
Posts: 67
Thanks: 4
Thanked 1 Time in 1 Post
Default

I finished looking into squid and saw I can do this: (I think)

acl PHP urlpath_regex (.+).php

but I don't know how to redirect them to node1
Reply With Quote
  #7  
Old 14th July 2008, 03:58
tmaleshafske tmaleshafske is offline
Member
 
Join Date: Feb 2008
Posts: 39
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Look at this example squid.conf that I use. The only difference is that I don't have them set-up by type exceptions, but by domain. Also send a post to their mailing list. There are some really good individuals on their user mailing list.
That are always willing to help. The part where it talks about who is squid a proxy for and the ACL that are related to those servers is what you are going to be interested in. Let me know if it works

Good Luck
Attached Files
File Type: txt squid.conf.example.txt (1.8 KB, 180 views)
__________________
Thomas
"Helping Computers with People Problems since 2000"

Last edited by tmaleshafske; 14th July 2008 at 04:03.
Reply With Quote
The Following User Says Thank You to tmaleshafske For This Useful Post:
DualFusion (15th July 2008)
  #8  
Old 14th July 2008, 19:17
DualFusion DualFusion is offline
Member
 
Join Date: Dec 2007
Posts: 67
Thanks: 4
Thanked 1 Time in 1 Post
Default

Ok, so I would have to install squid onto loadbalance server and do something like this:

Code:
http_port 80 accel vhost
forwarded_for on

# Apache Node 1 & 2
cache_peer x.x.x.x parent 80 0 originserver name=apache1
cache_peer x.x.x.x parent 80 0 originserver name=apache2

# Put domains in a file 
acl HostedSites dstdomain "/usr/local/squid/etc/allowed-sites"
http_access allow HostedSites

# Common ACL
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 1025-65535  # unregistered ports
acl CONNECT method CONNECT

# Mime types
acl php_mime req_mime_type ^application/x-httpd-php$
acl php_mime req_mime_type ^application/x-httpd-php-source$
acl php_mime req_mime_type ^application/x-httpd-php3$
acl php_mime req_mime_type ^application/x-httpd-php3-preprocessed$
acl php_mime req_mime_type ^application/x-httpd-php4$
acl ruby_mime req_mime_type ^application/x-httpd-ruby$

# File extensions
acl php_ext urlpath_regex -i \.php$
acl php_ext urlpath_regex -i \.pht$
acl php_ext urlpath_regex -i \.phtml$
acl php_ext urlpath_regex -i \.phps$
acl php_ext urlpath_regex -i \.php3$
acl php_ext urlpath_regex -i \.php3p$
acl php_ext urlpath_regex -i \.php4$
acl ruby_ext urlpath_regex -i \.rb$
acl ruby_ext urlpath_regex -i \.rhtml$

# Allow/Deny cache_peer_access mime type
cache_peer_access apache1 allow php_mime
cache_peer_access apache1 deny ruby_mime
cache_peer_access apache2 allow ruby_mime
cache_peer_access apache2 deny php_mime

# Allow/Deny cache_peer_access extensions
cache_peer_access apache1 allow php_ext
cache_peer_access apache1 deny ruby_ext
cache_peer_access apache2 allow ruby_ext
cache_peer_access apache2 deny php_ext

# Allow/Deny http_access
http_access allow manager all
http_access allow manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
# Where are the localhost and to_localhost ACL's supposed to go?

# Log traffic
access_log /var/log/squid/access.log
Is this good, or would you change anything?

EDIT: Found out I can do mime types using req_mime_type.

Thanks,
Kevin.

Last edited by DualFusion; 15th July 2008 at 04:46.
Reply With Quote
  #9  
Old 15th July 2008, 02:07
tmaleshafske tmaleshafske is offline
Member
 
Join Date: Feb 2008
Posts: 39
Thanks: 1
Thanked 3 Times in 3 Posts
 
Default

I would highly recommend you post to their mailing list I am not a Subject Matter Expert on Squid. So I am not positive that looks correct.
__________________
Thomas
"Helping Computers with People Problems since 2000"
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CENTOS 5 Ping Problem gAnDo Server Operation 11 28th March 2008 20:58
apache / mysql Clusters (debian etch) MisterVlad Suggest HOWTO 3 10th October 2007 14:12
MaxClients set to appropriate level, but ISPconfig is crashing from it (I think) bpmee Server Operation 6 11th January 2007 19:29
Centos 4.4 32bit Hangs, High Server load 3cwired_com Server Operation 11 16th November 2006 15:47
Problem with the installation of Dokeos (LMS) in ISPConfig jofranco General 4 28th April 2006 00:45


All times are GMT +2. The time now is 22:26.


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