gallery2, mambo, sef, mode rewrite...

laga

Joined: 2005-08-20
Posts: 5
Posted: Sat, 2005-08-20 09:54

hello,

i have a site with mambo SEF on and Gallery 2. It work with the short urls, just a kind of a trick in the mambo .htacces was neded. i also use the latest mambo component for the embeding.

however, it´s look fine. just when google, yahoo or msn start a session i recive loads from the server that goest to 65 and more (65 was what i still could see) (excuse my english, i am from romania.)

the problem ocurse also if more than a few and i mreally mean 4-5 user try to acces the pictures in the same time intervall. if 1 usert just click 10-20-30 times on a picture, without to wait for the loading of the next page, server gows instantly to 10 points of load average and more only a complete reboot will help.

to my configuration, debian linux latest (php, mysql, apache, imagemagic, netpbm, gd2, ffmpeg, all the debian stable version updated daily)

because many users at the same time will crashing my server, i will only provide to the developers a link and also acces to the server.

i made the mistake, even if the update seems to work super OK, to update a production site with the lates gallery.

i realy need urgent help on how to hold the load down.

ssh or ftp can be provided.

Login or register to post comments
fryfrog

Joined: 2002-10-30
Posts: 3233
Posted: Tue, 2005-08-23 05:18

Use the admin interface to create all derivitives, this will cause all thumbs and resizes to be built immediatly. This is probably what is taking so long, making users click more than once.

Login or register to post comments
laga

Joined: 2005-08-20
Posts: 5
Posted: Tue, 2005-08-23 06:27

Build all thumbnails/resizes 08:57:03 AM 08/23/2005
Success
run now
Ensure data files for all derivatives (thumbnails, etc) have been built and rebuild broken ones.

Last Run Details: Checked 2320 items
11 items built

hmm, i try this also. right now i do it again.

however. to make gallery work with SEF on, i manipulate the .htacces file like this:

 
Options +FollowSymlinks

RewriteEngine On

#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*) index.php


