Posts Tagged apache

reverse proxy for utorrent part 2

In my last post about utorrent (µtorrent) I was frustrated that I wasn’t able to change the url from /gui/ to /tor/
Woot! In apache 2.3 which will be apache 2.4 and I think it will be released in early 2011 the proxy module is much better and there it works to have a different URL :-) Even as ALPHA or BETA version the new apache rocks a lot and runs stable. In condition with mod_fcgid it is real cool technology e.g. running PHP separated form apache that allows to run different PHP version of the server in vhosts or directories. Also running a non thread safe PHP version. Speed! IPv6 would be fine, but the offered patches are not applied to trunk :-/There is an annoying bug in mod_fcgid. I’m glad I found a fix for it (help from Tom Donovan and Sob).

Tags: , , , , ,

Disable AllowOverride (htaccess to httpd.conf)

AllowOverride is one of the things that slow down a lot. Disabling it makes apache faster. It is a horror to migrate all .htaccess files by hand. BUT here is a PHP script from Paul Reinheimer which makes it realy easy :-)

Get it htaccess.php

tune your server!

Tags: , , , , , ,

crashing fcgid 2.3.6 on windows

On Windows fcgid crashes apache when apache do a graceful restart (httpd -k restart). Here is a patch that should fix that. This patch in inspired from Tom Dovovan.

Index: modules/fcgid/fcgid_pm_main.c
--- modules/fcgid/fcgid_pm_main.c    (revision 1037552)
+++ modules/fcgid/fcgid_pm_main.c    (working copy)
@@ -375,7 +375,9 @@
 proc->diewhy = FCGID_DIE_SHUTDOWN;
 proc_print_exit_info(proc, exitcode, exitwhy,
-        apr_pool_destroy(proc->proc_pool);
+        #ifndef Win32
+            apr_pool_destroy(proc->proc_pool);
+        #endif
 proc->proc_pool = NULL;
 return 1;
Index: modules/fcgid/fcgid_pm_win.c
--- modules/fcgid/fcgid_pm_win.c    (revision 1037552)
+++ modules/fcgid/fcgid_pm_win.c    (working copy)
@@ -123,7 +123,9 @@
 "mod_fcgid: can't create wake up thread");
+    apr_pool_cleanup_register(pconf, main_server,
+                              procmgr_stop_procmgr, apr_pool_cleanup_null);
 return APR_SUCCESS;

@@ -249,8 +251,6 @@
 procmgr_child_init(server_rec * main_server, apr_pool_t * pchild)
-    apr_pool_cleanup_register(pchild, main_server,
-                              procmgr_stop_procmgr, apr_pool_cleanup_null);
 return APR_SUCCESS;

Download this patch

Tags: , , , , , ,

Preparing mod_svn for compiling on windows

Well I didn’t manage it to compile mod_svn without the apache compiled source tree, but than it works fine and fast. Also Python 3 did not work. So I took 2.7
Assuming that OpenSSL 1.0.0a and zlib are compiled in that source tree as well.

C:\python27\python -t vcproj --vsnet-version=2008 --with-httpd=C:\build\httpd-2.2.x-sni-dev-ipv6
 --with-zlib=C:\build\httpd-2.2.x-sni-dev-ipv6\srclib\zlib --with-apr=C:\build\httpd-2.2.x-sni-dev-ipv6\srclib\apr

Than just open subversion_vcnet.sln with Visual C++ Express Edition. Ignore all warnings about solution folders. Choose the __ALL__ project. Than change from debug to release. Start!

My sample config

LoadModule dav_module modules/
LoadModule dav_fs_module modules/

LoadModule auth_digest_module modules/
LoadModule dav_svn_module modules/
LoadModule authz_svn_module modules/

<Location /svn/>
  DAV svn

  SVNListParentPath on
  SVNParentPath /Repositories/
  SVNIndexXSLT "/svnindex.xsl"
  SVNPathAuthz on
  AuthzSVNAccessFile "C:/Repositories/authz"

  AuthName "Subversion Repositories"
  AuthType Basic
  AuthUserFile "C:/Repositories/htpasswd"

  require valid-user

