Forums / Install & configuration / Moving ezPublish off the root...

Moving ezPublish off the root...

Author Message

Brian Laird

Monday 03 April 2006 12:00:55 pm

I just inherited an eZpublish website and I am trying to move an existing the website from the root (/) of the webserver to a virtual directory (ex: /mysite). I have tried using an Alias or mod rewrite in apache but the source is still being returned referencing the root (ex: /var/images... instead of /mysite/var/images...). One piece of important information before I get to my questions is that the site is already localized for 5 different languages.

Does anyone have an easy way of moving the whole site down one level to a new virtual directory? Can I use the "Dir" attribute in the site.ini (SiteSettings section) to accomplish this? I can't find any documentation on what the Dir setting is suppose to do or how it would be formatted.

Another idea I had was to turn on the fully qualified urls? As I understand it, this would cause eZpublish to return the html source with completely qualified URLs. If I could get that to work then I think I can just change the site url to something like http://www.mydomain.com/mysite/.

Thank you in advance for any help with this,
Brian

Gabriel Ambuehl

Monday 03 April 2006 3:59:16 pm

There's a variable in Admin Interface -> Design -> Look and feel (IIRC, you'll find it anyway ;) which defines the URL to the installation. That should help you move it

Visit http://triligon.org

Betsy Gamrat

Tuesday 04 April 2006 6:27:38 am

You could use Linux commands. mv and/or cp, zip/tar to move the code down to a subdirectory, and then update the ini settings.

Brian Laird

Tuesday 04 April 2006 8:03:19 am

I am really new to eZpublish so I realize I can move the whole filesystem but I don't know what ini file changes need to be made. I tried that in the beginning but wasn't able to get it to work.

I looked in Admin Interface -> Design -> Look and feel and all I found was the Site URL. Do you know how that should be formatted? Also now that I set that (it was ez.no) how do get the pages to start using it?

Thanks,
Brian

Betsy Gamrat

Tuesday 04 April 2006 8:58:09 am

Go into Settings > Ini Settings > (Choose the view) > site.ini and you'll see more URL settings.

It is a good idea to clear the .ini cache after changing .ini settings.

If something goes wrong, you can go in with Linux and restore the previous .ini settings by copying back the ~ copy of the file (you'll see it in the directory listing - the filename has a ~ in it, and that is the previous settings). You can also edit the files manually - although you must be very careful.

Kåre Køhler Høvik

Thursday 06 April 2006 8:00:13 am

Hi

Here's how to move eZ publish from the root to <i>mydir</i>

Apache rewrite settings:
Before:

# eZ publish 3.7
<VirtualHost 127.0.0.7:*>
    <Directory /home/hovik/public_html/ezp37 >
        Options FollowSymLinks
        AllowOverride None
    </Directory>

    <IfModule mod_php4.c>
        php_admin_flag safe_mode Off
        php_admin_value register_globals 0
        php_value magic_quotes_gpc 0
        php_value magic_quotes_runtime 0
        php_value allow_call_time_pass_reference 0
    </IfModule>

    <IfModule mod_rewrite.c>
        RewriteEngine On

        RewriteCond %{HTTP_HOST} ^soap\..*
        RewriteRule .* /soap.php [L]

        RewriteCond %{HTTP_HOST} ^webdav\..*
        RewriteRule .* /webdav.php [L]

        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 ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]
        Rewriterule ^/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
        RewriteRule ^/.* /index.php

    </IfModule>

    DocumentRoot /home/hovik/public_html/ezp37
    ServerName ezp37
    ServerAlias admin.ezp37
    ServerAlias soap.ezp37
    ServerAlias webdav.ezp37
    ServerAlias intranet.ezp37

</VirtualHost>

After:

# eZ publish 3.7
<VirtualHost 127.0.0.7:*>
    <Directory /home/hovik/public_html/ezp37 >
        Options FollowSymLinks
        AllowOverride None
    </Directory>
 
    <IfModule mod_php4.c>
        php_admin_flag safe_mode Off
        php_admin_value register_globals 0
        php_value magic_quotes_gpc 0
        php_value magic_quotes_runtime 0
        php_value allow_call_time_pass_reference 0
    </IfModule>
 
    <IfModule mod_rewrite.c>
        RewriteEngine On

        RewriteCond %{HTTP_HOST} ^soap\..*
        RewriteRule .* /mydir/soap.php [L]

        RewriteCond %{HTTP_HOST} ^webdav\..*
        RewriteRule .* /mydir/webdav.php [L]

        Rewriterule ^/mydir/var/storage/.* - [L]
        Rewriterule ^/mydir/var/[^/]+/storage/.* - [L]
        RewriteRule ^/mydir/var/cache/texttoimage/.* - [L]
        RewriteRule ^/mydir/var/[^/]+/cache/texttoimage/.* - [L]
        Rewriterule ^/mydir/design/[^/]+/(stylesheets|images|javascript)/.* - [L]
        Rewriterule ^/mydir/share/icons/.* - [L]
        Rewriterule ^/mydir/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]
        Rewriterule ^/mydir/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
        RewriteRule ^/mydir/.* /mydir/index.php

    </IfModule>
 
    DocumentRoot /home/hovik/public_html/ezp37
    ServerName ezp37
    ServerAlias admin.ezp37
    ServerAlias soap.ezp37
    ServerAlias webdav.ezp37
    ServerAlias intranet.ezp37

</VirtualHost>

settings/override/site.ini.apppend.php needs this alteration:

[SiteSettings]
SiteURL=ezp37/mydir

This behavior was fixed in rev. 13713, so it should work with eZ publish 3.7.1 and newer releases.

Kåre Høvik

Kristof Coomans

Wednesday 17 May 2006 7:54:27 am

Hi Kåre

I tried to use your configuration on a fresh installation of a 3.8 site (setup wizard). It works fine if I use http://example.com/mydir/index.php. But not for http://example.com/mydir/, the paths to design elements etc. are not right, they are not prepended with 'mydir'.

I'd like to drop the index.php from the URL. Is that possible?

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

Kristof Coomans

Wednesday 17 May 2006 7:59:49 am

It was my fault, instead of something like

DocumentRoot /home/hovik/public_html/ezp37

I had

DocumentRoot /home/hovik/public_html/ezp37/

(note the extra slash).

It doesn't harm for Apache but it causes wrong processing in eZSys.

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

Kristof Coomans

Thursday 18 May 2006 4:06:03 am

When starting the setup wizard from http://example.com/mydir/, I can't get further then the welcome page.

Reason: the forums used in the setup wizard will post to /mydir (not: /mydir/ ), so I'll get back a 301 Moved Permanently response and I'm redirected to /mydir/.

Kåre, have I missed something? Is this config only meant to be used after initial setup, or is it a bug in the setup wizard?

thanks

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