Topic on Project:Support desk

Jump to navigation Jump to search

Embedding a locally hosted media wiki

11 (talkcontribs)
Bawolff (talkcontribs)

refused to connect error sounds like your web server is down. Does the wiki work in general (without trying to do any framing stuff)? (talkcontribs)


Yes it is up and running.

Ciencia Al Poder (talkcontribs)

Check if you have $wgBreakFrames set to true. Apparently the default is false, so if you don't find this setting in LocalSettings.php this shouldn't be the problem.

On the page where this happens, open the developer console of your browser (by hitting F12) and see if the console reports an error like content not displayed due to X-Frame-Options or similar. (talkcontribs)

Thank you for the suggestion, but it is already done. The last three lines of the LocalSettings.php file are:

$wgEditPageFrameOptions = false;

$wgBreakFrames = false;

$wgEditPageFrameOptions = "SAMEORIGIN";

And yes in the console we get the exact error that you did write above:

29264:1 Refused to display ***' in a frame because it set 'X-Frame-Options' to 'deny'.

One more question do we talk about LocalSettings.php file located in:



Ciencia Al Poder (talkcontribs)

Yes, LocalSettings.php from the root directory of MediaWiki.

Do you want to embed a normal page or a special page? A special action like action=render? Please give all details you can.

Also check if your hosting is adding the X-Frame-Options header, maybe by uploading a simple html page and seeing if it serves the page with that header. (talkcontribs)

It is not a special page, it is normal one, but there is something new that I have found: that Chrome after 57 version does not support x-frame at all. Still it is possible may be to use Mozilla, but...

What we exactly want to do is : to embed link into Shotgun (production software) page. Also i think that may be $wgEditPageFrameOptions = "SAMEORIGIN"; it is not correct as well since shotgun page is on another domain and our wiki is local , and it goes through proxy and stuff...

Ciencia Al Poder (talkcontribs)

But $wgEditPageFrameOptions only affect pages in edit mode, not view. I assume you only want your app to display pages in view mode and not edit.

Bawolff (talkcontribs)

yes, if the pages are on different domains, than SAMEORIGIN won't work. Typically EditPageFrameOptions only applies to SpecialPages, edit pages, and pages that are currently subject to page patrolling - but not normal page views. You can set it to false to disable the clickjacking prevention entirely if you want.

Can you be exactly specific about what you mean by wiki local, proxied. e.g. what is the url of the frame and what is the url of the document containing the frame? If you mean the wiki is on localhost, perhaps some browsers forbid framing documents from localhost on a non local domain (I have no idea, just a guess) (talkcontribs)

An example: we have locally hosted wiki. The web page where we want to embed the wiki pages is on * (which is accessed by proxy which is the only way to access external resources since for normal browsing and internet we use terminal servers that are separated from the prod environment). It is strange that we do not get different error now than the one: Refused to display ***' in a frame because it set 'X-Frame-Options' to 'deny'.

I did try to put $wgEditPageFrameOptions to false on the LocalSettings.php file in the root wiki directory but it did not work either. I was curious if something like that should be considered to be done in the apache2 configuration or another place/file that I am missing.

Ciencia Al Poder (talkcontribs)

X-Frame-Options is an http header, and as such, it may be added by the webserver if you (or your company) have configured it to do so. Some security audits recommend to add this header, so it may be very well the case that there's a rule on your webserver adding that header on the wiki website.

Reply to "Embedding a locally hosted media wiki"