Tags: , , , , , , , , , , ,

compile zlib 1.2.5 on windows

Download from
extract it

For x86

nmake -f win32/Makefile.msc OBJA=inffast.obj
MT -manifest zlib1.dll.manifest -outputresource:zlib1.dll;2

For x64

nmake -f win32/Makefile.msc AS=ml64 LOC="-DASMV -DASMINF -I." OBJA="inffasx64.obj gvmat64.obj inffas8664.obj"

Done :-)

Tags: , , , , , , , ,

reverse proxy for utorrent

Using the web UI for utorrent is a fine thing. But the webserver from utorrent is not secure. So it is recommend to use apache as reverse proxy. I tried to change the url, but I wasn’t successful.

Here the set up of cause inside a vhost.

LoadModule proxy_module modules/
LoadModule proxy_connect_module modules/
LoadModule proxy_http_module modules/

ProxyPass /gui/ http://localhost/gui/
ProxyPassReverse /gui/ http://localhost/gui/

Tags: , , , , , , ,

roundcube dislikes PHP 5.3

The current stable version ( 0.3) and the latest beta (0.4 beta) of roundcube dislike my upgrade tp PHP 5.3 All other applications run fine, but roundcube. Searching in the logs showed me that there are some PHP 4 code is used and often PHP 4 coding style. The manual says that at least PHP 5.2 must be used or greater. Super, since it does work with 5.3

Good that I’m a PHP developer myself and I found the places in the code I had to change. I had no fun to rewrite the whole code to PHP 5 style. So I just fixed it.What I have changed?

program/lib/MDB2.php on line 392
program/lib/MDB2.php on line 2614
program/lib/PEAR.php on line 563
program/lib/PEAR.php on line 566

By removing the “&”. I also searched for “=&” and replaced it with “=”. Quick and maybe dirty, but now I can check my mails again. I wonder how say you have to use PHP 5.2 or greater and still using that crap code?

Tags: , , , , , ,

Changed to worker mpm

Today I changed my server to from prefork mpm to worker mpm.

There are only some issues: in my phpmyadmin I had to set auth from http to cookie. And PHP_ADMIN_VALUE don’t work in the vhosts.

How to install it:

sudo apt-get install apache2-mpm-worker libapache2-mod-fcgid

In the single vhosts

Options Indexes ExecCGI
AddHandler fcgid-script .php
FCGIWrapper /usr/lib/cgi-bin/php5 .php

So that isn’t hard to do.

Well I would like to have a windows server with apache which is also threaded like worker mpm, but there is no cheap hoster for that yet. At home have that server is not an option cause of the small upload I have with my DSL, the coast of energie and where the hell should I put that server in my small apartment to that I still can sleep?

Tags: , , , , , , , , ,

Apache windows win64 x64 win32 x86 vc9 download

Apache binaries for windows in 64 bit and 32 bit can be found at apachehaus. I think here is a benefit using Visual Studio 9 aka Visual Studio 2008 instead of VS6. I use Visual Studio 2008 to obtain higher performance and better stability than the binaries built by the Apache Software Foundation.

Binaries are built using the latest versions of the Apache Portable Runtime, OpenSSL and Zlib compression library. OpenSSL and Zlib are built using the optional assembly routines for added performance in the SSL and deflate modules.

Different to other pages for apache on windows apachehaus also offers the httpd with IPv6.

Tags: , , , , ,

compile mod_perl x64 windows 64 bit

  1. install activeperl x64 if you haven’t done yet
  2. get the source from trunk
    C:\build\>svn checkout
    /trunk/ mod_perl-2.0
  3. configure it
    C:\build\mod_perl-2.0>perl Makefile.PL MP_AP_PREFIX=C:\Apache22 
  4. nmake
  5. nmake test
  6. nmake install
  7. edit your httpd.conf ;-)

Tags: , , , , ,

Archives by Subject:

Archives by Month: