How to use archlinux: Difference between revisions
Jump to navigation
Jump to search
Line 62: | Line 62: | ||
=== Apache 服务器 === | === Apache 服务器 === | ||
<syntaxhighlight lang="apache" line> | <syntaxhighlight lang="apache" line> | ||
cd /etc/webapps/mediawiki | cd /etc/webapps/mediawiki | ||
sudo touch httpd-mediawiki.conf | |||
# 内容如下: | |||
Alias /mediawiki "/usr/share/webapps/mediawiki" | Alias /mediawiki "/usr/share/webapps/mediawiki" | ||
<Directory "/usr/share/webapps/mediawiki"> | <Directory "/usr/share/webapps/mediawiki"> | ||
Line 76: | Line 73: | ||
</Directory> | </Directory> | ||
sudo touch /usr/share/webapps/mediawiki/.htaccess | |||
# 内容如下: | |||
order allow,deny | order allow,deny | ||
allow from all | allow from all | ||
sudo emacs /etc/httpd/conf/httpd.conf | |||
# 添加以下 | |||
LoadModule php_module modules/libphp.so | LoadModule php_module modules/libphp.so | ||
Include conf/extra/php_module.conf | Include conf/extra/php_module.conf | ||
Include /etc/webapps/mediawiki/httpd-mediawiki.conf | Include /etc/webapps/mediawiki/httpd-mediawiki.conf | ||
#LoadModule mpm_event_module modules/mod_mpm_event.so | # 注释掉 mpm_event_module 这一行,启用 mpm_prefork_module 这一行 | ||
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | #LoadModule mpm_event_module modules/mod_mpm_event.so | ||
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | |||
sudo emacs /etc/php/php.ini | |||
# C-s 在合适位置设置如下 | |||
open_basedir = "/tmp:/usr/share/webapps/:/var/lib/mediawiki" | open_basedir = "/tmp:/usr/share/webapps/:/var/lib/mediawiki" | ||
extension=gd.so | extension=gd.so |
Revision as of 20:59, 1 April 2025
《Archlinux 怎么用》
初级配置
# VirtualBox
sudo pacman -S virtualbox-guest-utils linux-headers
sudo systemctl enable vboxservice.service
sudo systemctl start vboxservice.service
# 中文
sudo pacman -S wqy-microhei
sudo nano /etc/locale.gen
去掉 zh_CN.UTF-8 UTF-8 前的 # 号
sudo locale-gen
软件相关
# 更新系统 Sync refresh upgrade
sudo pacman -Syu
# 查找 Sync search
pacman -Ss
# 查看 Query
pacman -Qs
# 安装
sudo pacman -S
# 卸载软件 Remove
sudo pacman -R
# 卸载无用依赖
sudo pacman -Rns
MediaWiki
MediaWiki 本体
sudo pacman -S mediawiki mariadb php apache php-apache php-apcu php-intl
MariaDB 数据库
sudo chown -R mysql:mysql /var/lib/mysql
# 创建 root@localhost mysql@localhost,两个账号都无密码
sudo mariadb-install-db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/
systemctl start mysqld
systemctl enable mysqld
systemctl status mysqld
# 设置一下 root 密码
sudo mariadbadmin -u root password YOURPASSWD
history -c
# 或,可选,用脚本设置 root 密码
sudo mariadb_secure_installation
Apache 服务器
cd /etc/webapps/mediawiki
sudo touch httpd-mediawiki.conf
# 内容如下:
Alias /mediawiki "/usr/share/webapps/mediawiki"
<Directory "/usr/share/webapps/mediawiki">
AllowOverride All
Options FollowSymlinks
Require all granted
</Directory>
sudo touch /usr/share/webapps/mediawiki/.htaccess
# 内容如下:
order allow,deny
allow from all
sudo emacs /etc/httpd/conf/httpd.conf
# 添加以下
LoadModule php_module modules/libphp.so
Include conf/extra/php_module.conf
Include /etc/webapps/mediawiki/httpd-mediawiki.conf
# 注释掉 mpm_event_module 这一行,启用 mpm_prefork_module 这一行
#LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
sudo emacs /etc/php/php.ini
# C-s 在合适位置设置如下
open_basedir = "/tmp:/usr/share/webapps/:/var/lib/mediawiki"
extension=gd.so
extension=intl.so
extension=iconv.so
extension=mysqli.so