[solved]G2 on Apache2 on Win32; zip, avi,mp4 and url-rewrite

ArthurWetselaar

Joined: 2002-06-11
Posts: 38
Posted: Tue, 2005-06-21 21:54

Hi,

Below my setup info I will point out small changes I had to make for g2 to work on Win32. maybe this info can help some other user on Win32.

My setup:
Gallery version = 2.0-beta-3+ core 0.9.25
PHP version = 4.3.11 apache2handler
Webserver = Apache/2.0.54 (Win32)
Database = mysqlt 3.23.58-max-debug
Toolkits = Exif, Gd, Thumbnail, Dcraw, Ffmpeg, NetPBM, SquareThumb
Operating system = Windows 2003 SP1

All modules are enabled except shutterfly,nokia image upload and Photoaccess.

1 The zip and unzip functionality can be a little tough. Next to zip.exe and unzip.exe you will need zipc.exe. At least my versions of zip and unzip needed that. However G2 will not find it, it looks in the dir where the file to be zipped/unzipped is. Even if zipc.exe is in the same dir as zip.exe and unzip.exe it doesn't work. After I copied zipc.exe to /windows/system32 the zip functionality of G2 worked.

2 In my CVS version of G2 (nightly build 16-06-05) there was no mime type declared for avi and mp4 files. I just added the following:
video/x-msvideo mp4, avi
This will work if Windows mediaplayer 9 is installed.

3 For mod-rewrite to work I had to do the most stuff. But all the alterations are mod-rewrite and Apache specific. They have nothing to do with G2. However, the G2 test told me that Apache Mod-rewrite worked correctly. But when I went into my galleries all URL's were broken. So the test is for this moment not adequate enough on Win32. Things I had to alter in my setup to make url rewriting work:

    3.1 This step I had done already before the G2 test of url-rewriting. After this step the test gave me green light, however it did not work yet. enable the mod_rewrite.so module in httpd.conf by removing the # in front of
    LoadModule rewrite_module modules/mod_rewrite.so

    3.2 Enable symlinks for the gallery2 dir in httpd.conf. My rather unrestrictive options for that dir are: Options IncludesNOEXEC Indexes MultiViews FollowSymLinks ExecCGI

    3.3 Add a rewrite log in httpd.conf to see what is happening:
    RewriteLog "C:/Program Files/Apache Group/Apache2/logs/rewrite.log"

    3.4 Restart the Apache service.

4 Changing key php.ini values to suit the bigger demands of G2:
The following values work for me, but it is my own server. While importing the 3200 pictures of G1, my former memory limit of 16 Mb was suddenly not enough anymore. The max times have been upped just as a precaution. But I think that G2 overrides them anyway.
max_execution_time = 300 ; Maximum execution time of each script, in seconds
max_input_time = 300 ; Maximum amount of time each script may spend parsing request data
memory_limit = 128M ; Maximum amount of memory a script may consume (8MB)

5 In order to make the localisation of g2 (multi-language) work you need the gettext extension of php. This can be enabled in php.ini. G2 does hint you for that. However gettext is a little strange extension. First find the extension in your php.ini and remove the # in front of the line
extension=php_gettext.dll

But now comes the crux; gettext.dll is depending on \php-install-dir\dll\iconv.dll
All other extensions work flawlessly for me. But gettext.dll required me to put iconv.dll into a dir that is included in the searchpath. E.g. /windows/system32
I then overreacted and copied all dll's to that /system32 dir. The manual of php 4 tells you to copy the dll's to the /php-install-dir/ but that only works if you add manually the php dir into the path statement of windows.

To see this all in working visit http://www.wetselaar.com/gallery2 .[/]

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-06-21 22:08

thanks for the feedback!

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-06-21 22:12

could you create a feature request on http://sf.net/projects/gallery/ for mime type video/x-msvideo mp4, avi ?

thanks

 
ArthurWetselaar

Joined: 2002-06-11
Posts: 38
Posted: Tue, 2005-06-21 22:20