eZ Community » Forums » Install & configuration » Install eZ Publish in sub-directory...
expandshrink

Install eZ Publish in sub-directory of Apache DocumentRoot

Install eZ Publish in sub-directory of Apache DocumentRoot

Wednesday 01 February 2012 8:46:18 am - 7 replies

Hi All,

Is it possible to install eZ Publish in a sub-directory of apache DocumentRoot?

For example:

DocumentRoot is: /opt/ezpublish/sites/test.com

Put eZ Publish source code in: /opt/ezpublish/sites/test.com/ez

Access the website as followings:

http://test.com/ez/news

http://test.com/ez/user/register

and etc.

Kind regards,

Michael

Wednesday 01 February 2012 9:23:25 am

Hi Michael,

Why not, but you need to configure carefully your virtualhost. What happened if an user try to fetch http://test.com ?

Cheers

Philippe

Wednesday 01 February 2012 2:04:24 pm

Hi Philippe,

Thanks for your feedback. Could you let me know how to make such installation?

As for the security issue, actually, we want to host some non-eZ Publish web pages outside the "ez" sub-directory, so that should be okay.

Kind regards,

Michael

Wednesday 01 February 2012 3:40:33 pm

Well, why aren't you using virtual hosts?  Then whatever directory you put it in doesn't really matter since it will all be relative to the virtual host DocumentRoot.

What you are describing is having an ezpublish site as a subdirectory of another site structure which doesn't really make sense to me, this kind of routing should be done by the http server not by your directory structure.

It would be possible I suppose with the correct rewrite rules and the correct SiteURL in your site.ini... but you're asking for trouble.

So, again, why would you want to do that? If there is a good reason and I'm just missing it, then take a look at your rewrite rules and put a full path for all the rules relative to the DocumentRoot of your default site.  Then change the SiteURL to include the extra directory.  And... if that doesn't work there are probably other settings that I'm forgetting at the moment.

Otherwise just use virtual hosts - if you want to maintain the <tld>/<directory>/<siteaccess> url then you'd still be better of proxying IMHO.

Thursday 02 February 2012 1:24:11 am

Hi Steven,

Thanks for your reply. Actually, we are using virtual host, but the customer wants to host eZ publish and non-eZ Publish pages under the same domain name.

So for example, all eZ Publish pages will be served at http://www.test.com/ez/foo, while other non-eZ Publish pages will be served as http://www.test.com/some-non-ez-publish-pages

In this case, I don't think virtual host will work.

I think it should be possible to install eZ Publish under a sub-director. In fact, we have successfully implemented it by enabling MatchOrder=uri and changing all apache rewrite rules to ^/ez/...$

But I'm not sure if it will cause any potential problems or not.

So could you advise?

Kind regards,

Michael

Thursday 02 February 2012 10:05:13 am

You've successfully implemented it?  Is cache being created in the var dir under ez and image aliases are the package files in the right place?  Otherwise [FileSettings]VarDir would also have to be changed.  The only other thing I can think of is anything path related in extensions.

But, then I really don't know... try it and see what breaks and let us know.  Theoretically it should work.

But, I still say the better way to do it is as a rewrite proxy... I've done this before I just don't remember exactly how I did it... It was something like this:

RewriteRule ez(.*)$  http://ezsubsite.site.com$1 [P]

But with something else too, which is the part I can't remember.

Thursday 02 February 2012 10:21:32 am

@Michael: this should work without big problems - as long as you manage to get urls working.

All the paths to files are not related to the root directory of the webserver, so there is no need to touch Vardir or other settings, nor extensions (the proof is: if you install eZ in non-vhost mode in subdirs of the Apache root it works without a hitch).

For urls, you need to be sure that the index.php does not get generated - and neither does the siteaccess, if I have understood correctly. You should play around with ForceVirtualHost and the .htaccess file up to a point where it works

Friday 03 February 2012 3:53:26 am

Hi Gaetano,

Thanks a lot for your reply.

It works as per your suggestions.

Kind regards,

Michael

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from