Hi

I currently trying to get squid to act as a reverse proxy for my midgard site and was 
wondering if anyone could give me some tips to overcome some problems I am having.

The setup:
- the server is a Aktion Networks virtual dedicated server running Debian Woody 3 Xeon 
2 Ghz CPUs with 3.8 GBs of RAM although I am not quite sure what the system resource 
allocation is for that but it sure seems to compress and compile fast
- midgard version 1.5 install but compiled without the multilang or new workflow 
features I am using the mod_midgard-preparser module.
- squid 2.4.6-2 default debian package which appears to have been compiled with the 
--disable-dns option according to the configure script in the source package.
- mysql-server 3.23.49-8.4 the default debian package but have altered the my.conf 
file to have the following settings
set-variable    = key_buffer_size=128M
set-variable    = sort_buffer=1M
set-variable    = record_buffer=1M
set-variable    = max_connections =100
set-variable    = max_user_connections =80
set-variable    = myisam_sort_buffer_size=64M
set-variable    = thread_cache=8
# Try number of CPU's*2 for thread_concurrency
set-variable    = thread_concurrency=6
set-variable    = wait_timeout=20
set-variable    = table_cache= 400
-Staging website on port 8001
- live website on port 80

I have used siege and bombardment to run sum performance tests on the server and 
comparing the response and transfer rate when I am hitting the front page of the site 
straight from midgard verse when I am hitting the front page when it has been saved as 
html and is just being server from apache I can see that it is a lot slower coming 
straight from midgard. For example here is a comparison of the html vs midgard page in 
sieges log bombardment 10 20 5 5. As I was running siege on the server these figures 
are underestimates as seige was using a lot of the systems resources.
 Date & Time,  Trans,  Elap Time,  Data Trans,  Resp Time,  Trans Rate,  Throughput,  
Concurrent,   Okay
results from hitting the front page in midgard
08/03/03 08:02:09,    199,      60.02,     5875276,       2.94,        3.32,    
97888.64,        9.74,     199
08/03/03 08:03:42,    198,      61.95,     5724687,       8.64,        3.20,    
92408.18,       27.62,     198
08/03/03 08:05:14,    310,      60.33,     4389420,       8.20,        5.14,    
72756.84,       42.16,     305
Html version of front page
08/03/03 08:13:40,    668,      60.01,    21840928,       0.88,       11.13,   
363954.82,        9.85,     668
08/03/03 08:15:12,    670,      61.39,    21906320,       2.64,       10.91,   
356838.58,       28.87,     670
08/03/03 08:16:44,    630,      60.10,    20598480,       4.44,       10.48,   
342736.78,       46.49,     630

After a long often frustrating time I have managed to get squid working to the point 
where I can cache virtual domains that are not midgard sites and static html pages but 
have not been able to get it working with the midgard live site.

I have squid listening on port 80 on my external ipaddress while apache is listening 
to port 8001 on the external ipaddress and port 80 on the looback device 127.0.0.1. 
This is my midgard-data.conf file
Listen 8001
NameVirtualHost "externalipaddress:8001
<VirtualHost "externalipaddress:8001>
    MidgardDatabase midgardstaging midgarddbuser xxxxxxxx
    MidgardPageCacheDir /var/www/midgard/cache
    MidgardEngine On
    ServerName test.wilderness.org.au
    Port 8001
     
    # Switch off magic quotes - it is required with Midgard
    php_value magic_quotes_gpc off
    php_value magic_quotes_runtime off
     
    # Configure text parser:
    # Change to 'russian' for Russian Midgard
    MidgardParser latin1
    MidgardBlobDir "/var/www/midgard/blobs"
    MidgardBlobDir "/var/www/midgard/blobs"
