Access denied

Author Message

Veronique Jamilloux

Tuesday 23 August 2011 9:43:42 am

Hi,

I've 2 sites in the same eZpublish instance (v 4.2), but their content are in the same database because these sites use the same content classes. These sites have their own design.

So I build 2 virtual host and i've 2 urls : urgi.versailles.inra.fr en morgoth.versailles.inra.fr.

In eZpublish,

  • there are 3 siteaccess in directory setting/siteaccess : morgoth, urgi, urgi_admin with there own site.ini.append.php file

setting/siteaccess/morgoth/site.ini.append.php:

<?php /* #?ini charset="utf-8"?

[DatabaseSettings]
***

[InformationCollectionSettings]
***

[Session]
SessionNamePerSiteAccess=disabled

[SiteSettings]
SiteName=WHEAT
SiteURL=morgoth.versailles.inra.fr
LoginPage=embedded
AdditionalLoginFormActionURL=http://urgi.versailles.inra.fr/index.php/urgi_admin/user/login
RootNodeDepth=2
IndexPage=/content/view/full/1524/
DefaultPage=/content/view/full/1524

[NodeSettings]
RootNode=1524

[UserSettings]
LogoutRedirect=/

[SiteAccessSettings]
RequireUserLogin=false
ShowHiddenNodes=false

[DesignSettings]
SiteDesign=morgoth
AdditionalSiteDesignList[]=ezwebin
AdditionalSiteDesignList[]=ezflow
AdditionalSiteDesignList[]=base
AdditionalSiteDesignList[]=standard

[RegionalSettings]
Locale=eng-GB
ContentObjectLocale=eng-GB
ShowUntranslatedObjects=disabled
SiteLanguageList[]
SiteLanguageList[]=eng-GB
TextTranslation=disabled

[FileSettings]
VarDir=var
CacheDir=cache

[ContentSettings]
TranslationList=

[SearchSettings]
SearchViewHandling=template

[DebugSettings]
DebugOutput=enabled
DebugRedirection=disabled
[TemplateSettings]
Debug=enabled
ShowXHTMLCode=disabled
ShowUsedTemplates=enabled
*/ ?>

setting/siteaccess/urgi/site.ini.append.php :

 

<?php /* #?ini charset="utf-8"?
[DatabaseSettings]
****
[InformationCollectionSettings
****]
[Session]
SessionNamePerSiteAccess=disabled

[SiteSettings]
SiteName=URGI
SiteURL=urgi.versailles.inra.fr
LoginPage=embedded
AdditionalLoginFormActionURL=http://morgoth.versailles.inra.fr/index.php/urgi_admin/user/login
RootNodeDepth=2
IndexPage=/content/view/full/1523/
DefaultPage=/content/view/full/1523

[NodeSettings]
RootNode=1523

[UserSettings]
LogoutRedirect=/

[SiteAccessSettings]
RequireUserLogin=false
ShowHiddenNodes=false

[DesignSettings]
SiteDesign=urgi
AdditionalSiteDesignList[]=ezwebin
AdditionalSiteDesignList[]=ezflow
AdditionalSiteDesignList[]=base
AdditionalSiteDesignList[]=standard

[RegionalSettings]
Locale=eng-GB
ContentObjectLocale=eng-GB
ShowUntranslatedObjects=disabled
SiteLanguageList[]
SiteLanguageList[]=eng-GB
TextTranslation=disabled

[FileSettings]
VarDir=var
CacheDir=cache

[ContentSettings]
TranslationList=

[SearchSettings]
SearchViewHandling=template

[DebugSettings]
DebugOutput=disabled
DebugRedirection=disabled

[TemplateSettings]
Debug=disabled
ShowXHTMLCode=disabled
ShowUsedTemplates=disabled
*/ ?>

