I am going crazy because of this problem ... Become and you get a lot for no reason ...
I have this problem since several months have been circumvented by deleting www .... Noted after several days of normal operation of the website ... But in recent days has become a continuously and, more disturbingly ... when I add new node or edit node ... I normally logged I can add the node and after that I have to log-in again
I have had this problem and prevented me from entering the admin panel until I updated to latest version 6.22 but still happened to me

Regards,

Comments

jolly guy’s picture

Drupal

Come for the software, stay for the community

where is the community???

John_B’s picture

I did not see a question in your first post. However, studying it slowly and carefully you seem to be saying that after you log in, you are automatically logged out every time you save an edit.

The time for which your login stays alive should be set in settings.php.

/**
 * Set session cookie lifetime (in seconds), i.e. the time from the session is
 * created to the cookie expires, i.e. when the browser is expected to discard
 * the cookie. The value 0 means "until the browser is closed".
 */
ini_set('session.cookie_lifetime', 2000000);

If it is not working there may be something wrong with the way your browser or your server is handling cookies. There are several possible problems. For example a badly configured Varnish installation can mess up the server's cookie handling. It could also be a Drupal bug. There are other threads on this topic on drupal.org, you could google for them.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

jolly guy’s picture

the question was how can I fix of this problem :)

I got in my setting.php :-
ini_set('session.cookie_lifetime', 2000000);
ini_set('session.gc_maxlifetime', 200000);

in fact that's happened in many browsers/pcs ...

I install cpnael Varnish in my server what I should I check !
Best Regards,

John_B’s picture

If you have Varnish 3 you are probably having the cookies you need stripped by the vcl (Varnish configuration file). Switch to Varnish 2.1 or sort out your vcl. Where did you get your vcl? Unixy claim their's works well, but who knows, I am sceptical given the problems this has given many of us. Sorting out the vcl is not easy, as this thread shows http://drupal.org/node/1196916
But post 31 there claims to have a solution. I use Varnish 2.1.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

jolly guy’s picture

Unfortunately I installed Varnish Version: 3.0.0-unixy