#    MidgardLog Debug+ /var/log/midgard.log
                                                                                       
                        
    # Configuration for Russian Midgard:
    <IfModule mod_charset.c>
     # default charset for real or virtual server (selected if all other charset-
     # selections methods fails)
     CharsetDefault koi8-r
     # Default source (on-disk) charset (we keep all content in DB in KOI8-R
     # encoding). If you want different encoding, please re-encode midgard-ru.sql
     # before inserting it into DB too.
     CharsetSourceEnc koi8-r
     # Force mod_charset to do its work
     CharsetDisable Off
    </IfModule>
</VirtualHost>
                                                                                       
                        
#The tws intranet added by john 02-08-03
<VirtualHost "externalipaddress:80>
        MidgardEngine Off
        ServerAdmin [EMAIL PROTECTED]
        DocumentRoot /var/www/intranet/
        ServerName intranet.wilderness.org.au
        <Directory /var/www/intranet/>
        AllowOverride None
        order allow,deny
        Allow from all
        AuthName "TWS Secure Intranet"
        AuthType Basic AuthUserFile /etc/apache/.htpasswd
        require user twsadmin
        </Directory>
 
</VirtualHost>
 
Listen 80
NameVirtualHost 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
    MidgardDatabase midgardlive midgarddbuser xxxxxxxx
    MidgardPageCacheDir /var/www/midgard/cachelive
    MidgardEngine On
    ServerName test.wilderness.org.au
    Port 80
     
   # Switch off magic quotes - it is required with Midgard
    php_value magic_quotes_gpc off
    php_value magic_quotes_runtime off
    # Configure text parser:
    # Change to 'russian' for Russian Midgard
    MidgardParser latin1
    MidgardBlobDir "/var/www/midgard/blobslive"
     
    # Configuration for Russian Midgard:
    <IfModule mod_charset.c>
     # default charset for real or virtual server (selected if all other charset-
     # selections methods fails)
     CharsetDefault koi8-r
     # Default source (on-disk) charset (we keep all content in DB in KOI8-R
     # encoding). If you want different encoding, please re-encode midgard-ru.sql
     # before inserting it into DB too.
     CharsetSourceEnc koi8-r
     # Force mod_charset to do its work
     CharsetDisable Off
    </IfModule>
</VirtualHost>

I have set up the /etc/hosts table to list all the virtual domains 
127.0.0.1   localhost localhost.localdomain
127.0.0.1 test.wilderness.org.au
127.0.0.1 www.sydney.wilderness.org.au
127.0.0.1 sydney.wilderness.org.au
127.0.0.1 intranet.wilderness.org.au

The options i have set in my squid.conf file are:
 http_port 64.235.236.145:80
 redirect_rewrites_host_header off
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl midgard src 127.0.0.1/255.255.255.255
acl Safe_ports port 80 
acl purge method PURGE
http_access deny !Safe_ports
http_access allow all  ##Need to change this to deny all when I can figure out how to 
get the access control list set up correctly
httpd_accel_host 127.0.0.1
 httpd_accel_port 80
 httpd_accel_single_host on
 cachemgr_passwd disable all

In the httpd.conf file I have set the BindAddress to 127.0.0.1

Now the problem I am having is that midgard doesn't serve the live site rather it just 
lets apache handle the test.wilderness.org.au domain which just serves the 
intranet.wilderness.org.au domain. The staging website on port 8001 is working fine 
but I appear to have a real mess when it comes to dealing with virtual hosts. 

Can anyone provide any pointers on where I have gone off track. Do I need to set a 
redirect script for squid so that midgard serves its pages when I request 
test.wilderness.org.au rather than just letting apache handle it or is the problem 
something else entirely.

I have scoured the net but haven't found any really clear documentation on how to set 
up squid as a reverse proxy. In the midgard list I can see a few mentions of this 
being done or suggested Martin in particular makes some mention of it and also 
mod_accel (found some documentation on that but nothing that was easy to understand) 
but there were no specifics.

I would be really grateful for any advice as I have been wading through this for a 
couple of days now without much success.

John Habermann
The Wilderness Society, Sydney










---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to