setting/siteaccess/urgi_admin/site.ini.append.php :

 <?php /* #?ini charset="utf-8"?

[DatabaseSettings]
****

[InformationCollectionSettings]
EmailReceiver=

[SiteSettings]
SiteName=URGI
SiteURL=urgi.versailles.inra.fr
LoginPage=custom

[UserSettings]
RegistrationEmail=

[SiteAccessSettings]
RequireUserLogin=true
RelatedSiteAccessList[]=urgi
RelatedSiteAccessList[]=urgi_admin
RelatedSiteAccessList[]=eng
RelatedSiteAccessList[]=iphone
ShowHiddenNodes=true

[DesignSettings]
SiteDesign=urgi_admin
AdditionalSiteDesignList[]=admin
AdditionalSiteDesignList[]=ezflow

[RegionalSettings]
Locale=eng-GB
ContentObjectLocale=eng-GB
ShowUntranslatedObjects=enabled
SiteLanguageList[]=eng-GB
TextTranslation=disabled

[FileSettings]
VarDir=var/ezflow_site

[ContentSettings]
CachedViewPreferences[full]=admin_navigation_states=0;admin_navigation_content=0;admin_navigation_details=0;admin_navigation_languages=0;admin_navigation_locations=0;admin_navigation_relations=0;admin_navigation_roles=0;admin_navigation_policies=0;admin_navigation_content=0;admin_navigation_translations=0;admin_children_viewmode=list;admin_list_limit=1;admin_edit_show_locations=0;admin_leftmenu_width=10;admin_url_list_limit=10;admin_url_view_limit=10;admin_section_list_limit=1;admin_orderlist_sortfield=user_name;admin_orderlist_sortorder=desc;admin_search_stats_limit=1;admin_treemenu=1;admin_bookmarkmenu=1;admin_left_menu_width=13
TranslationList=

[MailSettings]
AdminEmail=veronique.jamilloux@versailles.inra.fr
EmailSender=veronique.jamilloux@versailles.inra.fr

[DebugSettings]
DebugOutput=disabled
DebugRedirection=disabled

[TemplateSettings]
Debug=disabled
ShowXHTMLCode=disabled
ShowUsedTemplates=disabled
*/ ?>

In the setting/override/site.ini.append.php :

 <?php /* #?ini charset="utf-8"?

[ExtensionSettings]
ActiveExtensions[]=cjw_newsletter
ActiveExtensions[]=ezflow
ActiveExtensions[]=ezgmaplocation
ActiveExtensions[]=ezjscore
ActiveExtensions[]=ezodf
ActiveExtensions[]=ezoe
ActiveExtensions[]=ezstarrating
ActiveExtensions[]=ezwebin
ActiveExtensions[]=ezwt
ActiveExtensions[]=recaptcha
ActiveExtensions[]=wordCut
ActiveExtensions[]=wrap_operator

[Session]
SessionNameHandler=custom

[SiteSettings]
DefaultAccess=urgi
SiteList[]=urgi
SiteList[]=urgi_admin
SiteList[]=morgoth
SiteList[]=eng
SiteList[]=iphone

[UserSettings]
LogoutRedirect=/

[SiteAccessSettings]
CheckValidity=false
AvailableSiteAccessList[]=urgi
AvailableSiteAccessList[]=morgoth
AvailableSiteAccessList[]=urgi_admin
AvailableSiteAccessList[]=eng
AvailableSiteAccessList[]=iphone
MatchOrder=uri;host
HostMatchMapItems[]
HostMatchMapItems[]=urgi.versailles.inra.fr;urgi
HostMatchMapItems[]=morgoth.versailles.inra.fr;morgoth
HForceVirtualHost=true
RemoveSiteAccessIfDefaultAccess=enabled

[RegionalSettings]
TranslationSA[eng]=Eng

[FileSettings]
VarDir=var
CacheDir=cache

[MailSettings]
Transport=sendmail
AdminEmail=veronique.jamilloux@versailles.inra.fr
EmailSender=
ContentType=text/html

[EmbedViewModeSettings]
AvailableViewModes[]=embed
AvailableViewModes[]=embed-inline
InlineViewModes[]=embed-inline

[DebugSettings]
DebugByIP=disabled

[ContentSettings]
ViewCaching=enabled

[TemplateSettings]
TemplateCache=enabled
TemplateCompile=enabled

[SearchSettings]
MinCharacterWildcard=2
*/ ?>
  • There are 3 designs design/morgoth, design/urgi and design/urgi_admin
  • The content tree is :
    • Home (objectId : 2)
      • Home URGI (objectId : 1523) --> in standard section
        • folder1
        • folder2
        • folder3
      • Home Mrogoth(objectId : 1524) --> in standard section
        • folderA
        • folderB

