标签:mysqld 存在 you emerge command win includes 许可证 systemd
MediaWiki是一款基于服务器的自由软件,并获得了 GNU 通用公共许可证 (GPL)的许可。这款软件的设计之目的是使其运行于一个每天拥有百万次点击量网站的大型服务器群组上。
MediaWiki是一款极其强大、具有极强扩展性的软件,也是实现维基(wiki)丰富多彩的功能的一个载体,其使用PHP语言来处理和显示贮存在一个数据库中的数据,譬如MySQL。
维基页面使用MediaWiki的维基文本格式编写,以便使那些不会使用HTML或CSS的用户也能轻松地编辑页面。
当一个用户提交一个页面编辑时,MediaWiki就会将这次动作写入后台数据库,但不会删除之前页面的版本。因此,管理员就可以轻而易举地撤回编辑,以防破坏者或垃圾信息对页面的损坏
You can download a release version of MediaWiki from the official download page: generally, if you‘re using a production environment, you want to be running the stable release.
To download MediaWiki 1.29.0, which is the latest stable release version, to a *nix machine you can use the following command:
[https://en.wikipedia.org/wiki/wget wget] [https://releases.wikimedia.org/mediawiki/1.29/mediawiki-1.29.0.tar.gz https://releases.wikimedia.org/mediawiki/1.29/mediawiki-1.29.0.tar.gz]
Alternatively, using cURL:
curl -O [https://releases.wikimedia.org/mediawiki/1.29/mediawiki-1.29.0.tar.gz https://releases.wikimedia.org/mediawiki/1.29/mediawiki-1.29.0.tar.gz]
The downloaded files are in .tar.gz
format, so they will need to be uncompressed before use. This can be done locally (and then uploaded via FTP) or directly on your server. This is usually done with software such as 7-Zip (free), WinZip, WinRAR or IZArc (free) on Windows. On Linux and Mac OS X, you can untar the file using this command:
tar xvzf mediawiki-*.tar.‘‘‘gz‘‘‘
If you untar the archive as root, you should probably change the ownership afterwards with chown, otherwise the files will end up owned as user # 1000, which may or may not be what you want.
Developers on the other hand should probably download from Git to set up a local repository with the latest code in development. They will also need to manually install dependencies via Composer.
If you have not already uploaded the files to your web server, do so now.
Make sure the "Change file names to lowercase" option for upload is disabled.
Upload the files to your web server‘s web directory either by:
If you installed Apache, the correct directory is specified in your httpd.conf
file (it‘s typically <apache-folder>/htdocs
). Note: This changes in Ubuntu 14.04 with Apache 2.4.7 where the primary config file for Apache server settings and directories is /etc/apache2/apache2.conf
.
If you are using a Linux or Unix server you can instead copy the files to any directory on your server and then make a symbolic link to that folder from your web server‘s web directory.
Rename the uploaded folder to whatever you would like to have in the URL. If your web server is running as http://localhost
for example, renaming to /w/
directory would mean you would access your wiki at http://localhost/w/index.php
. Do not use /wiki/
if you want to use it as a Short URL.(And don‘t set up short URLs until you have run the installation script.)
Note that in certain cases, like when a local repository is set-up using Git, on browsing to index.php
the Linux server might show the "500 Internal server Error". This is possibly a permissions error which can be resolved on changing the file and directory permissions by running the following command in SSH after changing directory to "w":
find . -type f -exec chmod 644 {} \; find . -type d -exec chmod 755 {} \;
This (renamed) folder will now be referred as <MediaWiki-folder>
.
If you already have a database server and know the root password for it, the MediaWiki installation script can create a new database for you. If this is the case, you can skip to the Run the installation script section below. If you don‘t know the root password, for example if you are on a hosted server, you will have to create a new database now. Currently, you must use SQLite, MariaDB/MySQL or PostgreSQL to store the actual contents of your wiki.
MediaWiki will ask you for database and user name and will attempt to create them if they don‘t already exist. If doing so from MediaWiki is impossible, you can do this using various control panels such as PhpMyAdmin, which are often available from shared hosts, or you may be able to use ssh to login to your host and type the commands into a MySQL prompt. See the corresponding documentation. Alternatively, contact your host provider to have them create an account for you.
mysql
, mysqladmin
and mysqld_safe
may need to be amended to include the installation directory of MariaDB/MySQL (for example, by adding /usr/local/mysql/bin/
in front of them).mysqladmin status
. If it is not, run mysqld_safe to start it: sudo mysqld_safe
.
sudo systemctl start mysqld
. You may also wish to enable the mysqld
service with sudo systemctl enable mysqld
, so that the MySQL service is started automatically on startup.mysqladmin -u root password yourpassword
mysql -u root -p
CREATE DATABASE wikidb; GRANT ALL PRIVILEGES ON wikidb.* TO ‘wikiuser‘@‘localhost‘ IDENTIFIED BY ‘password‘;
If your database is not running on the same server as your web server, you need to give the appropriate web server hostname -- mediawiki.example.com in my example -- as follows:
GRANT ALL PRIVILEGES ON wikidb.* TO ‘wikiuser‘@‘mediawiki.example.com‘ IDENTIFIED BY ‘password‘;
Warning: MySQL/MariaDB on UNIX/Linux logs all queries sent to it to a file, which will include the password you used for the user account. If this concerns you, delete your |
Run the installation script
Once all of the above steps are complete, you can complete the installation through a web browser by going to the index.php URI in your browser -- check the instructions mentioned in Manual:Config script.
If needed, you can run the command-line installer or CLI: php maintenance/install.php
.
vi /var/www/wiki/LocalSettings.php
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "my_wiki";
$wgDBuser = "wiki";
$wgDBpassword = "test";
vi /var/www/wiki/includes/DefaultSettings.php
$wgSMTP = array(
‘host‘ => ‘smtp.test.com‘,
‘IDHost‘ => ‘test.com‘,
‘port‘ => ‘25‘,
‘auth‘ => false,
‘username‘ => ,
‘password‘ => ,
);
vi /var/www/wiki/includes/mail/UserMailer.php
add the absolute path: /usr/share/pear/ as:
/usr/share/pear/Mail.php
/usr/share/pear/PEAR.php
/usr/share/pear/Net/SMTP.php
/usr/share/pear/Net/Socket.php
/usr/share/pear/Auth/SASL.php
/usr/share/pear/Mail/smtp.php
/usr/share/pear/Mail/mime.php
/usr/share/pear/Mail/mimePart.php
MediaWiki is ready to accept extensions just after installation is finished. To add an extension follow these steps:
Before you start
Download your extension.
extensions/
. A list of extensions stored in the Wikimedia Git repository is located at git:mediawiki/extensions. Some extensions don‘t use version control and are not recommended.Install your extension..
Generally, at the end of the LocalSettings.php file (but above the PHP end-of-code delimiter, "?>
", if present), the following line should be added:
// mw.v 1.24.x or less
require_once "$IP/extensions/extension_name/extension_name.php";
// mw.v 1.25.x or above
wfLoadExtension( ‘<extension-name>‘ );
This line forces the PHP interpreter to read the extension file, and thereby make it accessible to MediaWiki.
Some extensions can conflict with maintenance scripts, for example if they directly access $_SERVER (not recommended).
In this case they can be wrapped in the conditional so maintenance scripts can still run.
//for mw.v 1.24.x or less
if ( !$wgCommandLineMode ) {
require_once "$IP/extensions/extension_name/extension_name.php";
}
//for mw.v 1.25.x or above
if ( !$wgCommandLineMode ) {
wfLoadExtension ( ‘<extension-name>‘ );
}
If you want to enable the notificatio function,you‘ll need to change the following variables in LocalSettings.php
$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO
$wgEmergencyContact = "wiki@test.com";
$wgPasswordSender = "wiki@test.com";
标签:mysqld 存在 you emerge command win includes 许可证 systemd
原文地址:https://www.cnblogs.com/morron/p/8761507.html