Skip to main content

linux - How can I get my mediawiki to stop thinking I have cookies disabled?



I've searched half a day for how to resolve this issue, and can't figure it out. Shortly after I made my wiki a simple private wiki according to the instructions at Mediawiki's website, it started giving me this weird login error message: Wiki uses cookies to log in users. You have cookies disabled. Please enable them and try again.



If I remove those private wiki settings, the error disappears, even if I try logging in. But I need it to be a private wiki for only my team. So what do I do?



Here's what I've done so far. Just to be safe, after ever change, I try rebooting Apache using:





  • sudo /etc/init.d/apache2 restart



In my php.ini file, I have the following set:




  • session.save_path = "/var/lib/php5"

  • session.cookie_secure = secure

  • session.cookie_path = /tmp session.cookie_domain = my server's internal URL (should I even set this? this field was blank before, but not commented out)


  • session.referer_check = Off



I ran the following to ensure that the folders are writable:




  • sudo chmod -R 1777 /var/lib/php5

  • sudo chmod -R 1777 /tmp




In my LocalSettings.php file, I have the following added to the bottom of the settings file:




  • session_save_path("tmp");

  • $wgSessionsInObjectCache = true;

  • $wgMainCacheType = CACHE_ANYTHING;

  • $wgDebugToolbar = true;

  • $wgDebugLogFile='/var/log/mediawiki/mediawiki.log';

  • $wgShowExceptionDetails = true;

  • $wgShowDebug = true;


  • $wgDevelopmentWarnings = true;



For the above tmp, I created the folder /etc/mediawiki/tmp and also ran the following:




  • sudo chmod -R 1777 /etc/mediawiki/tmp



I know that the cookie is coming through to the browser because I can see the cookie in Firebug and verify that the same cookie got created in the /tmp folder.




SSL seems to be configured properly, because I get the green lock.



This is my debug output after trying to log in:




Debug data:




  • Start request



  • POST /mediawiki/index.php?title=Special:UserLogin&action=submitlogin&type=login&returnto=Special:RecentChanges


  • HTTP HEADERS:

  • HOST: bs-wiki.sis.org.cn

  • CONNECTION: keep-alive

  • CONTENT-LENGTH: 122

  • CACHE-CONTROL: max-age=0

  • ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8

  • ORIGIN: https://bs-wiki.sis.org.cn

  • UPGRADE-INSECURE-REQUESTS: 1

  • USER-AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36


  • CONTENT-TYPE: application/x-www-form-urlencoded

  • DNT: 1

  • REFERER: https://bs-wiki.sis.org.cn/mediawiki/index.php?title=Special:UserLogin&returnto=Special%3ARecentChanges&returntoquery=

  • ACCEPT-ENCODING: gzip, deflate

  • ACCEPT-LANGUAGE: en-US,en;q=0.8

  • COOKIE: __gads=ID=f46767e352615a06:T=1453974579:S=ALNI_MaImAtsIj8Xb-3kERZtmSWx82DxNA; bs_wikiUserName=Rpark1; bs_wikiLoggedOut=20160128105049; bs_wiki_session=3fck92pn1uq1l1s852oq6rfdl3


  • CACHES: SqlBagOStuff[main] SqlBagOStuff[message] SqlBagOStuff[parser]


  • Connecting to localhost bs_wiki...

  • Profiler::instance called without $wgProfiler['class'] set, falling back to ProfilerStub for safety

  • Connected to localhost bs_wiki.


  • Connecting to localhost bs_wiki...

  • Connected to localhost bs_wiki.

  • DatabaseBase::query: Writes done: DELETE FROM objectcache WHERE keyname = 'bs_wiki:stats:request_with_session'

  • LocalisationCache: using store LCStore_DB

  • Unstubbing $wgParser on call of $wgParser::setFunctionHook from unknown

  • Parser: using preprocessor: Preprocessor_DOM

  • Fully initialised

  • Unstubbing $wgAuth on call of $wgAuth::validDomain from unknown

  • IP: 172.18.12.59

  • MessageCache::load: Loading en... got from global cache


  • Unstubbing $wgLang on call of $wgLang::_unstub from unknown

  • MWCryptRand::realGenerate: Generating cryptographic random bytes for LoginForm::setLoginToken/MWCryptRand::generateHex/MWCryptRand::realGenerateHex/MWCryptRand::generate/MWCryptRand::realGenerate

  • MWCryptRand::realGenerate: openssl_random_pseudo_bytes generated 16
    bytes of strong randomness.

  • MWCryptRand::realGenerate: 0 bytes of
    randomness leftover in the buffer.

  • Class SkinVector not found; skipped loading

  • Class PEAR_Error not found; skipped loading




Answer



No idea why it works now, but started from scratch and went back to the original instructions at https://www.mediawiki.org/wiki/Manual:Preventing_access#Simple_private_wiki and now it works.



Well, not completely from scratch, I didn't revert my changes to php.ini. So not sure whether or not that fixed it. Either way, it's working now, and so I'm happy.... :)


Comments

Popular posts from this blog

iLO 3 Firmware Update (HP Proliant DL380 G7)

The iLO web interface allows me to upload a .bin file ( Obtain the firmware image (.bin) file from the Online ROM Flash Component for HP Integrated Lights-Out. ) The iLO web interface redirects me to a page in the HP support website ( http://www.hp.com/go/iLO ) where I am supposed to find this .bin firmware, but no luck for me. The support website is a mess and very slow, badly categorized and generally unusable. Where can I find this .bin file? The only related link I am able to find asks me about my server operating system (what does this have to do with the iLO?!) and lets me download an .iso with no .bin file And also a related question: what is the latest iLO 3 version? (for Proliant DL380 G7, not sure if the iLO is tied to the server model)

linux - Awstats - outputting stats for merged Access_logs only producing stats for one server's log

I've been attempting this for two weeks and I've accessed countless number of sites on this issue and it seems there is something I'm not getting here and I'm at a lost. I manged to figure out how to merge logs from two servers together. (Taking care to only merge the matching domains together) The logs from the first server span from 15 Dec 2012 to 8 April 2014 The logs from the second server span from 2 Mar 2014 to 9 April 2014 I was able to successfully merge them using the logresolvemerge.pl script simply enermerating each log and > out_putting_it_to_file Looking at the two logs from each server the format seems exactly the same. The problem I'm having is producing the stats page for the logs. The command I've boiled it down to is /usr/share/awstats/tools/awstats_buildstaticpages.pl -configdir=/home/User/Documents/conf/ -config=example.com awstatsprog=/usr/share/awstats/wwwroot/cgi-bin/awstats.pl dir=/home/User/Documents/parced -month=all -year=all...