کاربر:Admin/صفحه تمرین/ابونتو

از ویکی کد
پرش به ناوبری پرش به جستجو

آموزش برای تنظیم و پیکربندی VMware[۱]

LocalSettings.php

ini.php

Tools.php

nginx default

GUI

Article tools

محتویات

موارد نیاز برای نصب و پیکربندی ابونتو ۱۸٫۰۴

 1 sudo aptitude update && sudo aptitude upgrade -y
 2 
 3 sudo add-apt-repository main
 4 sudo add-apt-repository universe
 5 sudo add-apt-repository restricted
 6 sudo add-apt-repository multiverse
 7 
 8 sudo aptitude update && sudo aptitude upgrade -y
 9 
10 sudo apt install apt-transport-https -y

سیستم را ریبوت کنید


  • برای یافتن آی دی لوکال هاست:
ip a
ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'

نصب و پیکربندی Nginx و Php-fpm

18 sudo aptitude update && sudo aptitude upgrade -y
19 sudo apt-get install nginx php7.2-fpm -y

نکته: اگر تمایل دارید آخرین نسخه php را دریافت کنید بجای php7.2-fpm بنویسید php-fpm. من در این آموزش از نسخه 7.2 استفاده کردم.

تست عملکرد nginx:

  • وضیعت وب سرور Nginx:
sudo systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2016-04-18 16:14:00 EDT; 4min 2s ago
 Main PID: 12857 (nginx)
   CGroup: /system.slice/nginx.service
           ├─12857 nginx: master process /usr/sbin/nginx -g daemon on; master_process on
           └─12858 nginx: worker process

با زدن کلید ترکیبی C و Ctrl از محیط خارج شوید.

  • راه اندازی وب سرور Nginx:
sudo systemctl start nginx.service
  • فعال کردن وب سرور Nginx در هنگام بوت:
sudo systemctl enabled nginx.service

تست عملکرد سرویس php-fpm:

  • وضیعت وب سرور php-fpm:
sudo systemctl status php7.2-fpm.service

با زدن کلید ترکیبی C و Ctrl از محیط خارج شوید.

  • راه اندازی وب سرور php-fpm:
sudo systemctl start php7.2-fpm.service
  • فعال کردن وب سرور php-fpm در هنگام بوت:
sudo systemctl enabled php7.2-fpm.service

کانفیگ nginx:

20 sudo nano /etc/nginx/sites-available/mediawiki


 1 server {
 2 	listen 80;
 3 	listen [::];
 4 	root /var/www/html;
 5 	server_name wiki-programming.ir;
 6 	
 7 	client_max_body_size 100M;
 8 	client_header_timeout 3000;
 9 	client_body_timeout 3000;
10 	fastcgi_read_timeout 3000;
11 	fastcgi_buffers 8 128k;
12 	index /w/index.php;
13 	gzip on;
14 	fastcgi_buffer_size 128k;
15 	
16 	location /w {
17 		try_files $uri $uri/ @rewrite;
18 	}
19 
20 	location @rewrite {
21 		rewrite ^/wiki(.*)$ /w/index.php?title=$1&$args;
22 	}
23 
24 	location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
25 		try_files $uri /w/index.php;
26 		expires max;
27 		log_not_found off;
28 	}
29 
30 	location /w/dumps {
31 		root /var/www/html/w/local;
32 		autoindex on;
33 	}
34 	
35 	location /w/images {
36 	# Separate location for images/ so .php execution won't apply
37 	}
38 	
39 	location /w/images/deleted {
40 	# Deny access to deleted images folder
41 		deny	all;
42 	}
43 	
44 	# Deny access to folders MediaWiki has a .htaccess deny in
45 	location /w/cache { deny all; }
46 	location /w/languages { deny all; }
47 	location /w/maintenance { deny all; }
48 	location /w/serialized { deny all; }
49 		
50 	# Just in case, hide .svn and .git too
51     location ~ /w.(svn|git)(/|$) { deny all; }
52 			
53 	# Hide any .htaccess files
54     location ~ /w/.ht { deny all; }
55 	
56 	# Uncomment the following code if you wish to hide the installer/updater
57 	## Deny access to the installer
58 	location /w/mw-config { deny all; }
59     
60 	location ~ \.php$ {
61 		include snippets/fastcgi-php.conf;
62 		fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
63 		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
64 		include fastcgi_params;
65 	}
66 }
  • بعد از تنظیم سایت خود طبق آموزش بالا، با دستورهای زیر، آن را فعال کنید و سپس برای بارگذاری تنظیمات، سرویس Nginx را ریستارت کنید:
sudo ln -s /etc/nginx/sites-available/mediawiki /etc/nginx/sites-enabled/

تست وب سرور

21 sudo nginx -t

Nginx -t.png

sudo systemctl restart nginx.service

کانفیگ php-fpm

23 sudo atom /etc/php/7.*/fpm/pool.d/www.conf
pm = dynamic
pm.max_children = 30
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 20
pm.max_requests = 500
sudo nano /etc/php/7.2/fpm/php.ini
 
 
file_uploads = On
allow_url_fopen = On
memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 360
cgi.fix_pathinfo = 0
date.timezone = Asia/Tehran
sudo systemctl restart nginx php7.2-fpm

نصب سامانهٔ مدیریت دادگان

24 sudo apt-get install mariadb-server mariadb-client php7.2-mysqli -y
25 sudo mysql_secure_installation

پسوورد دلخواه را بزنید:

26 Enter current password for root (enter for none): 961720Ma#

و به تمام سوالات جواب بدهید:

Change the root password? [Y/n] n ... skipping.

Remove anonymous users? [Y/n] y ... Success!

Disallow root login remotely? [Y/n] y ... Success!

Remove test database and access to it? [Y/n] y - Dropping test database... ... Success!
- Removing privileges on test database... ... Success!

Reload privilege tables now? [Y/n] y ... Success!

Cleaning up...
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!

تنظیم سامانهٔ مدیریت دادگان:

27 sudo mysql -u root -p
961720Ma#

CREATE DATABASE mediawiki CHARACTER SET utf8 COLLATE utf8_general_ci;

create user 'mediawiki'@'localhost' identified by 'Mahdidata9027@#';

grant all privileges on mediawiki . * to 'mediawiki'@'localhost';

flush privileges;

\q

نصب الزامات مدیاویکی

28 sudo aptitude install memcached php7.2-memcached php7.2-cli php7.2-mbstring php7.2-xml php7.2-apcu php7.2-intl php7.2-curl git imagemagick curl -y
29 sudo systemctl restart nginx memcached.service
30 
31 sudo atom /etc/memcached.conf
32 -m #parameter.
33 Change its value to at least 1GB
34 
35 sudo systemctl restart memcached nginx

de:Hauptseite es:Página principal el:Αρχική σελίδα fi:Etusivu fr:Accueil nl:Hoofdpagina pl:Strona główna ru:Заглавная страница uk:Головна сторінка zh-tw:首頁

بارگذاری مدیاویکی

