Forums / Install & configuration / host access method not working

host access method not working

Author Message

fintan sheehan

Thursday 21 September 2006 6:12:32 am

Hello,
I changed my settings/override/site.ini.append.php to below so

http://mysite.degrees.com would point to what was previously
http://mysite.degrees.com/index.php/corporate_site
and
http://admin.mysite.degrees.com would point to what was previously
http://mysite.degrees.com/index.php/corporate_site_admin

However http://mysite.degrees.com works ok but
http://admin.mysite.degrees.com does not

In fact http://admin.mysite.degrees.com is just bringing up same site as http://mysite.degrees.com so I cant access admin site.

Is there anyway of clearing cache. I tried sh clearcache.sh --clear-all but it had no effect.

[SiteAccessSettings]
CheckValidity=false
AvailableSiteAccessList[]=corporate_site
AvailableSiteAccessList[]=corporate_site_admin
MatchOrder=host
HostMatchMapItems[]=mysite.degrees.com;corporate_site
HostMatchMapItems[]=www.mysite.degrees.com;corporate_site
HostMatchMapItems[]=admin.mysite.degrees.com;corporate_site_admin
ForceVirtualHost=true
HostMatchType=map
RelatedSiteAccessList[]=corporate_site
RelatedSiteAccessList[]=corporate_site_admin

httpd.conf settings are

ServerAlias admin.mysite.degrees.com
ServerAlias mysite.54degrees.com
DocumentRoot /home/mysite/public_html
ErrorLog /home/mysite/logs/error_log
..
<Directory /home/mysite/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>

Any help appreciated. Even setting settings/override/site.ini.append.php back to
[SiteAccessSettings]
CheckValidity=false
AvailableSiteAccessList[]=corporate_site
AvailableSiteAccessList[]=corporate_site_admin
MatchOrder=uri
HostMatchMapItems[]
RelatedSiteAccessList[]=corporate_site
RelatedSiteAccessList[]=corporate_site_admin

would be progress if there was some way of clearing cache.

Thanks

Tony Wood

Thursday 21 September 2006 9:28:37 am

Hi

This is a great question.

You can clear cache using clearcache --clear-all from cli, but if you do not trust it for sometimes for permission reasons this does not work you can go into the project roo/var/[design]/cache and trash the directory tree. Be care not to delete the storage files as this is where eZ stores all you site files and images. I have done that before and you need a good backup :)

I tend to tarball the entire vat directoy before I start playing around... just in case

Tony

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

fintan sheehan

Thursday 21 September 2006 10:45:59 am

Thanks,
I've progressed problem to below.

If DefaultAccess=corporate_site in override/site.ini.append.php below then
http://mysite.degrees.com and http://mysite.degrees.com both bring up what used to be
http://mysite.degrees.com/index.php/corporate_site

If DefaultAccess changed to corporate_site_admin below then
http://mysite.degrees.com and http://mysite.degrees.com both bring up what used to be
http://mysite.degrees.com/index.php/corporate_site_admin

Do i need to make any changes to settings/siteaccess/corporate_site/site.ini.append.php
and
Do i need to make any changes to settings/siteaccess/corporate_site_admin/site.ini.append.php
?

Below are changed I made to settings/override/site.ini.append.php

Thanks
Fintan

[SiteSettings]
DefaultAccess=corporate_site
SiteList[]=corporate_site
SiteList[]=corporate_site_admin

[SiteAccessSettings] 
CheckValidity=false 
AvailableSiteAccessList[]=corporate_site 
AvailableSiteAccessList[]=corporate_site_admin 
MatchOrder=host 
HostMatchMapItems[]=mysite.degrees.com;corporate_site 
HostMatchMapItems[]=admin.mysite.degrees.com;corporate_site_admin
ForceVirtualHost=true 
HostMatchType=map 

Claudia Kosny

Friday 22 September 2006 1:56:27 am

Hello Fintan Sheehan

This looks like the hostmatching does not take place at all. Are you sure that your virtual host is set up correctly. I have no clue about virtual host as I have never used it. In the article about hostmatching it is stated that nthe webserver must be configured correctly before the mapping will work
(http://ez.no/doc/ez_publish/technical_manual/3_8/concepts_and_basics/configuration/access_methods )

Depending on how good your PHP is I would also check the file access.php which seems to be responsible for matching site acesses to urls. maybe you can find out here what is actually going wrong.

Greetings from Luxembourg

Claudia

fintan sheehan

Friday 22 September 2006 2:23:29 am

Thanks Claudia,

I think u are right. Hostmatching isnt happening. Both subdomains work ok so I think there may be a problem with access.php

My <i>settings/override/site.ini.append.php</i> had

[SiteSettings]
DefaultAccess=corporate_site

which meant default site was working for user and admin sites. When I removed
DefaultAccess=corporate_site I was getting database error.

It looks like <i>settings/siteaccess/corporate_site/site.ini.append.php</i> and <i>settings/siteaccess/corporate_site_admin/site.ini.append.php</i> are not being accessed at all as database connections are kept in both these files. When I put database stuff in
<i>settings/override/site.ini.append.php</i> connection worked ok but hostmapping dosent.

Regards,
Fintan

Claudia Kosny

Friday 22 September 2006 3:55:24 pm

Hello Fintan

Do you get any messages in the debug output which might be related to the problem?
If not this looks like the all so exciting examination of the access.php is necessary. Unless someone else steps in and knows a bit more about what might be the problem... Fortunately the access.php is pretty well structured so you need to check only a few lines (almost at the beginning to check for the matchorder and then in the long switch check for the entry for 'map'). If you have any problems with doing that tell me and I'll try to help.

Greetings from Luxembourg

Claudia

fintan sheehan

Friday 22 September 2006 11:22:54 pm

Thanks Claudia,
Im debugging access.php.I removed

[SiteSettings]  
#DefaultAccess=corporate_site

Currently can get admin site up but user site has a db connection error so will keep debugging.

Thanks for your help,
Fintan

fintan sheehan

Monday 25 September 2006 5:41:09 am

Hi,
solved problem in end. Spaces after host and corporate_site in site.ini.append.php below were causing problem. Neither index.php or access.php trims incomming variables.

MatchOrder=host
HostMatchMapItems[]=mysite.degrees.com;corporate_site
HostMatchMapItems[]=admin.mysite.degrees.com;corporate_site_admin

Thanks for your help,
Fintan

Claudia Kosny

Monday 25 September 2006 9:23:04 am

Congratulations - good to see that you solved this. Looking for spaces will now go on my internal debug list...

Claudia

A Fowler

Thursday 04 June 2009 10:20:53 pm

I am having the exact same problem described in this post, but I have double checked settings/override/site.ini.append.php for spaces at the end of the line and found none.

Any other avenues to pursue to solve this?

A Fowler

Thursday 04 June 2009 10:33:38 pm

I figured out what was wrong, also by putting some test output statements in access.php.

Basically, I am using a non-standard port which is included in the URL. In access.php, the domain name PLUS the port is stored in $host, as "domain.com:port". This is compared against the first value in each of the HostMatchMapItems[]. I had to modify the HostMatchMapItems[] entries to include the port as well as the domain name.

For example:

MatchOrder=host
HostMatchType=map
HostMatchMapItems[]=mydomain.com:1234;mysite
HostMatchMapItems[]=iphone.mydomain.com:1234;iphone
HostMatchMapItems[]=admin.mydomain.com:1234;mysite_admin