What are the steps to move a MediaWiki website? - mysql

I am trying to move MediaWiki websites from Windows Server 2003 (IIS 6) to Windows Server 2008 R2 (IIS 7.5). I installed the same version of MediaWiki to the destination server in order to avoid conflict. I dumped, move and restore the MySQL database; zip, move and restore the MediaWiki files which includes the images, LocalSettings.php files for each MediaWiki website.
I can't browse the websites now, I believe I need to do something else but I am not sure. I am totally new to MediaWiki. Any help appreciated.
Thanks in advance.
$wiki_name = substr($_SERVER["REQUEST_URI"], 1, strpos($_SERVER["REQUEST_URI"], "/", 1) - 1);
$wgScriptPath = "/${wiki_name}";
$wgLogo = "images_${wiki_name}/${wiki_name}_logo.gif";
$wgUploadPath = "$wgScriptPath/images_${wiki_name}";
$wgUploadDirectory = "$IP/images_${wiki_name}";
require_once("LocalSettings.${wiki_name}.php");
unset($wiki_name);
LocalSettings.php has above section which has a purpose of using multiple mediawiki websites. And each LocalSettings.website.php files have section below:
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "database";
$wgDBuser = "user";
$wgDBpassword = "password";
in order to identify which database is used by each website.
This is the picture I got when I browsed the MediaWiki wiki through IIS.
And from server log I got the following:
#Date: 2014-10-06 19:42:17
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
2014-10-06 19:42:17 ::1 GET /mediawiki - 80 - ::1 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET4.0C;+.NET4.0E) 301 0 0 265
2014-10-06 19:42:17 ::1 GET /mediawiki/ - 80 - ::1 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET4.0C;+.NET4.0E) 200 0 0 78