30 sudo git clone https://github.com/wikimedia/mediawiki.git w
31 
32 chown -R sokot w
33 #sudo find . -type f -exec chmod 644 {} \;
34 #sudo find . -type d -exec chmod 755 {} \;
35 
36 cd /var/www/html/w
37 git checkout REL1_33
38 
39 git pull
40 git submodule update --init

نصب کتابخانه های خارجی:

38 composer update --no-dev
39 chown -R www-data w

پیکربندی های امنیتی و دسترسی اولیه

39 sudo chown www-data /home/sokot/public_html/w
40 #sudo chmod 2750 /var/www/
41 
42 sudo chown www-data:www-data /home/sokot/public_html/w/images

نصب ftp سرور

link

برای متصل شدن به سرور از دستور نصب پیروی کنید:

50 sudo apt update
51 sudo apt install vsftpd
52 sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.orig
53 sudo nano /etc/vsftpd.conf
54 
55 listen=NO
56 listen_ipv6=YES
57 anonymous_enable=NO
58 local_enable=YES
59 write_enable=YES
60 local_umask=022
61 dirmessage_enable=YES
62 use_localtime=YES
63 xferlog_enable=YES
64 connect_from_port_20=YES
65 chroot_local_user=YES
66 secure_chroot_dir=/var/run/vsftpd/empty
67 pam_service_name=vsftpd
68 rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
69 rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
70 ssl_enable=NO
71 pasv_enable=Yes
72 pasv_min_port=10000
73 pasv_max_port=10100
74 allow_writeable_chroot=YES
75 
76 sudo ufw allow from any to any port 20,21,10000:10100 proto tcp
77 sudo service vsftpd restart
78 sudo systemctl enable vsftpd
79 
80 chown -R sokot /home/sokot/public_html/w

شروع نصب مدیاویکی

مدیاویکی را نصب میکنیم و ممکچد را اضافه میکنیم:

#https://www.mediawiki.org/wiki/Manual:$wgMaxShellMemory
$wgMaxShellMemory = 524288;

# https://www.mediawiki.org/wiki/Manual:Memcached
## Shared memory settings
$wgMainCacheType = CACHE_MEMCACHED;
$wgParserCacheType = CACHE_MEMCACHED; # optional
$wgMessageCacheType = CACHE_MEMCACHED; # optional
$wgMemCachedServers = array( "127.0.0.1:11211" );
$wgSessionsInObjectCache = true; # optional
$wgSessionCacheType = CACHE_MEMCACHED; # optional

# END TO INSTALL MEMCACHED

و فایل لوکال ستینگ را در سرور لود میکنیم:

 97 cd /home/sokot/ftp/files
 98 sudo mv LocalSettings.php /var/www/mediawiki/LocalSettings.php
 99 sudo ln -s /var/www/LocalSettings.php
100 
101 cd /var/www/mediawiki
102 sudo chmod 640 LocalSettings.php
103 sudo chown www-data LocalSettings.php

نصب phpmyadmin

sudo atom /etc/nginx/sites-available/default

location /pma_none {
        auth_basic "Restricted Access";
        auth_basic_user_file /etc/nginx/.htpasswd;
    }
    
sudo nginx -t
sudo service nginx reload

عیب یابی سیستم

  • قبل هر چیزی نوشته زیر را بعد از php قرار دهید:
# Debag finder 1
error_reporting( -1 );
ini_set( 'display_errors', 1 );

نصب پوسته

نصب minerva

# https://www.mediawiki.org/wiki/Skin:Minerva_Neue
sudo git clone https://github.com/wikimedia/mediawiki-skins-MinervaNeue.git MinervaNeue
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadSkin( 'MinervaNeue' );
============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب افزونه ها

نصب VisualEditor

نصب parsoid

103 sudo aptitude install nodejs
104 sudo apt install dirmngr
105 sudo apt-key advanced --keyserver keys.gnupg.net --recv-keys AF380A3036A03444
106 sudo apt-add-repository "deb https://releases.wikimedia.org/debian jessie-mediawiki main"
107 sudo apt install apt-transport-https
108 sudo apt update && sudo apt install parsoid
109 
110 sudo service parsoid start
111 or
112 /etc/init.d/parsoid start

کانفیگ پارسوید

فایل پیکربندی را در config.yaml باز کنید و آن را به روز کنید تا آدرس API شما را نشان دهد.

sudo atom /etc/mediawiki/parsoid/config.yaml


# Configure Parsoid to point to your MediaWiki instances.
        mwApis:
        - # This is the only required parameter,
          # the URL of you MediaWiki API endpoint.
          uri: 'http://wiki-howzeh.ir/w/api.php'
          # The "domain" is used for communication with Visual Editor
          # and RESTBase.  It defaults to the hostname portion of
          # the `uri` property below, but you can manually set it
          # to an arbitrary string.
          # domain: 'localhost'  # optional
          # To specify a proxy (or proxy headers) specific to this prefix
          # (which overrides defaultAPIProxyURI). Alternatively, set `proxy`
          # to `null` to override and force no proxying when a default proxy
          # has been set.
          #proxy:
          #    uri: 'http://my.proxy:1234/'
          #    headers:  # optional
          #        'X-Forwarded-Proto': 'https'
          
          
sudo service parsoid restart

نصب VisualEditor

 1 cd /var/www/mediawiki/extensions
 2 sudo git clone https://github.com/wikimedia/mediawiki-extensions-VisualEditor.git VisualEditor
 3 cd VisualEditor
 4 sudo git checkout REL1_33
 5 sudo git pull
 6 sudo git submodule update --init
 7 
 8 wfLoadExtension( 'VisualEditor' );		#Complate configrations--->>>
 9 
10 // Enable by default for everybody
11 $wgDefaultUserOptions['visualeditor-enable'] = 1;
12 
13 // Optional: Set VisualEditor as the default for anonymous users
14 // otherwise they will have to switch to VE
15 $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";
16 
17 #Don't allow users to disable it
18 $wgHiddenPrefs[] = 'visualeditor-enable';
19 
20 // OPTIONAL: Enable VisualEditor's experimental code features
21 #$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
22 
23 # Adding a namespace
24 $wgVisualEditorAvailableNamespaces = [
25     NS_MAIN => true,
26     NS_USER => true,
27     102 => true,
28     "_merge_strategy" => "array_plus"
29 ];
30 
31 $wgVirtualRestConfig['modules']['parsoid'] = array(
32     // Use port 8142 if you use the Debian package
33     'url' => 'http://localhost:8142',
34     // Parsoid "domain", see below (optional)
35     'domain' => 'localhost',
36     // Parsoid "prefix", see below (optional)
37     'prefix' => 'localhost'
38 );
39 
40 # https://www.mediawiki.org/wiki/Extension:VisualEditor#Parsoid_Authentication_Without_Forwarding_Cookies
41 # Parsoid Authentication Without Forwarding Cookies
42 if ( !isset( $_SERVER['REMOTE_ADDR'] ) OR $_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
43 	$wgGroupPermissions['*']['read'] = true;
44 	$wgGroupPermissions['*']['edit'] = true;
45 };
46 
47 # =====================================================
48 # https://www.mediawiki.org/wiki/Extension:VisualEditor#Parsoid_over_HTTPS
49 # =====================================================
50 
51 #Wikitext mode + Beta Features opt-in state 
52 $wgVisualEditorEnableWikitextBetaFeature = true;
53 
54 #Single edit tab
55 $wgVisualEditorUseSingleEditTab = true;
56 $wgDefaultUserOptions['visualeditor-tabs'] = 'multi-tab';
57 
58 #Visual diffs on history pages + Beta Features opt-in state 
59 $wgVisualEditorEnableDiffPageBetaFeature = true;
60 
61 #end options
62 
63 #other options
64 #Table Of Contents widget  (Beta)
65 $wgVisualEditorVisualEditorEnableTocWidget = false;
66 
67 #URL to use to access the experimental rebaser technology (Beta)
68 $wgVisualEditorVisualEditorRebaserURL = false;
69 
70 # From what timestamp to warn existing editors that the installation has switched from two edit tabs to one. 
71 $wgVisualEditorVisualEditorSingleEditTabSwitchTime = "20160101000000";
72 
73 # Whether to put a change tag on every edit made with VisualEditor.
74 $wgVisualEditorVisualEditorUseChangeTagging = true;
75 ============================
76 php /var/www/html/w/maintenance/update.php --quick
77 ============================

