Share » Forums » Setup & design » Help needed - Setup multiple websites

Help needed - Setup multiple websites

Help needed - Setup multiple websites

Friday 02 November 2007 6:12:14 am - 15 replies

Author Message

Sebastiaan van der Vliet

Friday 02 November 2007 8:54:45 am

Hello Johannes,

Is it possible to log in onto the administrative backend of site 2? If you can login there, go the the "Users accounts" section. Click on "roles and policies", and then on the link "Anonymous ". Check if the user login siteaccess rule includes the siteaccess for site 2.

Kind regards,
Sebastiaan

Certified eZ publish developer with over 9 years of eZ publish experience. Available for challenging eZ publish projects as a technical consultant, project manager, trouble shooter or strategic advisor.

Johannes Lachman

Saturday 03 November 2007 1:17:33 am

Hi Sebastiaan,

Thanks for the reply. I never actually tried that :S
I notice that i can't even connect to the admin section of Site1.
I can login as admin, but only on the website itself, not the adminpanel.
It says "Module cannot be found".

Did i link my adminsection in a wrong way?

Stefan de Bruijn

Saturday 03 November 2007 10:29:36 am

Hi Johannes,

You have set the matchorder to 'host', but are using an uri for the admin access:
HostMatchMapItems[]=eyc.getmyip.com;eyc
HostMatchMapItems[]=eyc.getmyip.com/eycadmin;eycadmin

When MatchOrder is set to host, you must use virtual hosts, for instance:
HostMatchMapItems[]=eyc.getmyip.com;eyc
HostMatchMapItems[]=eycadmin.getmyip.com;eycadmin

The first line is a correct host, so that will work.
If you want 'HostMatchMapItems[]=eyc.getmyip.com/eycadmin;eycadmin ' to work, set MatchOrder to 'uri'.
See
http://ez.no/doc/ez_publish/technical_manual/3_9/reference/configuration_files/site_ini/siteaccesssettings/matchorder

The same applies for your apache settings.You can only use hostnames as a serveralias (http://httpd.apache.org/docs/2.2/mod/core.html#serveralias). You also have 2 virtualhosts with the same name (i suppose apache will use the first one).

You say you want to have multiple sites in 1 Ez Publish installation. 1 apache vhost will then be sufficient (if its the only, or first vhost, you don't have to set serveraliasses as it will be the default host).

The <Directory var/ezwebin_site> should then point to the root of the ez-publish install, which it probably does, but <Directory var/ezechiel> points to another directory. Do you have another ez installed in this directory?

regards,
Stefan de Bruijn

Johannes Lachman

Sunday 04 November 2007 11:58:00 pm

Hi Stefan,

Thanks for the reply.
I changed the MatchOrder to <b>"host;uri"</b>

I've deleted the serveraliases. If apache will only look at the first vhost, what about the the following code in the vhost?
<b>
<Directory var/ezwebin_site>
Options FollowSymLinks
AllowOverride None
</Directory>
</b>

The directory is not the same for Site2... (var/ezechiel)

When i login on admin of eyc (eycadmin) i get "Page not Found" error. In the site.ini settings i changed localhost to the real URI. See down below. But i still get the error. Do i have to restart some services when i change the settings?

<b>siteaccess\eyc:</b>
[SiteSettings]
SiteName=www.eyc.cc
SiteURL=<b>eyc.getmyip.com</b> <-- it was localhost
LoginPage=embedded
AdditionalLoginFormActionURL=<b>http://eyc.getmyip.com/eycadmin/user/login</b>
<-- it was localhost/eycadmin.....

When i log in Site2 i still get the error "Module not Found". There i get the following url: http://ezlwebserver.homeip.net/ezladmin/user/login

Any ideas?

<b>The <Directory var/ezwebin_site> should then point to the root of the ez-publish install, which it probably does, but <Directory var/ezechiel> points to another directory. Do you have another ez installed in this directory?</b>
No, i did not install a second EZ. I thought that if i wanted to change Site2 in an other way than Site1, they had to have different Var Directories. var/ezechiel is just a copy of var/ezwebin_site, which was the original var of the installation.

I hope you or someone else has more advise for me... :)

Regards,
Johannes

Stefan de Bruijn

Tuesday 06 November 2007 7:47:08 am

<i>II've deleted the serveraliases. If apache will only look at the first vhost, what about the the following code in the vhost?</i>I
Apache will of course look at all vhosts, but you named them the same.

<Directory var/ezwebin_site>
Options FollowSymLinks
AllowOverride None
</Directory>

You can have multiple directory directives in apache for different directory settings. Not necessary though for a standard installation. What's more puzzling: you have set: "DocumentRoot var/ezwebin_site"
I supposed you had installed ez in the linux /var directory.
Documentroot should point to the root of your ez publish installation.
Look at: http://ez.no/doc/ez_publish/technical_manual/3_10/installation/virtual_host_setup for instructions on virtual host.

<i>When i log in Site2 i still get the error "Module not Found". There i get the following url: http://ezlwebserver.homeip.net/ezladmin/user/login</i>
It should also be a 404 based on your apache setting. Please first set these correct.
I principle:
404 error: apache settings are wrong
Oject not found: that's a response from ez publish. can be apache setting (for instance rewrite rules) or ez publish settings (or simply asking a non existing object).

<i>No, i did not install a second EZ. I thought that if i wanted to change Site2 in an other way than Site1, they had to have different Var Directories. var/ezechiel is just a copy of var/ezwebin_site, which was the original var of the installation.</i>
They do, but you don't set these in apache but in your siteaccess settings you specify wich var directory ez publish uses (as you already did).

Johannes Lachman

Thursday 08 November 2007 5:51:23 am

Hmm... ok i started again with a clean install, since i have been experimenting a lot with the configs. :-)

