Upgrading Mediawiki: Difference between revisions
Tag: wikieditor |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 27: | Line 27: | ||
== Troubleshooting == | == Troubleshooting == | ||
=== eb_deploy === | |||
==== `/etc/letsencrypt` directory not found ==== | |||
'''Symptom:''' | |||
The following error is found after running `eb logs`: | |||
<syntaxhighlight lang="text"> | |||
2022/08/20 16:01:24.558924 [INFO] nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/wiki.dbarchowsky.com/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/wiki.dbarchowsky.com/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file) | |||
nginx: configuration file /var/proxy/staging/nginx/nginx.conf test failed | |||
</syntaxhighlight> | |||
'''Resolution:''' | |||
Edit `/platform/nginx/conf.d/ssl.conf` and comment out the following lines: | |||
<syntaxhighlight> | |||
# Include the Elastic Beanstalk generated locations | |||
include conf.d/elasticbeanstalk/*.conf; | |||
</syntaxhighlight> | |||
Also comment out all keys with paths as values, e.g. `ssl_certificate`, `ssl_certificate_key`, `include`, `ssl_dhparam` | |||
Re-run `eb_deploy` locally. | |||
=== Extensions === | === Extensions === | ||
| Line 41: | Line 67: | ||
If the BacktickCode extension is causing 500 errors, it can be disabled by commenting out the `wfLoadExtension('BacktickCode')` call in `LocalSettings.php`. | If the BacktickCode extension is causing 500 errors, it can be disabled by commenting out the `wfLoadExtension('BacktickCode')` call in `LocalSettings.php`. | ||
==== AWS ==== | |||
See [[Storing Mediawiki Resources on AWS S3]]. The AWS extension requires a `composer.local.json` file in the Mediawiki web root that includes `composer.json` found within the AWS extension folder. This `composer.local.json` must be copied into the MW distro root before running `./eb_deploy`. | |||
[[Category:MediaWiki]] | [[Category:MediaWiki]] | ||
Latest revision as of 04:28, 25 August 2022
Procedure[edit]
In the following instructions, eb_deploy refers to the shell script found in the littled_wiki project root. Note that eb_deploy is not the same thing as the command eb deploy. Use the shell script and not the eb command.
- Download new wiki distribution to
littled_wikiproject root.- Unzip the archive.
- Make sure that all custom extensions listed in
LocalSettings.phpare present in theextensionsfolder of the new distribution.
- Edit
eb_deploy.- Change
WIKI_DISTRO_DIRto point to the directory containing the new wiki distribution.
- Change
- Make backup of previous wiki configuration
- Backup the current wiki database.
- Make sure to save a copy of the current
LocalSettings.phpfor the wiki to migrate any custom settings to the new wiki distribution.
- Run
eb_deploy. - Connect to the wiki on the live server.
- Go through the installation steps to create
LocalSettings.php. - Download the newly created
LocalSettings.phpfrom the server to[littled_wiki_PROJECT_ROOT]/wiki_config/
- Go through the installation steps to create
- Migrate settings from previous
LocalSettings.phpto the new file.- Database settings, e.g.
$wgDBServer = getenv('MEDIAWIKI_DB_SERVER'); - Do not store any sensitive information in the configuration file.
- Custom extensions which would be found at the very end of the file.
- Database settings, e.g.
Upgrading the database[edit]
Some MediaWiki updates may require database updates especially related to specific MediaWiki extensions.
In order to force the database to update, upload the boilerplate LocalSettings.php included in the MediaWiki distribution. When the wiki is next visited, it will prompt for a full configuration including user and database settings. After completing this set up, download the LocalSettings.php file and merge it with the previous working version.
Troubleshooting[edit]
eb_deploy[edit]
/etc/letsencrypt directory not found[edit]
Symptom:
The following error is found after running eb logs:
2022/08/20 16:01:24.558924 [INFO] nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/wiki.dbarchowsky.com/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/wiki.dbarchowsky.com/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /var/proxy/staging/nginx/nginx.conf test failed
Resolution:
Edit /platform/nginx/conf.d/ssl.conf and comment out the following lines:
# Include the Elastic Beanstalk generated locations
include conf.d/elasticbeanstalk/*.conf;
Also comment out all keys with paths as values, e.g. ssl_certificate, ssl_certificate_key, include, ssl_dhparam
Re-run eb_deploy locally.
Extensions[edit]
BacktickCode[edit]
Enabling the BacktickCode extension in LocalSettings.php causes a 500 error.
Search for "Mediawiki backtick" will point to this page. The information on that page is out of date.
The current version of Mediawiki loads extensions with wfLoadExtension() not $wgHooks. Make sure the code for BacktickCode uses a class named BacktickCode and not $wgHooks.
Also, the current Mediawiki distribution requires an extension.json file in the extension directory. The directory without this file will result in a 500 error.
If the BacktickCode extension is causing 500 errors, it can be disabled by commenting out the wfLoadExtension('BacktickCode') call in LocalSettings.php.
AWS[edit]
See Storing Mediawiki Resources on AWS S3. The AWS extension requires a composer.local.json file in the Mediawiki web root that includes composer.json found within the AWS extension folder. This composer.local.json must be copied into the MW distro root before running ./eb_deploy.