نصب MobileFrontend

# https://www.mediawiki.org/wiki/Extension:MobileFrontend#Installation

sudo git clone https://github.com/wikimedia/mediawiki-extensions-MobileFrontend.git MobileFrontend
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'MobileFrontend' );

# if you want only MobileFrontend to use the Minerva skin.
$wgMFDefaultSkinClass = 'SkinMinerva';

$wgMFAutodetectMobileView = true;
$wgShowExceptionDetails = true;

============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب BetaFeatures

//https://www.mediawiki.org/wiki/Extension:BetaFeatures

sudo git clone https://github.com/wikimedia/mediawiki-extensions-BetaFeatures.git BetaFeatures
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

wfLoadExtension( 'BetaFeatures' );

php /var/www/html/w/maintenance/update.php --quick

نصب TimedMediaHandler

https://www.mediawiki.org/wiki/Extension:TimedMediaHandler

sudo git clone https://github.com/wikimedia/mediawiki-extensions-TimedMediaHandler.git TimedMediaHandler
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive
composer install --no-dev

// MediaWiki 1.31 and later
wfLoadExtension( 'TimedMediaHandler' );
php /var/www/html/w/maintenance/update.php --quick

نصب cldr

// https://www.mediawiki.org/wiki/Extension:CLDR

sudo git clone https://github.com/wikimedia/mediawiki-extensions-cldr.git cldr
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'cldr' );			#Complate configrations--->>>

sudo wget http://www.unicode.org/Public/cldr/latest/core.zip
sudo unzip core.zip -d core
sudo php rebuild.php

LocalSettings.php:
# The language names are best access with MediaWiki core functions:
$name = Language::fetchLanguageName( 'fa', 'en', 'ar' );

# The following example sets a variable to the list of all countries in CLDR in persian
if ( is_callable( array( 'CountryNames', 'getNames' ) ) ) {
    $countries = CountryNames::getNames( 'fa' );
}

# The following example sets a variable to the list of all currencies in CLDR in Iran.
if ( is_callable( array( 'CurrencyNames', 'getNames' ) ) ) {
    $currencies = CurrencyNames::getNames( 'fa' );
}
 -----------------   
https://www.mediawiki.org/wiki/Extension:Babel

نصب CheckUser

https://www.mediawiki.org/wiki/Extension:CheckUser

sudo git clone https://github.com/wikimedia/mediawiki-extensions-CheckUser.git CheckUser
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'CheckUser' );			#Complate configrations--->>>

$wgCUDMaxAge = "7776000";
$wgCheckUserMaxBlocks = "200";
$wgCheckUserForceSummary = true;
$wgCheckUserCIDRLimit = [ 'IPv4' => 16, 'IPv6' => 32 ];

# Public key to encrypt private data that may need to be read later.
# `openssl genrsa -out cu.key 2048; openssl rsa -in cu.key -pubout > cu.pub` and paste the contents of cu.pub here
# $wgCUPublicKey =

$wgCheckUserCAMultiLock	= false;
$wgCheckUserCAtoollink	= false;
$wgCheckUserGBtoollink	= false;

# Granting right to use CheckUser
$wgGroupPermissions['sysop']['checkuser'] = true;
$wgGroupPermissions['sysop']['checkuser-log'] = true;

php /var/www/html/w/maintenance/update.php --quick

نصب CodeEditor

پیش نیاز

کاربر:Sokote_zaman/صفحه_تمرین#نصب_Echo

https://www.mediawiki.org/wiki/Extension:CodeEditor

sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

wfLoadExtension( 'CodeEditor' );		#Complate configrations--->>>

// user option provided by WikiEditor extension
$wgDefaultUserOptions['usebetatoolbar'] = 1; 

# Use for Scribunto
$wgScribuntoUseCodeEditor = true;

# Use for SyntaxHighlight
$wgScribuntoUseGeSHi = true;

#To enable the editor on JavaScript and CSS pages in the MediaWiki
$wgCodeEditorEnableCore = true;

نصب Scribunto

 1 sudo git clone https://github.com/wikimedia/mediawiki-extensions-Scribunto.git Scribunto
 2 sudo git checkout REL1_33
 3 sudo git pull
 4 sudo git submodule update --init --recursive
 5 
 6 sudo chmod a+x /var/www/html/w/extensions/Scribunto/includes/engines/LuaStandalone/binaries/lua5_1_5_linux_64_generic/lua
 7 
 8 wfLoadExtension( 'Scribunto' );
 9 $wgScribuntoDefaultEngine = 'luastandalone';
10 
11 $wgScribuntoUseGeSHi = true;
12 $wgScribuntoUseCodeEditor = true;
13 
14 ============================
15 php /var/www/html/w/maintenance/update.php --quick
16 
17 ============================

نصب WikiEditor

https://www.mediawiki.org/wiki/Extension:WikiEditor

sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

//  https://www.mediawiki.org/wiki/Extension:WikiEditor
wfLoadExtension( 'WikiEditor' );

# Enables link and table wizards by default but still allows users to disable them in preferences
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;

# Enable side-by-side preview
$wgDefaultUserOptions['wikieditor-preview'] = 1;

# Enable navigable table of contents
$wgDefaultUserOptions['usenavigabletoc'] = 1;

# Enable step-by-step publishing
$wgDefaultUserOptions['wikieditor-publish'] = 1;

# Enable enhanced editing toolbar
$wgDefaultUserOptions['usebetatoolbar'] = 1;

//# Displays the Publish and Cancel buttons on the top right side
//$wgDefaultUserOptions['wikieditor-publish'] = 1;

نصب CharInsert

https://www.mediawiki.org/wiki/Extension:CharInsert

sudo git clone https://github.com/wikimedia/mediawiki-extensions-CharInsert.git CharInsert
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'CharInsert' );		#Complate configrations--->>>

