Forums / Install & configuration / virtual host setup - please!

virtual host setup - please!

Author Message

Johannes S.

Monday 17 April 2006 7:41:29 am

hi,

with the virtualhost setup below i see only text and no pictures or backgroundcolors in the "frontend" of ezpublish. the admin site is working.
the mediafiles (asf, swf, rm, mov) are working in the frontend, too.

i have checked out the manual and the net and apache sites but this setup which is a mix from the one from "ez systems" manual and from "http://ez.no/community/bugs/flash_quicktime_files_are_not_shown" is not working - and i have used already 10 hours to check out whats going on here.
i also checked out the comments in the manual but they are not working, too.

please could someone post a working virtualhost setup for apache2 and php4.4 on linux?
or even better, could someone tell what is missing or wrong?

---

<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
</VirtualHost>

<VirtualHost *>

DocumentRoot "/Applications/MAMP/ez"

ServerName ez.local

<Directory /Applications/MAMP/ez>
Options All
AllowOverride All
</Directory>


DirectoryIndex index.php


RewriteEngine On
Rewriterule ^/var/storage/.* $0 [L]
Rewriterule ^/var/[^/]+/storage/.* $0 [L]
RewriteRule ^/var/cache/texttoimage/.* - [L]
RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
Rewriterule ^/design/[^/]+/(stylesheets|images|javascript)/.* $0 [L]
Rewriterule ^/share/icons/.* $0 [L]
RewriteRule ^/favicon.ico - [L]
RewriteRule ^/robots.txt - [L]
Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascript)/.* $0 [L]
Rewriterule .* /index.php


</VirtualHost>

---

best,
johannes

Johannes S.

Tuesday 18 April 2006 9:35:52 am

if i change the httpd.config virtualhost section like this:

---
RewriteEngine On
Rewriterule ^/var/storage/.* $0 [L]
Rewriterule ^/var/[^/]+/storage/.* $0 [L]
RewriteRule ^/var/cache/texttoimage/.* - [L]
RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
Rewriterule ^/design/[^/]+/(stylesheets|images|javascript)/.* $0 [L]
Rewriterule ^/share/icons/.* $0 [L]
RewriteRule ^/favicon.ico - [L]
RewriteRule ^/robots.txt - [L]
Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascript)/.* $0 [L]
Rewriterule \.(gif|css|jpg|png|txt|js|xsl|jar|ico|jpeg|xml|ezpkg|jar|swf|wma|mp3|mid|wav|wmv|mov)$ - [L]
Rewriterule .* /index.php
---

than backgroud colors are shown, but the pictures in the gallery, and the mov and swf formats are are not shown.

best,
johannes

Johannes S.

Tuesday 18 April 2006 10:54:17 am

yippijeiyeah!!!!!!

this is really working:

---
RewriteEngine On
Rewriterule ^/var/storage/.* - [L]
Rewriterule ^/var/[^/]+/storage/.* - [L]
RewriteRule ^/var/cache/texttoimage/.* - [L]
RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
Rewriterule ^/design/[^/]+/(stylesheets|images|javascript)/.* - [L]
Rewriterule ^/share/icons/.* - [L]
RewriteRule ^/favicon.ico - [L]
RewriteRule ^/robots.txt - [L]
Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]
RewriteRule ^/packages/styles/.* - [L]
RewriteRule ^/var/cache/debug.html.* - [L]
RewriteRule ^/var/[^/]+/cache/debug.html.* - [L]
RewriteRule !\.(gif|css|jpg|png|txt|js|xsl|jar|ico|jpeg|xml|ezpkg|jar|swf|wma|mp3|mid|wav|wmv|mov)$ /index.php
Rewriterule .* /index.php
---

this "RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]" from the manual is not working for me.
i had to remove the part ".+/thumbnail/".

without "RewriteRule !\.(gif|css|jpg|jpeg|png|txt|html|js|xsl|jar|ico|xml|ezpkg|jar|swf|wma|mp3|mid|wav|wmv)$ /index.php" the media files are not show in "normal" pages like the first one.

there was a comment in the manual section where someone said that "Rewriterule .* /index.php" has to be "Rewriterule .* index.php" - this is not working for me - it gaves me the 400 error...

everything seems to work now. but if someone could explain why ".+/thumbnail/" is not working
and why this "Rewriterule .* index.php" is not working, too, it would be quite interesting...

cheers,
johannes

Kristof Coomans

Tuesday 18 April 2006 11:22:18 pm

You probably need both

RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]

and

Rewriterule ^/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]

like in the generic virtual host setup at http://ez.no/doc/ez_publish/technical_manual/3_6/installation/virtual_host_setup .

We use these rewrite rules (slightly modified version of the generic virtual host setup) for all our portals (Apache 2.0.x) and everything is working fine:

        RewriteEngine On
        RewriteRule ^/var/storage/.* - [L]
        RewriteRule ^/var/[^/]+/storage/.* - [L]
        RewriteRule ^/var/cache/texttoimage/.* - [L]
        RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
        Rewriterule ^/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]
        RewriteRule ^/share/icons/.* - [L]
        RewriteRule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]
        RewriteRule ^/packages/styles/.+/(stylesheets|images|javascripts?)/[^/]+/.* - [L]
        RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]
        RewriteRule ^/favicon\.ico - [L]
        RewriteRule ^/robots\.txt - [L]
        # Uncomment the following lines when using popup style debug.
        # RewriteRule ^/var/cache/debug\.html.* - [L]
        # RewriteRule ^/var/[^/]+/cache/debug\.html.* - [L]
        RewriteRule .* /index.php

 

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Tony Coe

Thursday 17 August 2006 8:32:54 am

Please ignore this post - I have asked the question elsewhere on the forum, so deleted this entry! (I couldn't work out how to remove the post altogether though).