The 2 sites work now with localhost on the server itself.
(localhost/siteA, localhost/siteadminA, localhost/siteB and localhost/siteadminB)

So now i want to reach the sites with my two domainnames.
But both domainnames point to my default siteaccess. So did i miss something in my vhosts?
Please check my new vhosts down below.

I've put this code in de Override/site.ini

[SiteSettings]
DefaultAccess=ezechiel
SiteList[]
SiteList[]=dut
SiteList[]=ezechiel
SiteList[]=ezladmin
SiteList[]=eyc
SiteList[]=eycadmin
RootNodeDepth=1

[SiteAccessSettings]
CheckValidity=false
AvailableSiteAccessList[]
AvailableSiteAccessList[]=dut
AvailableSiteAccessList[]=ezechiel
AvailableSiteAccessList[]=ezladmin
AvailableSiteAccessList[]=eyc
AvailableSiteAccessList[]=eycadmin
MatchOrder=uri
HostMatchMapItems[]
HostMatchMapItems[]=eyc.getmyip.com;eyc
HostMatchMapItems[]=eyc.getmyip.com/eycadmin;eycadmin
HostMatchMapItems[]=ezlwebserver.homeip.net;ezechiel
HostMatchMapItems[]=ezlwebserver.homeip.net/ezladmin;ezladmin

And these 2 virtual hosts in the httpd.config

<VirtualHost eyc.getmyip.com>
<Directory C:/eZpublish/ezpublish>
Options FollowSymLinks
AllowOverride None
</Directory>

ServerName eyc.getmyip.com
ServerAdmin johannes@lachman.nl
DocumentRoot "c:\eZpublish\eZpublish"

RewriteEngine On
RewriteRule !(^/design|^/var/.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages|^/packages|^/share/icons|^/share/pic).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf)$ /index.php

</VirtualHost>

<VirtualHost ezlwebserver.homeip.net>
<Directory C:/eZpublish/ezpublish>
Options FollowSymLinks
AllowOverride None
</Directory>

ServerName ezlwebserver.homeip.net
ServerAdmin johannes@lachman.nl
DocumentRoot "c:\eZpublish\eZpublish"

RewriteEngine On
RewriteRule !(^/design|^/var/.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages|^/packages|^/share/icons|^/share/pic).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf)$ /index.php

</VirtualHost>

Greg McAvoy-Jensen

Thursday 08 November 2007 6:22:19 am

Johannas,

You'll need to set MatchOrder to host, not uri.

Tot ziens.

Greg McAvoy-Jensen

Granite Horizon, Certified Developer of eZ Publish Web Solutions
Provider of the SaaS Solution Granite Horizon In The Cloud | http://granitehorizon.com/cloud
http://granitehorizon.com | +1 916 647 6350 | California USA | @granitegreg
Blog: http://granitehorizon.com/blog

Johannes Lachman

Friday 09 November 2007 1:53:32 am

Ahh yes than it works except my /admin panels dont work anymore. (page cannot be found)
Is it only one or the other? Host or Uri? and not both?

Heath

Friday 09 November 2007 2:11:54 am

I think that fallbacks are still supported ... try using both. Here is an untested settings example of what I suggest. See MatchOrder ...