نصب CategoryTree

https://www.mediawiki.org/wiki/Extension:CategoryTree

sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'CategoryTree' );		#Complate configrations--->>>

نصب Cite

https://www.mediawiki.org/wiki/Extension:Cite

sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'Cite' );		#Complate configrations--->>>

نصب CiteThisPage

https://www.mediawiki.org/wiki/Extension:CiteThisPage

sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'CiteThisPage' );		#Complate configrations--->>>

نصب ConfirmEdit

https://www.mediawiki.org/wiki/Extension:ConfirmEdit

sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'ConfirmEdit' );		#NOT Complate configrations--->>>

$wgGroupPermissions['*']['skipcaptcha'] = false;
$wgGroupPermissions['user']['skipcaptcha'] = false;
$wgGroupPermissions['autoconfirmed']['skipcaptcha'] = false;
$wgGroupPermissions['emailconfirmed']['skipcaptcha'] = false;
$wgGroupPermissions['bot']['skipcaptcha'] = true; // registered bots
$wgGroupPermissions['sysop']['skipcaptcha'] = true;
$wgGroupPermissions['bureaucrat']['skipcaptcha'] = true;

نصب Disambiguator

https://www.mediawiki.org/wiki/Extension:Disambiguator

sudo git clone https://github.com/wikimedia/mediawiki-extensions-Disambiguator.git Disambiguator
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'Disambiguator' );		#NOT Complate configrations--->>>

نصب Echo

https://www.mediawiki.org/wiki/Extension:Echo

sudo git clone https://github.com/wikimedia/mediawiki-extensions-Echo.git Echo
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'Echo' );		#NOT Complate configrations--->>>
============================
php /var/www/html/w/maintenance/update.php --quick
============================
# The organization address (or whatever text you want to appear in the footer of the email notifications)
$wgEchoEmailFooterAddress = 'ویکی حوزه: دانشنامه جامع علوم حوزوی';

# Enable mention success/failure notifications
$wgEchoMentionStatusNotifications = true;

#Whether or not to show the footer feedback notice in the notifications popup
$wgEchoShowFooterNotice = true;

# A URL for the survey that appears in the footer feedback notice in the notification popup
$wgEchoFooterNoticeURL = 'admin@wiki-howzeh.ir';
$wgAllowHTMLEmail = true;
$wgEchoNewMsgAlert = true;
$wgEchoMentionOnChanges	= true;
$wgEchoEnableEmailBatch	= true;
$wgEchoMentionsOnMultipleSectionEdits = true;
$wgDefaultUserOptions['echo-show-alert'] = true;
$wgEchoCluster = false;
$wgEchoUseJobQueue = false;
$wgEchoSharedTrackingDB	= false;
$wgEchoSharedTrackingCluster = false;
$wgEchoCrossWikiNotifications = false;
$wgEchoUseCrossWikiBetaFeature = false;
$wgEchoPerUserBlacklist = "null";
$wgEchoMaxUpdateCount = "2000";
$wgEchoMaxMentionsCount	= "50";
$wgEchoBundleEmailInterval = "0";
$wgDefaultUserOptions['echo-email-frequency'] = "0";
$wgDefaultUserOptions['echo-dismiss-feedback-alert'] = "0";
$wgEchoOnWikiBlacklist = 'Echo-blacklist';
$wgEchoPerUserWhitelistFormat = '%s/Echo-whitelist';
$wgDefaultUserOptions['echo-email-format'] = "HTML";	# $wgAllowHTMLEmail = true;
============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب ParserFunctions

 1 # https://www.mediawiki.org/wiki/Extension:ParserFunctions
 2 
 3 sudo git checkout REL1_33
 4 sudo git pull
 5 sudo git submodule update --init --recursive
 6 
 7 LocalSettings.php:
 8 wfLoadExtension( 'ParserFunctions' );		#Complate configrations--->>>
 9 
10 # Allows to activate the integrated string function functionality
11 $wgPFEnableStringFunctions = true;
12 
13 # The default value is false.
14 $wgPFEnableStringFunctions = false;
15 
16 # Defines the maximum length of a string that string functions are allowed to operate on.
17 # The default value is 1000.
18 $wgPFStringLengthLimit = "3000";

نصب Thanks

# https://www.mediawiki.org/wiki/Extension:Thanks

sudo git clone https://github.com/wikimedia/mediawiki-extensions-Thanks.git Thanks
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'Thanks' );

# Enable the Thank interface for bot edits (disabled by default)
$wgThanksSendToBots =true;

# Log Thank actions to "Special:Log" (enabled by default)
$wgThanksLogging = true;

# Whether or not confirmation is required for sending thanks (enabled by default)
$wgThanksConfirmationRequired = true;

# Log entry types that can be thanked from Special:Log:
$wgThanksLogTypeWhitelist = [
	"contentmodel",
	"delete",
	"import",
	"merge",
	"move",
	"patrol",
	"protect",
	"tag",
	"managetags",
	"rights"
];

============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب EventLogging

 1 https://www.mediawiki.org/wiki/Extension:EventLogging
 2 
 3 sudo git clone https://github.com/wikimedia/mediawiki-extensions-EventLogging.git EventLogging
 4 sudo git checkout REL1_33
 5 sudo git pull
 6 sudo git submodule update --init --recursive
 7 
 8 LocalSettings.php:
 9 require_once "$IP/extensions/EventLogging/EventLogging.php";				#Complate configrations--->>>
10 $wgEventLoggingBaseUri = 'http://localhost:8080/event.gif';
11 $wgEventLoggingFile = '/var/log/mediawiki/events.log';
12 
13 $wgEventLoggingSchemaApiUri = $wgServer . '/api.php';
14 $wgEventLoggingDBname = $wgDBname;

نصب Flow

پیش نیازها:

  1. اصلی:
    1. نصب Echo
    2. نصب ParserFunctions
  2. فرعی:
    1. نصب CheckUser
    2. نصب BetaFeatures
    3. نصب VisualEditor
    4. نصب cldr
    5. نصب Thanks
    6. نصب EventLogging
 1 #https://www.mediawiki.org/wiki/Extension:StructuredDiscussions
 2 
 3 sudo git clone https://github.com/wikimedia/mediawiki-extensions-Flow.git Flow
 4 sudo git checkout REL1_33
 5 sudo git pull
 6 sudo chown -R sokot /home/sokot/public_html/w/extensions/Flow
 7 sudo composer update --no-dev
 8 sudo chown -R www-data /home/sokot/public_html/w/extensions/Flow
 9 sudo git submodule update --init --recursive