Which version do you use? AdminSettings.php was removed in MW 1.16, so you should consider to upgrading your wiki, this as a side note :)
You said, you have installed a new version of MediaWiki? Are there all files on your server? (Check the list from github e.g. https://github.com/wikimedia/mediawiki-core/tree/REL1_16).
Best!

The problem was about IIS declaration of virtual directory. And additionally needed to add index.asp and index.php files as default document through IIS.
Cheers!

Related

Samba server does not show all folder/files unless few are deleted

I have Samba 4.14.5 installed on RHEL8.
If I create a few subfolders and then create say 500 files/folders there , about 350 show up. But all can be accessed if I give the complete adress in the windows
explorer.
If I create 350, then all show up. If I create the 351st
folder, then one gets ramdomly invisible but it can be accessed if I
give the complete address in the windows explorer.
If I delete the 351st dir, then the other 350 show up correctly.
If I create another subfolder, maybe 200 will show up, so this is ramdom.
The servers is an EC2 instance and the mount is an EFS.
Config in samba.conf
[global]
realm = SAMPLE.ORG
workgroup = EXAM
security = ads
kerberos method = secrets and keytab
template homedir = /home/%U
idmap config * : backend = tdb
idmap config * : range = 10000-199999
idmap config EXAM : backend = sss
idmap config EXAM : range = 200000-2147483647
load printers = no
machine password timeout = 0
log level = 4
[data-robo]
comment = AWS EFS share drive
browseable = Yes
read only = No
write list = #group1,#group2
public = No
path = /data/robo2
valid users = #group1,#group2
force directory mode = 777
Thanks,
Just adding I see this same behavior with a CentOS 8 Stream samba 4.16.4 server sharing NFS mounts from a VAST appliance. I do not see it when sharing an NFS mount from another CentOS 8 Stream box. I also do not see it when sharing the VAST NFS mounts on a CentOS7 samba server running 4.10.16.
So the solution for us for now is to share the VAST NFS mounts only from a CentOS7 samba server. I assume the same would be true for EFS

lighttpd 1.4.X - Error with reverse proxy - returns 0 byte - config or program error?

I have a setup where i need a proxy in front on a server.
LightTpd 1.4.13 is already used on the embedded platform which should act as proxy.
Newer lighttpd's is not easily build due to an old toolchain.
One port (e.g. port 84) of the proxy platform should forward all traffic to port 80 on the server.
Some simple pages are forwarded just fine, but some other fail. The server has as "web_resp.exe", this is returned as a download option of 0 byte.
Wireshark dumping
Dumps with Wireshark show that the needed pages are send the proxy-platform, but 0 bytes are forwarded. (this was performed on a similar setup)
Question
Is my configuration wrong?
Is it impossible on lighttpd 1.4.13? (i have seen forum-post telling the mod_proxy of lighttpd has problem in general)
Reproducibility
I have reproduced the flaw by running Lighttpd on a new mintLinux (same error type)
I get the same error when forwarding to other ip/site (a web-config of a ethernet -> rs232-port unit).
Exactly what triggers the error is do not know, maybee just too large pages.
Configuration
#lighttpd configuration file
server.modules = (
"mod_proxy"
)
## a static document-root, for virtual-hosting take look at the
## server.virtual-* options
server.document-root = "/tmp/"
## where to send error-messages to
server.errorlog = "/tmp/lighttpd.error.log"
## bind to port (default: 80)
server.port = 84
#### proxy module
## read proxy.txt for more info
proxy.debug = 1
proxy.server = ( "" =>
(
( "host" => "10.0.0.175", "port" => 80)
)
)
Debug dumps
functional and non-functional request seem similar.
However the non-functional read larger size of data (it is still to considered small size <100 kB)
other tests
lighttpd 1.4.35 compiled for the target, but it seem to fail in same way.
lighttpd 1.4.35 neither work on the mintLinux.
1.4.35 + rewrite trick...
works worse than directly using a port
lighttpd 1.5 works out of the box (after installing gthread2) on a mintLinux. However will not work for the target hardware.
The issue have been found to be faulty http headers provided by the backend.
The issue was submitted to the Lighttpd-bug site https://redmine.lighttpd.net/issues/2594#change-8877
Lighttpd now have support for webpages only sending \LF as opposed to \CR\LF
You may argue that the bug is in the target web-page. However in by case i was unable to modify the target site.

Editing php.ini to allow certain features

Okay, so I've been testing and building a website on my computer through localhost. Everything works fine on my computer! I wanted to then upload it to my godaddy hosting account. Then I get an error. I am using json_decode as an argument for one of for each loops in my php. When I'm running my site through a hosting provider it tells me there is an invalid argument in the foreach() loop on like 43. So, I knew it had to do with my php.ini file, so I copied the one from my computer and pasted it in the php.ini file on godaddy, for my site. Then the foreach() loop worked! But, then all kinds of hell broke loose. Session problems and such. So, my question is, what do I need to add to make json_decode work?
Thanks
Here is my php.ini file with the hosting provider:
register_globals = off
allow_url_fopen = off
expose_php = Off
max_input_time = 60
variables_order = "EGPCS"
extension_dir = ./
extension=json.so
upload_tmp_dir = /tmp
precision = 12
SMTP = relay-hosting.secureserver.net
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
; Only uncomment zend optimizer lines if your application requires Zend Optimizer
support
;[Zend]
;zend_optimizer.optimization_level=15
;zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
;zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
;zend_extension=/usr/local/Zend/lib/Optimizer-3.3.3/ZendExtensionManager.so
;zend_extension_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3/ZendExtensionManager_TS.so
; -- Be very careful to not to disable a function which might be needed!
; -- Uncomment the following lines to increase the security of your PHP site.
;disable_functions = "highlight_file,ini_alter,ini_restore,openlog,passthru,
; phpinfo, exec, system, dl, fsockopen, set_time_limit,
;
You cant just replace the php.ini file because it has paths hard coded.
For example, with your session error, most likely the setting session.save_path is referencing a directory that doesn't exist or incorrect permissions.
Can you post the line of code that was on line 43? I am guessing that your local php.ini doesn't display the error whereas the godaddy config does.

Authenticate/Authorize user based on group with apache and mysql

I am trying to get authorization to work on my apache installation. I want to authorize depending on what group the user belongs to.
I am using
Apache 2.2.15
Centos 6.2 (Running as guest in VB)
My setup is working if I only want to authenticate/authorize based on the user.
Here is the significant part (I think...) of my httpd.conf:
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
AuthType Basic
AuthName "Restricted Files"
AuthBasicProvider dbd
Require dbd-group 1
Require valid-user
AuthzDBDQuery "SELECT group_id FROM groupsusers JOIN user ON groupsusers.user_id = user.id WHERE groupsusers.group_id = 1 AND user.users = %s"
AuthDBDUserPWQuery "SELECT password FROM user WHERE users = %s"
</Directory
AuthzDBDQuery doesn't work since, as I understand it, it is not part of any stable version yet. This is the error message I get while starting httpd:
Invalid command 'AuthzDBDQuery', perhaps misspelled or defined by a module not included in the server configuration httpd not running, trying to start
My question is, how can I use groups for authorization when using mysql for storing the groups? I guess it must be possible without re-compiling apache?
Since everything around this is pretty poor documented it would be greate to get some detailed instructions. Of course, anything that can help me in the rigth direction is appreciated.
Thanks!
I think it is not possible at this stage. I think it will come support for this in the next stable version of httpd.
The problem was solved after I enabled authz_dbd mod in apache 2.4.

Wordpress ==> SSL ==> MySQL is this configuration possible?

I am trying to put SSL encryption between my Wordpress application and its MySQL database, is anyone aware of a solution/tutorial for this? Haven't managed to find anything on Google or the Wordpress codex.
Further to #ticoombs response, and after some digging / testing, I found that by changing the constant defined in wp-config.php (in the root directory) to the following it worked!
define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);
...note the extra "I" in MYSQLI_CLIENT_SSl.
Symptoms: The symptom I observed was that the call to mysql_connect in /wp-includes/wp-db.php was generating a warning that parameter 8 (i.e. $client_flags) was not an integer.
Version: Vanilla install of 4.8.1, running on php 7.0
Yes. It is possible to connect Wordpress to mysql using SSL. Add define('DB_SSL', true); to your wp-config.php file and take a look at this:
http://wordpress.org/support/topic/wordpress-with-mysql-over-ssl
Just to build on the answer:
File Location: /wordpress/wp-includes/wp-db.php
From:
$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;
To:
$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : MYSQL_CLIENT_SSL;
Currently WP should be able to handle adding, (below) to the wp-config.php. (But in my findings i have not been able to get it to work.
define('MYSQL_CLIENT_FLAGS', MYSQL_CLIENT_SSl);
I wrote a good blog post on the matter.
Source