标签:sites write lob student direction desire directive directory install
sudo apt update
sudo apt upgrade
sudo apt install apache2
sudo ufw app list
sudo ufw app info "Apache Full"
sudo ufw allow in "Apache Full"
http://localhost
sudo apt install curl
curl http://icanhazip.com
sudo apt install mysql-server
sudo mysql_secure_installation
sudo apt install php libapache2-mod-php php-mysql
apt search php- | less
sudo vim /var/www/html/info.php
<?php
phpinfo();
?>
http://localhost/info.php
sudo apt install php-apcu php-cli php-curl php-gd php-intl php-mbstring php-pear php-xml
pear list
sudo pear install Net_Socket
sudo pear install Mail
sudo pear install Net_SMTP
sudo apt install imagemagick
sudo apt install texlive
sudo apt install git
sudo systemctl reload apache2
sudo systemctl restart apache2
curl -O https://releases.wikimedia.org/mediawiki/1.30/mediawiki-1.30.0.tar.gz
tar xvzf mediawiki-*.tar.gz
sudo mkdir /var/www/html/w
sudo mv mediawiki-1.30.0/* /var/www/html/w
sudo mysql -u root -p
CREATE DATABASE wikidb;
GRANT ALL PRIVILEGES ON wikidb.* TO ‘wikiuser‘@‘localhost‘ IDENTIFIED BY ‘password‘;
http://localhost/w/index.php
sudo mv LocalSettings.php /var/www/html/w
MediaWiki‘s default page addresses looks like these examples:
http://localhost/w/index.php/Page_title
Short URL
page addresses looks like these examples:
http://localhost/wiki/Page_title
sudo a2enmod rewrite
sudo systemctl restart apache2
cd /etc/apache2/sites-available
sudo cp 000-default.conf mediawiki.conf
sudo vim /etc/apache2/sites-available/mediawiki.conf
<VirtualHost *:80>
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request‘s Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
sudo a2ensite mediawiki.conf
sudo a2dissite 000-default.conf
sudo apache2ctl configtest
sudo systemctl restart apache2
sudo vim /var/www/html/.htaccess
## http://www.mediawiki.org/wiki/Manual:Short_URL/Apache
# Enable the rewrite engine
RewriteEngine On
# Short URL for wiki pages
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
# Redirect / to Main Page
RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
sudo vim /var/www/html/w/LocalSettings.php
## https://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = "/w"; // this should already have been configured this way
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
Troubleshooting
After updating to MediaWiki v1.26 and above, some users started reporting problems with the extension.
$wgPygmentizePath
in LocalSettings.php towards an external pygmentize binary.sudo apt install python
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
sudo pip install Pygments
which pygmentize
/usr/local/bin/pygmentize
sudo vim /var/www/html/w/LocalSettings.php
$wgPygmentizePath = "/usr/local/bin/pygmentize";
How To Install MediaWiki on Ubuntu 14.04
How To Rewrite URLs with mod_rewrite for Apache on Ubuntu 16.04
How To Install the Apache Web Server on Ubuntu 18.04
How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 18.04
INSTALL MEDIAWIKI ON UBUNTU 18.04 LTS WITH APACHE2, MARIADB AND PHP 7.1 SUPPORT
Manual:Installation requirements
How To Install MediaWiki on Ubuntu 18.04 LTS
标签:sites write lob student direction desire directive directory install
原文地址:https://www.cnblogs.com/clipboard/p/14489457.html