10 
11 php /home/sokot/public_html/w/maintenance/populateContentModel.php --wiki=write --ns=1 --table=revision
12 php /home/sokot/public_html/w/maintenance/populateContentModel.php --wiki=write --ns=1 --table=archive
13 php /home/sokot/public_html/w/maintenance/populateContentModel.php --wiki=write --ns=1 --table=page
14 php /home/sokot/public_html/w/maintenance/populateContentModel.php --wiki=write --ns=3 --table=revision
15 php /home/sokot/public_html/w/maintenance/populateContentModel.php --wiki=write --ns=3 --table=archive
16 php /home/sokot/public_html/w/maintenance/populateContentModel.php --wiki=write --ns=3 --table=page
17 
18 For delete😮 table:
19 php /home/sokot/public_html/w/maintenance/populateContentModel.php --wiki=write --ns=all --table=revision
20 php /home/sokot/public_html/w/maintenance/populateContentModel.php --wiki=write --ns=all --table=archive
21 php /home/sokot/public_html/w/maintenance/populateContentModel.php --wiki=write --ns=all --table=page
22     
23 LocalSettings.php:
24 wfLoadExtension( 'Flow' );
25 
26 ============================
27 php /var/www/html/w/maintenance/update.php --quick
28 ============================
29 
30 # set $wgNamespaceContentModels[namespace] for particular namespaces.
31 # For example:
32 $wgNamespaceContentModels[NS_TALK] = 'flow-board';
33 $wgNamespaceContentModels[NS_USER_TALK] = 'flow-board';
34   
35 # https://www.mediawiki.org/wiki/Manual:$wgContentHandlerUseDB
36 # Whether to use the database fields introduced by the ContentHandler facility
37 $wgContentHandlerUseDB = true;
38 
39 # for VisualEditor support
40 $wgFlowEditorList = array( 'visualeditor', 'none' );
41 
42 $wgGroupPermissions['write']['flow-create-board'] = true;
43 
44 $wgFlowHelpPage	= '//www.mediawiki.org/wiki/Special:MyLanguage/Help:Extension:Flow';
45 $wgFlowCluster = false;
46 $wgFlowUseMemcache = true;
47 $wgFlowEventLogging = true;
48 $wgFlowDefaultWikiDb = false;
49 $wgFlowExternalStore = false;
50 $wgFlowParsoidForwardCookies = false;
51 $wgFlowServerCompileTemplates = true;
52 
53 $wgFlowSearchEnabled = true;
54 
55 $wgFlowParsoidURL = "null";
56 $wgFlowContentFormat = 'html';
57 $wgFlowParsoidPrefix = "null";
58 $wgFlowParsoidTimeout = "null";
59 $wgFlowDefaultWorkflow = "discussion";
60 $wgFlowSearchServers = array( 'localhost' );
61 $wgFlowEditorList = array( 'visualeditor', 'wikitext' );
62 $wgFlowAbuseFilterGroup = 'flow';
63 $wgFlowCoreActionWhitelist = array( 'info', 'protect', 'unprotect', 'unwatch', 'watch', 'history', 'wikilove', 'move', 'delete' );
64 
65 $wgFlowMaxLimit = "100";
66 $wgFlowAjaxTimeout = "30";
67 $wgFlowDefaultLimit = "10";
68 $wgFlowCacheVersion = "4.7";
69 $wgFlowMaxMentionCount = "100";
70 $wgFlowMaxThreadingDepth = "8";
71 $wgFlowCacheTime = "60 * 60 * 24 * 3";
72 $wgFlowAbuseFilterEmergencyDisableCount = "50";
73 $wgFlowAbuseFilterEmergencyDisableThreshold ="0.10";
74 $wgFlowAbuseFilterEmergencyDisableAge = "86400"; // One day.
75 
76 ================================================================
77 8- https://www.mediawiki.org/wiki/API:Changing_wiki_content#Possible%20errors
78 ================================================================

نصب AbuseFilter

پیش نیاز:

AntiSpoof

# https://www.mediawiki.org/wiki/Extension:AbuseFilter

sudo git clone https://github.com/wikimedia/mediawiki-extensions-AbuseFilter.git AbuseFilter
sudo git checkout REL1_33
sudo chown -R sokot /home/sokot/public_html/w/extensions/AbuseFilter
sudo composer install
sudo chown -R www-data /home/sokot/public_html/w/extensions/AbuseFilter
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'AbuseFilter' );
============================
php /var/www/html/w/maintenance/update.php --quick
============================
$wgGroupPermissions['sysop']['abusefilter-view'] = true;
$wgGroupPermissions['sysop']['abusefilter-log'] = true;
$wgGroupPermissions['sysop']['abusefilter-log-detail'] = true;
$wgGroupPermissions['sysop']['abusefilter-revert'] = true;
$wgGroupPermissions['sysop']['abusefilter-private'] = true;
$wgGroupPermissions['sysop']['abusefilter-private-log'] = true;
$wgGroupPermissions['sysop']['abusefilter-view-private'] = true;
$wgGroupPermissions['sysop']['abusefilter-log-private'] = true;
$wgGroupPermissions['sysop']['abusefilter-hidden-log'] = true;
$wgGroupPermissions['sysop']['abusefilter-hide-log'] = true;
$wgGroupPermissions['sysop']['abusefilter-modify'] = true;
$wgGroupPermissions['sysop']['abusefilter-modify-restricted'] = true;
$wgGroupPermissions['sysop']['abusefilter-modify-global'] = true;

$wgGroupPermissions['*']['abusefilter-view'] = false;
$wgGroupPermissions['*']['abusefilter-log'] = false;
$wgGroupPermissions['*']['abusefilter-log-detail'] = false;
$wgGroupPermissions['*']['abusefilter-revert'] = false;
$wgGroupPermissions['*']['abusefilter-private'] = false;
$wgGroupPermissions['*']['abusefilter-private-log'] = false;
$wgGroupPermissions['*']['abusefilter-view-private'] = false;
$wgGroupPermissions['*']['abusefilter-log-private'] = false;
$wgGroupPermissions['*']['abusefilter-hidden-log'] = false;
$wgGroupPermissions['*']['abusefilter-hide-log'] = false;
$wgGroupPermissions['*']['abusefilter-modify'] = false;
$wgGroupPermissions['*']['abusefilter-modify-restricted'] = false;
$wgGroupPermissions['*']['abusefilter-modify-global'] = false;

نصب AntiSpoof

https://www.mediawiki.org/wiki/Extension:AntiSpoof

sudo git clone https://github.com/wikimedia/mediawiki-extensions-AntiSpoof.git AntiSpoof
sudo git checkout REL1_33
sudo chown -R sokot /home/sokot/public_html/w/extensions/AntiSpoof
sudo composer update --no-dev
sudo chown -R www-data /home/sokot/public_html/w/extensions/AntiSpoof
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:

============================
php /var/www/html/w/maintenance/update.php --quick
============================

wfLoadExtension( 'AntiSpoof' );

# In case user accounts are stored in a shared database, add:
$wgSharedTables[] = 'spoofuser';

==================================
php /home/sokot/public_html/w/extensions/AntiSpoof/maintenance/batchAntiSpoof.php
==================================
============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب SpamBlacklist

https://www.mediawiki.org/wiki/Extension:SpamBlacklist

sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'SpamBlacklist' );

============================
php /var/www/html/w/maintenance/update.php --quick
============================

$wgSpamBlacklistFiles = array(
   "[[m:Spam blacklist]]",
   "http://wiki-howzeh.ir/wiki/MediaWiki:Spam-blacklist"
);