My problem :

  • when I use the url urgi.versailles.inra.fr it's ok I see the URGI home page
  • when I use the url morgoth.versailles.inra.fr I've the 'access denied' error. I need to login to see the morgoth home page.

I don't understand why?

Thank you for your help.

Bye

Véronique

URGI - INRA
Webmaster
Route de Saint Cyr
78000 Versailles

Ivo Lukac

Tuesday 23 August 2011 10:14:29 am

Open /urgi_admin/role/view/1 and check if you have the policy:

user login SiteAccess( morgoth )

If not add it.

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Hamdi Laadhari

Wednesday 24 August 2011 12:49:30 am

As stated above you have first to allow the anonymous user (through his role) to log into that siteacess

Watch your logs, and you'll see something related to "Insufficient policy"

Certified eZ Publish Entreprise 4.5
http://www.laadhari.fr

Veronique Jamilloux

Wednesday 24 August 2011 8:45:52 am

Thank you very much Ivo, I do your solution and the morgoth site access is ok now.

Two more questions :

  • With my new content tree, when I use urgi.versailles.inra.fr/Tools eZpublish rewrite it like urgi.versailles.inra.fr/Home-URGI/Tools. This the same for morgoth.versailles.inra.fr/index.php/Tools eZpublish  rewrite it like morgoth.versailles.inra.fr/index.php/Home-Morgoth/Tools.

How can can I hide the name of the home pages?

  • How can I hide the 'index.php' in the morgoth url? Morgoth is not the default site access?

Thanks again for your help.

Véronique

URGI - INRA
Webmaster
Route de Saint Cyr
78000 Versailles

Ivo Lukac

Wednesday 24 August 2011 9:01:38 am

"

Two more questions :

  • With my new content tree, when I use urgi.versailles.inra.fr/Tools eZpublish rewrite it like urgi.versailles.inra.fr/Home-URGI/Tools. This the same for morgoth.versailles.inra.fr/index.php/Tools eZpublish  rewrite it like morgoth.versailles.inra.fr/index.php/Home-Morgoth/Tools.

How can can I hide the name of the home pages?

  • How can I hide the 'index.php' in the morgoth url? Morgoth is not the default site access?
"

For hiding index.php you need to force virtual host setting, check it here:
http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Configuration-files/site.ini/SiteAccessSettings/ForceVirtualHost
But be careful, you will need to setup different rewrite rules

For hiding root node part of the url use this:
http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Configuration-files/site.ini/SiteAccessSettings/PathPrefix

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Veronique Jamilloux

Wednesday 24 August 2011 10:00:13 am

Thanks again for your help Ivo

Ok for the PathPrefix.

On apache server, my two sites are virtualhost and there are rewrite rules and I've in settings/override.site.ini.append.php RemoveSiteAccessIfDefaultAccess=enabled in the [SiteAccessSettings].

If I put ForceVirtualHost=true I must delete RemoveSiteAccessIfDefaultAccess ?

URGI - INRA
Webmaster
Route de Saint Cyr
78000 Versailles

Ivo Lukac

Wednesday 24 August 2011 10:10:29 am

"

Ok for the PathPrefix.

On apache server, my two sites are virtualhost and there are rewrite rules and I've in settings/override.site.ini.append.php RemoveSiteAccessIfDefaultAccess=enabled in the [SiteAccessSettings].

If I put ForceVirtualHost=true I must delete RemoveSiteAccessIfDefaultAccess ?

"

ForceVirtualHost=true removes /index.php/ but needs rewrites to properly work.

RemoveSiteAccessIfDefaultAccess has nothing to do with ForceVirtualHost, so you can leave it.

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Veronique Jamilloux

Thursday 25 August 2011 1:45:50 am

I do it and the urls are nice.

Thanks and have a nice day

URGI - INRA
Webmaster
Route de Saint Cyr
78000 Versailles

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.