# BEGIN Url Rewrite section
# (Automatically generated.  Do not edit this section)
#<IfModule mod_rewrite.c>
#    RewriteEngine On
#
#    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
    RewriteCond %{REQUEST_FILENAME} !/index\.php\?option\=com_gallery2&amp;Itemid\=121
    RewriteRule .   -   [L]


    RewriteCond %{THE_REQUEST} \ /vezi/poze/rochii/mirese/album/(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/index\.php\?option\=com_gallery2&amp;Itemid\=121
    RewriteRule .   //index.php?option=com_gallery2&amp;Itemid=121&g2_view=core.ShowItem   [QSA,L]

    RewriteCond %{THE_REQUEST} \ /albume//slideshow.html(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/index\.php\?option\=com_gallery2&amp;Itemid\=121
    RewriteRule .   //index.php?option=com_gallery2&amp;Itemid=121&g2_view=slideshow.Slideshow   [QSA,L]

    RewriteCond %{THE_REQUEST} \ /download/poze/rochii/mirese/album/([0-9]+)-([0-9]+)/([^\/]+)(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/index\.php\?option\=com_gallery2&amp;Itemid\=121
    RewriteRule .   /gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2   [QSA,L]

    RewriteCond %{THE_REQUEST} \ /vezi/poze/rochii/mirese/album/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/index\.php\?option\=com_gallery2&amp;Itemid\=121
    RewriteRule .   //index.php?option=com_gallery2&amp;Itemid=121&g2_view=core.ShowItem&g2_path=%1   [QSA,L]

    RewriteCond %{THE_REQUEST} \ /albume/([^?]+)/slideshow.html(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/index\.php\?option\=com_gallery2&amp;Itemid\=121
    RewriteRule .   //index.php?option=com_gallery2&amp;Itemid=121&g2_view=slideshow.Slideshow&g2_path=%1   [QSA,L]

    RewriteCond %{THE_REQUEST} \ /c/view/([0-9]+).html(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/index\.php\?option\=com_gallery2&amp;Itemid\=121
    RewriteRule .   //index.php?option=com_gallery2&amp;Itemid=121&g2_view=core.ItemAdmin&g2_subView=comment.ShowComments&g2_itemId=%1   [QSA,L]

    RewriteCond %{THE_REQUEST} \ /c/add/([0-9]+).html(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/index\.php\?option\=com_gallery2&amp;Itemid\=121
    RewriteRule .   //index.php?option=com_gallery2&amp;Itemid=121&g2_view=core.ItemAdmin&g2_subView=comment.AddComment&g2_itemId=%1   [QSA,L]

#</IfModule>

# END Url Rewrite section

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !gallery\_remote2\.php  [OR]
RewriteCond %{REQUEST_FILENAME} !/index\.php\?option\=com_gallery2&amp;Itemid\=121      [OR]
RewriteCond %{THE_REQUEST} !\ /vezi/poze/rochii/mirese/album/(\?.|\ .)  [OR]
RewriteCond %{THE_REQUEST} !\ /albume//slideshow.html(\?.|\ .)  [OR]
RewriteCond %{THE_REQUEST} !\ /download/poze/rochii/mirese/album/([0-9]+)-([0-9]+)/([^\/]+)(\?.|\ .)    [OR]
RewriteCond %{THE_REQUEST} !\ /vezi/poze/rochii/mirese/album/([^?]+)(\?.|\ .)   [OR]
RewriteCond %{THE_REQUEST} !\ /albume/([^?]+)/slideshow.html(\?.|\ .)   [OR]
RewriteCond %{THE_REQUEST} !\ /c/view/([0-9]+).html(\?.|\ .)    [OR]
RewriteCond %{THE_REQUEST} !\ /c/add/([0-9]+).html(\?.|\ .)     [OR]
RewriteCond %{REQUEST_URI} !//index.php?option=com_gallery2&amp;Itemid=121&g2_view=core.ItemAdmin&g2_subView=comment.AddComment&g2_itemId=%1    [OR]
RewriteCond %{REQUEST_URI} !//index.php?option=com_gallery2&amp;Itemid=121&g2_view=core.ItemAdmin&g2_subView=comment.ShowComments&g2_itemId=%1  [OR]
RewriteCond %{REQUEST_URI} !//index.php?option=com_gallery2&amp;Itemid=121&g2_view=slideshow.Slideshow&g2_path=%1       [OR]
RewriteCond %{REQUEST_URI} !//index.php?option=com_gallery2&amp;Itemid=121&g2_view=core.ShowItem&g2_path=%1     [OR]
RewriteCond %{REQUEST_URI} !/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2        [OR]
RewriteCond %{REQUEST_URI} !//index.php?option=com_gallery2&amp;Itemid=121&g2_view=slideshow.Slideshow  [OR]
RewriteCond %{REQUEST_URI} !//index.php?option=com_gallery2&amp;Itemid=121&g2_view=core.ShowItem        [OR]
#RewriteCond %{REQUEST_URI}
RewriteRule ^(.*) index.php

the mambo .htacces only contains

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php

i think the steps are:
mambo: - revrite all to index.php what it is not a directory and is not a file.

gallery: rewrite if it is a file and if it is a directory but not gallery\_remote2\.php

so gallery rewrite the requests. i think a litle increase of server time will be also produce by the apache module autoindex wich will try to index the directory that gallery virtual creates. (i am not a coder, just try to explain it to myself. if somebody knows more please help)

the gallery rewrite albums to directory wiht ending slash http://www.someurl.com/album/name/

like i said, gallery is only embeded. that means that i do not have /gallery_2/ or soemthing like this between url and the rewrited part.

i think i tell mambo to overwrite to index.php all stuf that cannot be from the gallery. in the gallery directory, the .htacces file is the standard created by the module. in the latest gallery, 2.1+5, (the full version), if i remove something from this htacces it will not work. other previous versions have no problems with it if they are ambeded.

can anyone help me with corect htacces files ? i am not sure i do it right.
also if enyoane can write the gallery rewrite module so that is compatible wiht the mambo SEF will be superb.

another think is, that mabos SEF overwrite the url to gallery by itself but it stop there. so in the mambo gallery 2 component (Version:2.0.6 ), in the config, and after i made a menu link, it takes the link id:
/index.php?option=com_gallery2&Itemid=121
in the browser the mambo SEF overwrite it to: http://www.whitewedding.ro/component/option,com_gallery2/Itemid,121/
(in mambo, menu item as component not as link)

another think is that if the gallery runs, in mysql i have very much connections. i try both, persistent and not persistent. with noit persisten it work better but not so much better. the number of request is very high. can be because of my .htaccess file. the way i understand this is that gallery take a look in the database to see what rules to aply for urls, than goes back and aply them, at this point first begin the .htaccess rules to work wich cause another requests to the database.

anyway. my biggest problem is that i am not o coder and not realy understand all of this. copy paste and click clik next are my best friends :D.

Login or register to post comments
laga

Joined: 2005-08-20
Posts: 5
Posted: Tue, 2005-08-23 06:31

my system infos from gallery

Get system details; useful for copy/paste into G2 support forum.

Last Run Details:

Gallery version = 2.0-rc-1 core 0.9.34
PHP version = 4.3.10-15 apache
Webserver = Apache/1.3.33 (Debian GNU/Linux)
Database = mysql 4.0.24_Debian-10-log
Toolkits = ArchiveUpload, Thumbnail, ImageMagick, Ffmpeg, Dcraw, Gd, NetPBM
Operating system = Linux servded9 2.2.20-idepci #1 Sat Apr 20 12:45:19 EST 2002 i686
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; ro-RO; rv:1.7.10) Gecko/20050717 Firefox/1.0.6

Login or register to post comments
Hotzi

Joined: 2004-03-16
Posts: 58
Posted: Sun, 2005-10-02 22:59

Hi there, dealing with mod_rewrite should not solve problems:

1.) Gallery Path and Picture/Album Name in Pathway
2.) Gallery Path and Picture/Album Name in Title

In Version 1.5.1 all that was possible, by editing 3 Files:

http://www.hotzeltopf.de/gallery/Zwerggarnelen

But it would be better if such a feature could be officially included in the gallery code, because after every Joomla/Mambo or Gallery update, some files have to be edited again.

Best regards

Hotzi

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32356
Posted: Mon, 2005-10-03 18:57

Hotzi
what are you asking for? i don't get it :/

Login or register to post comments
GwaiTsi

Joined: 2007-02-09
Posts: 55
Posted: Sat, 2007-03-24 09:18

Hotzi

I see your gallery works great embedded and tried to follow the links on your page but they are no longer valid.
I tried laga's solution but couldn't get it to work.

Can you please give us your instructions for getting gallery and SEF to work embedded.

thanks

Login or register to post comments
Hotzi

Joined: 2004-03-16
Posts: 58
Posted: Sat, 2007-03-24 10:49

Hi, i can try to reproduce it for you. But its G1, do you want to use G1?

--
http://www.andrehotzler.de

Login or register to post comments
GwaiTsi

Joined: 2007-02-09
Posts: 55
Posted: Sat, 2007-03-24 12:52

Hi Hotzi

I am using G2.2 with PG Extreme, but i would been keen to look at how you did it and maybe see if any of the ideas can be applied to G2.2.

Thanks

Login or register to post comments
Hotzi

Joined: 2004-03-16
Posts: 58
Posted: Mon, 2007-04-09 20:13

Hello,

sorry, i were very busy.

Could you contact me via ICQ: 56500781, because i do not know all changes anymore and we could test it together, i dont want post wrong changes here.

--
http://www.andrehotzler.de

Login or register to post comments