// Bump the Perl Compatible Regular Expressions backtrack memory limit                                                                                  
// (PHP 5.3.x default, 1000K, is too low for SpamBlacklist)                                                                                              
ini_set( 'pcre.backtrack_limit', '8M' );
================

php /var/www/html/w/maintenance/update.php --quick

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

نصب ConfirmEdit

# https://www.mediawiki.org/wiki/Extension:ConfirmEdit

sudo git clone https://github.com/wikimedia/mediawiki-extensions-ConfirmEdit.git ConfirmEdit
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'ConfirmEdit' );		#NOT Complate configrations--->>>

============================
php /var/www/html/w/maintenance/update.php --quick
============================

$wgGroupPermissions['*']['skipcaptcha'] = false;
$wgGroupPermissions['user']['skipcaptcha'] = false;
$wgGroupPermissions['autoconfirmed']['skipcaptcha'] = false;
$wgGroupPermissions['emailconfirmed']['skipcaptcha'] = false;
$wgGroupPermissions['bot']['skipcaptcha'] = true; // registered bots
$wgGroupPermissions['sysop']['skipcaptcha'] = true;
$wgGroupPermissions['bureaucrat']['skipcaptcha'] = true;

نصب InputBox

https://www.mediawiki.org/wiki/Extension:InputBox

sudo git clone https://github.com/wikimedia/mediawiki-extensions-InputBox.git InputBox
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'InputBox' );

============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب Gadgets

https://www.mediawiki.org/wiki/Extension:Gadgets

sudo git clone https://github.com/wikimedia/mediawiki-extensions-Gadgets.git Gadgets
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'Gadgets' );

============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب Interwiki

https://www.mediawiki.org/wiki/Extension:Interwiki

sudo git clone https://github.com/wikimedia/mediawiki-extensions-Interwiki.git Interwiki
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'Interwiki' );
// To grant sysops permissions to edit interwiki data
$wgGroupPermissions['sysop']['interwiki'] = true;

// To create a new user group that may edit interwiki data
// (bureaucrats can add users to this group)
# $wgGroupPermissions['developer']['interwiki'] = true; // delete the comment indicator # as appropriate

============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب MassMessage

https://www.mediawiki.org/wiki/Extension:MassMessage

sudo git clone https://github.com/wikimedia/mediawiki-extensions-MassMessage.git MassMessage
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'MassMessage' );

$wgNamespacesToPostIn = array( NS_PROJECT );
$wgNamespacesToConvert = array( NS_USER => NS_USER_TALK );
$wgMassMessageAccountUsername = 'MessengerBot';
$wgAllowGlobalMessaging = false;

============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب Nuke

https://www.mediawiki.org/wiki/Extension:Nuke

sudo git clone https://github.com/wikimedia/mediawiki-extensions-Nuke.git Nuke
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'Nuke' );

$wgGroupPermissions['sysop']['nuke'] = false;
$wgGroupPermissions['nuke']['nuke'] = true;
============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب Renameuser

https://www.mediawiki.org/wiki/Extension:Renameuser

sudo git clone https://github.com/wikimedia/mediawiki-extensions-Renameuser.git Renameuser
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'Renameuser' );

$wgGroupPermissions['sysop']['renameuser'] = true;

============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب SyntaxHighlight_GeSHi

https://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi

sudo git clone https://github.com/wikimedia/mediawiki-extensions-SyntaxHighlight_GeSHi.git SyntaxHighlight_GeSHi
sudo git checkout REL1_33
sudo chown -R sokot /home/sokot/public_html/w/extensions/SyntaxHighlight_GeSHi
sudo composer install --no-dev
sudo composer update --no-dev
sudo chown -R www-data /home/sokot/public_html/w/extensions/SyntaxHighlight_GeSHi
sudo git pull
sudo git submodule update --init --recursive
sudo chmod a+x pygments/pygmentize
LocalSettings.php:
wfLoadExtension( 'SyntaxHighlight_GeSHi' );

============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب RelatedArticles

https://www.mediawiki.org/wiki/Extension:RelatedArticles

sudo git clone https://github.com/wikimedia/mediawiki-extensions-RelatedArticles.git RelatedArticles

sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'RelatedArticles' );

#  Use morelike feature of CirrusSearch by setting $wgRelatedArticlesUseCirrusSearch to true.
# f CirrusSearch is not available fallback to using the related articles marked in wikitext.
$wgRelatedArticlesUseCirrusSearch = false;

# Use only CirrusSearch's morelike feature by setting $wgRelatedArticlesOnlyUseCirrusSearch to true
# ignoring the related articles marked in wikitext.
$wgRelatedArticlesOnlyUseCirrusSearch = false;

# List of skin names ('minerva', 'vector') where related articles will be shown in the footer.
$wgRelatedArticlesFooterWhitelistedSkins = ['minerva', 'vector'];

============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب CodeMirror

https://www.mediawiki.org/wiki/Extension:CodeMirror

sudo git clone https://github.com/wikimedia/mediawiki-extensions-CodeMirror.git CodeMirror
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'CodeMirror' );

# Enables use of CodeMirror by default but still allow users to disable it
$wgDefaultUserOptions['usecodemirror'] = 1;

============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب Poem

https://www.mediawiki.org/wiki/Extension:Poem

sudo git clone https://github.com/wikimedia/mediawiki-extensions-Poem.git Poem
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'Poem' );

============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب TemplateData


https://www.mediawiki.org/wiki/Extension:TemplateData

sudo git clone https://github.com/wikimedia/mediawiki-extensions-TemplateData.git TemplateData
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'TemplateData' );

# Experimental dialog interface to edit templatedata JSON
$wgTemplateDataUseGUI = true;
============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب TemplateStyles


https://www.mediawiki.org/wiki/Extension:TemplateStyles

sudo git clone https://github.com/wikimedia/mediawiki-extensions-TemplateStyles.git TemplateStyles
sudo git checkout REL1_33
sudo chown -R sokot /home/sokot/public_html/w/extensions/TemplateStyles
sudo composer update --no-dev
sudo chown -R www-data /home/sokot/public_html/w/extensions/TemplateStyles
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'TemplateStyles' );

# PCRE regular expressions to match allowed URLs for various types of external references. 
$wgTemplateStylesAllowedUrls = [
    "audio" => [
        "<^https://upload\\.wikimedia\\.org/wikipedia/commons/>"
    ],
    "image" => [
        "<^https://upload\\.wikimedia\\.org/wikipedia/commons/>"
    ],
    "svg" => [
        "<^https://upload\\.wikimedia\\.org/wikipedia/commons/[^?#]*\\.svg(?:[?#]|$)>"
    ],
    "font" => [],
    "namespace" => [
        "<.>"
    ],
    "css" => []
];

$wgTemplateStylesNamespaces = [ 10 => true ];

# Whether to enable Extension:CodeEditor for the "Sanitized CSS" content type.
$wgTemplateStylesUseCodeEditor = true;

# If true, the "Sanitized CSS" content model will be added to $wgTextModelsToParse
# if the CSS content model is already present in that array. 
$wgTemplateStylesAutoParseContent = true;

