CentOS 8.x mediawiki setup new wiki optionally using existing database
From Notes_Wiki
Home > CentOS > CentOS 8.x > Web based tools > mediawiki > setup new wiki optionally using existing database
To setup new mediawiki On CentOS 8.x optionally using existing database use:
- Download latest mediawiki ( https://www.mediawiki.org/wiki/Download )
- 1.37.1 at time of writing this article
- Install web server
- dnf -y install httpd
- systemctl enable httpd
- systemctl start httpd
- Extract the mediawiki in web server document-root or some other appropriate sub-folder
- Based on situation disable SELinux / firewall or set appropriate permissions / firewalls rules to work with SELinux / firewalld.
- Open http://localhost to see HTTP server test / welcome page
- Check php versions available and enable the one most suitable for mediawiki version being setup
-
- dnf module list php
- dnf -y module enable php:8.0
-
- Avoiding use of remi when php-8 is available in normal CentOS repos
- Optionally 'dnf -y module reset php' in case any other php module was enabled earlier
-
- Install php packages required for mediawiki
- dnf -y install php php-mysqlnd php-intl
- dnf -y insstall epel-release
- dnf -y install php-gd
- systemctl restart httpd
- Check if mediawiki setup page is opening in browser properly or not. It should not show errors about missing dependencies.
- Setup Mariadb Database
- dnf -y install mariadb-server
- systemctl enable mariadb
- systemctl start mariadb
- In case of production setups use:
- mysql_secure_installation
- (Optional) If you are upgrading as existing old mediawiki, we can setup the same database, username, password, etc. before starting the setup wizard to achieve upgrade.
- mysql -u root -p
- mysql> create database notes_wiki;
- mysql> grant all on notes_wiki.* to notes_wiki@localhost identified by '<Secret>';
- mysql> flush privileges;
- mysql> quit
- dnf -y install sshpass
- bunzip2 -c notes_wiki.sql.bz2 | /usr/bin/sshpass -p <secret> mysql -u notes_wiki -p notes_wiki
- Go through the wiki web based setup wizard
- Choose language (eg English, English) and click continue
- Enusre no serious warning on Welcome page. "Warning: Could not find APCu or WinCache." is expected. Click continue
- On database page enter database host, username, password, database name, etc. properly and click continue
- (Optional - In case you are doing upgrade) For "There are MediaWiki tables in this database. To upgrade them to MediaWiki 1.37.1, click Continue." messaage click continue.
- Page will appear to freeze. Avoid clicking continue second time and wait for next page to appear
- Use option to renegenerate LocalSettings.php
- Enter Wiki name, username, password, etc. Choose "Ask me more questions"
- Choose appropriate user rights profile and license. Enable required skins and extensions. Enable file upload and give path for deleted files. Avoid enabling caching. Continue.
- mkdir deleted upload path; chmod 777 deleted upload path
- Download LocalSettings.php file and move it to wiki base folder
- Edit LocalSettings.php as per requirements such as:
- $wgServer
- FQDN of final server later on
- wgLogos
- Path to logo Or overwrite logo at <wiki-base-path>/resources/assets/wiki.png
- $wgDefaultSkin
- In case you want a different default skin
- Block unauthorized edits by adding following to LocalSettings.php file
- #Block unauthorized edits
- $wgGroupPermissions['*']['createaccount'] = false;
- $wgGroupPermissions['*']['edit'] = false;
- $wgGroupPermissions['*']['createpage'] = false;
- $wgGroupPermissions['*']['createtalk'] = false;
- $wgGroupPermissions['*']['writeapi'] = false;
- Set upload folders and parameters in LocalSettings.php file
- #Setting local directory for upload and its corresponding server URL
- $wgUploadDirectory='/documents/public_html/upload';
- #$wgUploadDirectory='/documents/room-documents/documents/databases/mysql/notes_wiki/upload';
- $wgUploadPath='/notes_wiki/upload';
- #Allow uploads from URL
- $wgAllowCopyUploads=true;
- #Enabling upload
- $wgEnableUploads=true;
- #Do not check for extensions too strictly
- $wgStrictFileExtensions=false;
- $wgFileExtensions = array_merge( $wgFileExtensions,
- array( 'doc', 'xls', 'mpp', 'pdf', 'ppt', 'xlsx', 'jpg',
- 'tiff', 'odt', 'odg', 'ods', 'odp', 'json'
- )
- );
- $wgVerifyMimeType= "false";
- Go to wiki folder and run
- php maintenance/update.php
- Open the new wiki and check everything is as per expectations or not
Refer:
- https://www.server-world.info/en/note?os=CentOS_8&p=php&f=3
- https://www.linode.com/docs/guides/how-to-install-mediawiki-centos-8/s
Home > CentOS > CentOS 8.x > Web based tools > mediawiki > setup new wiki optionally using existing database