This is a pattern / feature found in the default settings. <i>http://pubsvn.ez.no/nextgen/trunk/settings/site.ini</i>

[SiteAccessSettings]
# <snip />
# MatchOrder=host;uri
# or ...
# MatchOrder=uri;host
MatchOrder=host;uri
HostMatchMapItems[]=eyc.getmyip.com;eyc
HostMatchMapItems[]=eyc.getmyip.com/eycadmin;eycadmin
HostMatchMapItems[]=ezlwebserver.homeip.net;ezechiel
HostMatchMapItems[]=ezlwebserver.homeip.net/ezladmin;ezladmin

Another (possibly <i>better</i>) suggestion is for you to stop using uri method to access the admin. You would be better of using a dns host alias in your local hosts file or dns for admin.yourdomain.com

Cheers,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Johannes Lachman

Thursday 29 November 2007 2:29:42 am

Hi again,

I tried the following down below...
"Is it possible to log in onto the administrative backend of site 2? If you can login there, go the the "Users accounts" section. Click on "roles and policies", and then on the link "Anonymous ". Check if the user login siteaccess rule includes the siteaccess for site 2."

But i still get the access denied for my second site. Only when i log in and log out again. The content is visible for the time that i am active on the site.

Are there some other policies that i have to include?

Further more i notice that the sitename of settings\override\site.ini.append.php is used and not the sitename of settings\siteaccess\eyc (second site). What must i do to let him use the params of my siteaccess specific file? i see that the sites show different content, but i guess i missed a step somewhere. Some advise please... :-)

Kind regards,
Johannes

Greg McAvoy-Jensen

Tuesday 08 July 2008 3:28:33 pm

For the record--clearing the cache may have been the other step he needed. It just worked for me.

Granite Horizon, Certified Developer of eZ Publish Web Solutions
Provider of the SaaS Solution Granite Horizon In The Cloud | http://granitehorizon.com/cloud
http://granitehorizon.com | +1 916 647 6350 | California USA | @granitegreg
Blog: http://granitehorizon.com/blog

Jameel Rahmaan

Friday 01 August 2008 6:11:57 am

I have a very similar problem with my multi site install using virtual hosts and a single database with the site access files limiting the viewable content and start nodes accordingly.

In my case all the admin sites work with the right content restrictions but all the user sites have the same issue where access is denied to the anonymous user. As soon as I log in, I get the right content displayed according to the section limits I have set up.

All of my user site access and my overrride site.ini files have

[SiteAccessSettings]
DefaultAccess=tdi_user (or other user site access)
RequireUserLogin=false

Apache is also set up to allow anonymous access and I have changed the anonymous role to have viewing rights on my new sections.

I also have a different cache directory set for each siteaccess.

I have also played around with the settings in the override/site.ini.append.php and siteaccess/site.ini.append.php files to see if other combinations would help but nothing works. And yes, I do clear the cache after every ini file change.

What I don't understand is why my settings are being ignored and the anonymous user cannot see content. The error log is not much help:
[ Aug 01 2008 13:00:02 ] [5.0.4.102] Timing Point: Module start 'content'
[ Aug 01 2008 13:00:02 ] [5.0.4.102] error/view.php:
Error ocurred using URI: /index.php

Do I absolutely need to use a different database for each site or is there some other config setting I am overlooking? Any help would be appreciated.

Greg McAvoy-Jensen

Friday 01 August 2008 8:26:21 am

You can use the same database. However, as I understand it, the number of databases dictates the number of var directories. Each database should have exactly one var directory.

Have you given the anonymous user login privileges on the new siteaccess?

Granite Horizon, Certified Developer of eZ Publish Web Solutions
Provider of the SaaS Solution Granite Horizon In The Cloud | http://granitehorizon.com/cloud
http://granitehorizon.com | +1 916 647 6350 | California USA | @granitegreg
Blog: http://granitehorizon.com/blog

Jameel Rahmaan

Friday 01 August 2008 8:38:39 am

The anonymous user has the following role:

content read Section( Standard , Bigbuoy )
content pdf Section( Standard , Bigbuoy )
user login No limitations

I'll update the var settings and clear the cache now.

Jameel Rahmaan

Friday 01 August 2008 9:00:59 am

Okay, that's better but still not all the way there.

The main site is now allowing anonymous users but the site that is limited to a particular section is still giving me an access denied error for the anonymous user. However the admin section is still coming up so I'm going through the site ini files to see if I've made a mistake somewhere.

Thanks for the help so far.

All sorted - browser cache issue on the site limited to one section

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

36 542 Users on board!

Forums menu