# Configuration of the HTML postprocessing tool to use for fixing invalid HTML code.
# Configure MediaWiki to use the tidy PECL package:
$wgTidyConfig = [
    'driver' => 'RaggettInternalPHP',
    'tidyConfigFile' => "$IP/includes/tidy/tidy.conf",
];

============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب LoginNotify


https://www.mediawiki.org/wiki/Extension:LoginNotify

sudo git clone https://github.com/wikimedia/mediawiki-extensions-LoginNotify.git LoginNotify
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'LoginNotify' );

# The number of failed login attempts to permit from a known IP before a notification is triggered.
$wgLoginNotifyAttemptsKnownIP = "10";

# The number of failed login attempts to permit from a new IP before a notification is triggered.
$wgLoginNotifyAttemptsNewIP	= "3";

# The time-to-live of the count of failed login attempts from a known IP (from the time of the first failed attempt).
$wgLoginNotifyExpiryKnownIP = "604800 (7 days)";

# The time-to-live of the count of failed login attempts from a new IP (from the time of the first failed attempt).	
$wgLoginNotifyExpiryNewIP = "1209600 (14 days)";

# Whether to trigger a notification after failed logins from known IPs.
$wgLoginNotifyCheckKnownIPs = true;

# Whether to trigger a notification after successful logins from unknown IPs.
$wgLoginNotifyEnableOnSuccess = true;

# Set different default notification preferences for different user groups.
$wgLoginNotifyEnableForPriv = [ "editinterface", "userrights" ];

# Use this key instead of $wgSecretKey to generate the HMACs for the cookie.
$wgLoginNotifySecretKey = "null";

# Expiration of the cookie.
$wgLoginNotifyCookieExpire = "15552000 (180 days)";

# To allow sharing login cookies between sites on different subdomains, set this to the parent domain name.
$wgLoginNotifyCookieDomain = "null";

# Maximum number of users (records) to track as having successfully logged in on a particular device.
$wgLoginNotifyMaxCookieRecords = "6";

# How long to cache IPs in memcache. Set to false to disable; set to 0 to cache forever.
$wgLoginNotifyCacheLoginIPExpiry = false;

============================
php /var/www/html/w/maintenance/update.php --quick
============================

نصب TextExtracts


https://www.mediawiki.org/wiki/Extension:TextExtracts

sudo git clone https://github.com/wikimedia/mediawiki-extensions-TextExtracts.git TextExtracts
sudo git checkout REL1_33
sudo git pull
sudo git submodule update --init --recursive

LocalSettings.php:
wfLoadExtension( 'TextExtracts' );

# removes indented text, often used for non-templated hatnotes that are not desired in summaries.
$wgExtractsRemoveClasses[] = 'dl';

# defines whether TextExtracts should provide its extracts to the opensearch API module.
# The default is "false".
$wgExtractsExtendOpenSearchXml = false;

============================
php /var/www/html/w/maintenance/update.php --quick
============================

php importDump.php < dumpfile.xml

نصب Popups


پیش نیازها:

  1. TextExtracts
  2. PageImages
  3. BetaFeatures
  4. EventLogging
  5. WikimediaEvents





  1 عیب یابی سیستم برای نصب های درگیرشده
  2 sudo dpkg --configure -a
  3 aptitude search ?config-files
  4 sudo aptitude purge ?config-files
  5 
  6 find . -type f -exec chmod 644 {} \;
  7 find . -type d -exec chmod 755 {} \;
  8 the "500 Internal server Error".
  9 
 10 aptitude search ?config-files
 11 aptitude search ?config-files
 12 $wgDBprefix     = "wiki_";
 13 
 14 
 15 #To remove the MySQL database holding your wiki, use the mysql utility to interactively connect to MySQL as a user with adequate permissions, then issue the following command at the mysql> prompt:
 16 DROP DATABASE mediawiki;
 17 
 18 ###########		Capcher 05
 19 
 20 composer update --no-dev
 21 
 22 
 23 
 24 # Verify Memcache Setup
 25 echo "stats settings" | nc localhost 11211
 26 
 27 sudo systemctl restart nginx
 28 
 29 ###########		Capcher 06
 30 
 31 
 32 
 33 
 34 
 35 server {
 36         listen 80 default_server;
 37         listen [::]:80 default_server;
 38 
 39         client_max_body_size 5m;
 40         client_body_timeout 60;
 41 
 42         root /var/www;
 43 
 44         index index.php index.html index.htm index.nginx-debian.html;
 45 
 46         server_name 192.168.1.2;
 47 
 48         location / {
 49                 try_files $uri $uri/ =404;
 50         }
 51 
 52         location ~ \.php$ {
 53                 include snippets/fastcgi-php.conf;
 54                 fastcgi_pass unix:/run/php/php7.2-fpm.sock;
 55         }
 56 
 57         location ^~ /maintenance/ {
 58                  return 403;
 59         }
 60 
 61         location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
 62                   try_files $uri /index.php;
 63                   expires max;
 64                   log_not_found off;
 65         }
 66 <pre”>atom /etc/yum.repos.d/webmin.repo
 67 
 68 
 69         location = /_.gif {
 70                   expires max;
 71                   empty_gif;
 72         }
 73 
 74         location ^~ /cache/ {
 75                   deny all;
 76         }
 77 
 78         location /dumps {
 79                  root /var/www/mediawiki/local;
 80                  autoindex on;
 81         }
 82 
 83 }
 84 
 85 sudo nginx -t
 86 
 87 sudo systemctl restart nginx
 88 
 89 ###########		Capcher 11
 90 sudo aptitude update
 91 
 92 
 93 
 94 
 95 
 96 ###########		Capcher 13
 97 sudo aptitude install phpmyadmin
 98 تب را میزنیم تا از انتخاب مرخص شویم
 99 