:(

Thanks for your help

John_B’s picture

It will be interesting to know whether you have luck with that vcl in the thread I linked.

It is also intersting that the Unixy vcl is not working. As I suspected. Since they make a (small) charge for their plugin, you might complain!

I installed Varnish 3 too. But then uninstalled it and installed 2.1. You can do this from the repos, you might even have luck with yum downgrade (assuming you are on centos). If you use Varnish 2.1 find the pressflow vcl file, it works fine.

Short term, simply removing Varnish and putting Apache back on port 80 (in whm you do this under Tweak Settings) will get your site back.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

jolly guy’s picture

In fact I'm not an expert in the installation varnish .. Had tried to install at the outset and failed .. So I bought unixy varnish
running CENTOS 5.7
I tried the link u provided to me but it down ... any way I found this in google http://www.modernfidelity.co.uk/tech/varnish-3-config-pressflow-6x

although I've drupal 6.22 not pressflow ... I will try it later on ;)

jolly guy’s picture

what's the file that I should to edit ?
here is my varnish files :

[/etc/varnish]# ls
./ default.vcl.tpl reseller.exclude.vcl
../ disabled.vcl secret
acllogic.vcl disable.vcl static.ttl.vcl
add.disabled dynamic.ttl.vcl SudaBest-2.sudabest.net_.vsl
backends.vcl dynamic.ttl.vcl.bk SudaBest-2.sudabest.net.vsl
backends.vcl.5.1.2012 dynamic.ttl.vcl.out sudabest.vcl
bigfile.fetch.vcl excluded.disabled unixyvarnish.license
bigfile.recv.vcl excluded.reseller unixyvarnish.version*
cpanel.backend.vcl excluded.url url.exclude.vcl
cpanel.url.vcl excluded.vhost versioning.static.vcl
default.vcl excluded.vhosturl vhost.exclude.vcl
default.vcl.5-1-2012 gzip.off.vcl vhosturl.exclude.vcl
default.vcl.save known.exclude.vcl

jolly guy’s picture

I guess it default.vcl I edit it manually and I failed because the unixy .vlc files are different from standard varnish files

John_B’s picture

You pick which vcl to load when you start varnish either form command line, or by setting it in. In /etc/init.d there should be a varnish file to start varnish, this may point you to the path, but on centos I think it is /etc/sysconfig/varnish . Once you have decided which .vcl to load, edit that one! Or change the .vcl file you are loading on startup to your custom one. The .vcl you have loaded may have includes for other files.

Is the unixy plugin really doing anything for you? If not, you could rip it out, uninstall varnish, and start again....

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

jolly guy’s picture

I think it /etc/varnish/default.vcl because after I edit it the varnish wont start until I restore the original file, in fact unixy varnish do anything and I contact there support but they didn't response until now ...

I'll update you ...

Worm Regards,
M.Aljaaly

John_B’s picture

When varnish fails to start that is because there is a syntax error in the vcl. If you find the folder where the varnish binary is and try to start it just by running the path e.g. friom the folder where the binary is run ./varnishd it will output debugging errors telling you where you have made a mistake in your vcl.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

jolly guy’s picture

after I turned off drupal cash ... I can log in normally and the issue was solved

John_B’s picture

Good. Is varnish caching pages for anonymous now? Or is it just sitting there doing nothing?

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

jolly guy’s picture

I think varnish running too anonymous and users

Best Regards,

John_B’s picture

Sure it is running (or your site would be dead!). But I suspect not caching the full pages for anonymous users, so not helping you as much as it should. But hey, maybe you have had enough trouble with it.... it is is working probably best leave alone. It should still help by increasing speed of serving static resources.

In case you want to chase this up further, if you install the Varnish module for Drupal you can get statistics about number of hits. Or just log in to server with command line and type varnishstat
You can read the number of cache hits and cache misses.

Some vcl files add a line to the headers which show X-Cache hit or miss for each page load, so checking the headers in Firebug (Net tab) also gives a guide to how successful caching is, if you have that header set up.

If you check this be sure to clear browser cache after logging out, or the session cookies will stop Varnish caching even when you are logged out.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

jolly guy’s picture

2290305 52.96 24.77 cache_hit - Cache hits
28 0.00 0.00 cache_hitpass - Cache hits for pass
691453 6.99 7.48 cache_miss - Cache misses

I think it did not work probably the site open slowly :(
BTW, the users only the admin who updated the website content
Regards,

John_B’s picture

Looks like you are getting plenty cache hits. The numbers at the top which you do not report are the ratio of hits to misses. So everything is OK. To be sure you might restart Varnish (which clears caches and and stats) and reload your site a few times, logged out, and see whether the hit rate is climbing.

You can actally log in with command line in one window, get a small browser window beside it, and watch the numbers change as you reload. Use varnishlog to see the full details of requests coming in.

It will not cache full pages for logged in users. With ESI it will cache blocks. Probably not worth the trouble, I never got the Drupal 7 ESI API working.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

jolly guy’s picture

Hitrate ratio: 6 6 6
Hitrate avg: 0.8423 0.8423 0.8423

1434082 20.00 15.00 client_conn - Client connections accepted
3115506 45.00 32.58 client_req - Client requests received
2410619 33.00 25.21 cache_hit - Cache hits
28 0.00 0.00 cache_hitpass - Cache hits for pass
723217 12.00 7.56 cache_miss - Cache misses

====================================================================
after i restart varnish (2 min.)
Hitrate ratio: 10 82 82
Hitrate avg: 0.7926 0.7349 0.7349

2058 25.00 23.12 client_conn - Client connections accepted
4496 37.00 50.52 client_req - Client requests received
3207 31.00 36.03 cache_hit - Cache hits
1275 6.00 14.33 cache_miss - Cache misses

====================================================================

Do you recommend activating the Drupal Cache .. Or leave the site works without it, Please check the site out : goansport.net/new
and feed me back :)
Worm Regards,

John_B’s picture

You are doing pretty well there. I would be satisfied! However, it is not clear whether these figures relate to caching of various files such as images and css or if you are succeed in caching the entire page. For this you might need to look at the page headers in Firebug for example. Look for the X-Cache (not the X-Drupal-Cache) header.

If the Drupal cache is set to use Varnish, via the Drupal Varnish module (which involves setting Drupal's cache to use Varnish in settings.php), my understanding is that the Drupal 'cache pages for anonymous users' should normally be on. OTH if you have successfully got Varnish caching the entire page for anonymous users the request will never reach Drupal, AFAIK, so it may not matter.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

jolly guy’s picture

I could not find X-Cache at all,
When I install unixy varnish for the first time ... Support team advised me to disable varnish Drupal model.

I did not got what I should to do with settings.php I didn't change anything ... Suddenly discovered I can not log-out, when I click log-out drupal redirect me to the home page ...

John_B’s picture

OK if you are not using Drupal module do not touch settings.php except as advised by Unixy. I am a bit in the dark here as I have no experience of the Unixy plugin, though I have worked with Varnish.

I mean normally, with Pressflow on Drupal 6 (even without this module), you would go to settings.php, and make certain changes http://drupal.org/project/varnish. In particular you would add the line

$conf['page_cache_invoke_hooks'] = FALSE;

Then you may have to set / uncomment

§conf['reverse_proxy'] = TRUE;

My experience was that this last step was NOT needed with the Varnish module, and broke the site.

And with Pressflow 6, you would have to add the IP address of your server in the line for reverse proxy array, again in settings.php.

However, frankly as I said, I never got Varnish 3 working (and there were many others struggling) so it is hard to advise. You really need to fall back on Unixy support. I have been successful getting Varnish 2 and Varnish 2.1 working.

As for the header, if you want this, do the following. Find out which .vcl file is loaded. If you run command
ps aux | grep varnishd
the output should show you.
Go to the file. According to https://www.varnish-cache.org/trac/wiki/VCLExampleHitMissHeader add

sub vcl_deliver {
        if (obj.hits > 0) {
                set resp.http.X-Cache = "HIT";
        } else {
                set resp.http.X-Cache = "MISS";
        }
}

(or just add the code between the curly brackets, if you already have a sub vcl_deliver block in your .vcl).

Now restart varnish. If it fails to restart you have a syntax error. Now the headers as shown in Firebug for example should output an X-Cache line and tell you whether a downloaded file was called from the cache. If you get your main page called from the cache when viewed by anonymous users (remember to clear your browser cookies cache so you really look anonymous!), that is what you really want.

BTW once you have found the loaded .vcl file supplied by Unixy it would be really interesting to see it, if you feel like posting it.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

John_B’s picture

this is interesting http://vbtechsupport.com/33/

If the info is up to date, it shows that the Unixy approach to caching is not to cache a page and serve the same page to all anonymous users, provided it has not been changed. This is what is normally with done with Varnish on a Drual site. By contrast the Unixy approach is to create a short-lived cache for each individual user (assuming you are using the .vcl supplied by Unixy).

This will cut you potential maximum preformance, but provided it does not break your Drupal site (?) Varnish, even with this confiuration, has to be well worth having, and probably all you need unless you are running a high traffic site.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

jolly guy’s picture

a sorry for late response ...

unixy support can't help me and they didn't response to my ticket at all ... I sent you something in your e-mail please check it ...
the issue still faced me and they didn't response at all ....

regards,

Ayesh’s picture

Nothing interesting here.