100 اوکی میکنیم
101 
102 رمز جدید وارد میکنیم با تکرارش:
103 Mahdipma9027@#
104 
105 sudo ln -s /usr/share/phpmyadmin /var/www/mediawiki/phpmyadmin
106 
107 http://192.168.1.2/phpmyadmin
108 
109 
110 
111 ###########		Capcher 14
112 برای یافتن آی دی:
113 ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
114 
115 sudo mv /home/sokot/www/mediawiki/phpmyadmin /home/sokot/www/mediawiki/pma_none
116 
117 sudo apt install apache2-utils -y
118 
119 sudo htpasswd -c /etc/nginx/.htpasswd sokot
120 wUv3iJKjSRn2aUFnE6HfI
121 
122 cat /etc/nginx/.htpasswd
123 ------------------------------
124 
125 
126 sudo mysql -u root
127 show grants for phpmyadmin@localhost;
128 
129 ## how to fix error 403:
130 location /pma_none {
131 index index.php;
132 }
133 
134 
135 
136 ###########		Capcher 16
137 fix error phpmyadmin:
138 
139 sudo cp /usr/share/phpmyadmin/libraries/sql.lib.php /usr/share/phpmyadmin/libraries/sql.lib.php.bak
140 sudo atom /usr/share/phpmyadmin/libraries/sql.lib.php
141 search for (count($analyzed_sql_results['select_expr'] == 1)
142 Replace it with ((count($analyzed_sql_results['select_expr']) == 1)
143 ###########		Capcher 17
144  
145 
146 
147 git clone https://github.com/wikimedia/mediawiki-extensions-CategoryTree.git CategoryTree --branch REL1_33
148 git pull
149 git submodule update --init --recursive
150 
151 wfLoadExtension( 'CategoryTree' );
152 ----------------------------------------------
153 git clone https://github.com/wikimedia/mediawiki-extensions-WikiEditor.git WikiEditor --branch REL1_33
154 
155 wfLoadExtension( 'WikiEditor' );
156 $wgHiddenPrefs[] = 'usebetatoolbar';
157 $wgDefaultUserOptions['usebetatoolbar'] = 1;
158 ----------------------------------------------
159 
160 git clone https://github.com/wikimedia/mediawiki-extensions-CirrusSearch.git CirrusSearch --branch REL1_33
161 
162 cd CirrusSearch
163 
164 composer install --no-dev
165 
166 git clone https://github.com/wikimedia/mediawiki-extensions-Elastica.git Elastica --branch REL1_33
167 
168 cd Elastica
169 
170 composer install
171 
172 sudo aptitude install openjdk-11-jre
173 
174 فایل دانلود در درایو دی هستش:
175 
176 https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html
177 
178 sudo /bin/systemctl daemon-reload
179 sudo /bin/systemctl enable elasticsearch.service
180 
181 sudo systemctl start elasticsearch.service
182 sudo systemctl stop elasticsearch.service
183 sudo systemctl status elasticsearch.service
184 
185 sudo journalctl -f
186 sudo journalctl --unit elasticsearch
187 sudo journalctl --unit elasticsearch --since  "2016-10-30 18:17:16"
188 
189 #test
190 curl -X GET "localhost:9200/"
191 ---------------------------------
192 
193 ----------------------------------
194 
195 ----------------------------------
196 git clone https://github.com/wikimedia/mediawiki-extensions-Interwiki.git Interwiki --branch REL1_33
197 
198 git pull
199 git submodule update --init --recursive
200 ----------------------------------
201 git clone https://github.com/wikimedia/mediawiki-extensions-Cite.git Cite --branch REL1_33
202 
203 git pull
204 git submodule update --init --recursive
205 
206 wfLoadExtension( 'Cite' );
207 ----------------------------------
208 git clone https://github.com/wikimedia/mediawiki-extensions-CharInsert.git CharInsert --branch REL1_33
209 git checkout REL1_33
210 git pull
211 git submodule update --init --recursive
212 ----------------------------------
213 git clone https://github.com/wikimedia/mediawiki-skins-MinervaNeue.git MinervaNeue --branch REL1_33
214 git checkout REL1_33
215 git pull
216 git submodule update --init --recursive
217 ----------------------------------
218 
219 
220 git clone https://github.com/wikimedia/mediawiki-extensions-TemplateStyles.git TemplateStyles
221 git checkout REL1_33
222 composer update --no-dev
223 git pull
224 git submodule update --init --recursive
225 ----------------------------------
226 Install Flow:
227 
228 git clone https://github.com/wikimedia/mediawiki-extensions-Flow.git Flow
229 
230 cd Flow
231 
232 git checkout REL1_33
233 
234 git pull
235 
236 git submodule update --init --recursive
237 
238 PHP Fatal error running update.php: "Class 'Pimple\Container' not found"
239 https://phabricator.wikimedia.org/T158157
240 
241 composer update --no-dev
242 
243 1- Make sure that all 😂Required Dependencies😃 are set up and configured.
244 
245 2- php /home/sokot/www/mediawiki/maintenance/update.php --quick
246 
247 3- cd home/sokot/www/mediawiki
248 
249 4-1 php maintenance/populateContentModel.php --wiki=write --ns=1 --table=revision
250 4-2 php maintenance/populateContentModel.php --wiki=write --ns=1 --table=archive
251 4-3 php maintenance/populateContentModel.php --wiki=write --ns=1 --table=page
252 
253 4-4 php maintenance/populateContentModel.php --wiki=write --ns=3 --table=revision
254 4-5 php maintenance/populateContentModel.php --wiki=write --ns=3 --table=archive
255 4-6 php maintenance/populateContentModel.php --wiki=write --ns=3 --table=page
256 
257 4-0-1 For delete😮 table:
258     php maintenance/populateContentModel.php --wiki=write --ns=all --table=revision
259     php maintenance/populateContentModel.php --wiki=write --ns=all --table=archive
260     php maintenance/populateContentModel.php --wiki=write --ns=all --table=page
261 
262 5- Add to LocalSettings.php
263 	$wgNamespaceContentModels[NS_TALK] = 'flow-board';
264 	$wgNamespaceContentModels[NS_USER_TALK] = 'flow-board';
265 
266 6- $wgGroupPermissions['write']['flow-create-board'] = true;
267 
268 7- 
269 $wgFlowHelpPage	= '//www.mediawiki.org/wiki/Special:MyLanguage/Help:Extension:Flow';
270 
271 $wgFlowCluster = false;
272 $wgFlowDefaultWikiDb = false;
273 $wgFlowExternalStore = false;
274 $wgFlowContentFormat = 'html';
275 $wgFlowParsoidURL = "null";
276 $wgFlowParsoidPrefix = "null";
277 $wgFlowParsoidTimeout = "null";
278 
279 $wgFlowParsoidForwardCookies = false;
280 $wgFlowDefaultWorkflow = "discussion";
281 $wgFlowDefaultLimit = "10";
282 $wgFlowMaxLimit = "100";
283 $wgFlowMaxMentionCount = "100";
284 $wgFlowMaxThreadingDepth = "8";
285 $wgFlowEditorList = array( 'visualeditor', 'wikitext' );
286 $wgFlowUseMemcache = false;
287 $wgFlowCacheTime = "60 * 60 * 24 * 3";
288 $wgFlowCacheVersion = "4.7";
289 $wgFlowSearchServers = array( 'localhost' );
290 $wgFlowSearchEnabled = true;
291 $wgFlowAbuseFilterGroup = 'flow';
292 $wgFlowAbuseFilterEmergencyDisableThreshold ="0.10";
293 $wgFlowAbuseFilterEmergencyDisableCount = "50";
294 $wgFlowAbuseFilterEmergencyDisableAge = "86400"; // One day.
295 $wgFlowAjaxTimeout = "30";
296 $wgFlowCoreActionWhitelist = array( 'info', 'protect', 'unprotect', 'unwatch', 'watch', 'history', 'wikilove', 'move', 'delete' );
297 $wgFlowServerCompileTemplates = false;
298 $wgFlowEventLogging = false;
299 
300 8- https://www.mediawiki.org/wiki/API:Changing_wiki_content#Possible%20errors
301 
302 
303 
304 
305 
306 
307 git checkout REL1_33

منابع

  1. «آموزش برای تنظیم و پیکربندی VMware». www.wikihz.ir.