How to use archlinux: Difference between revisions

From 清冽之泉
Jump to navigation Jump to search
Line 38: Line 38:
== MediaWiki ==
== MediaWiki ==
<syntaxhighlight lang="bash" line>
<syntaxhighlight lang="bash" line>
pacman -S mediawiki mariadb php apache php-apache php-apcu php-intl
# 安装 MediaWiki 和数据库
 
sudo pacman -S mediawiki mariadb php apache php-apache php-apcu php-intl
sudo chown -R mysql:mysql /var/lib/mysql
sudo chown -R mysql:mysql /var/lib/mysql


Line 54: Line 56:
sudo mariadb_secure_installation
sudo mariadb_secure_installation
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="bash" line>
# 设置服务器
# 去 /etc/webapps/mediawiki 把 apache.example.conf 中第二行删掉,建立 httpd-mediawiki.conf
cd /etc/webapps/mediawiki
grep -v open_basedir apache.example.conf > httpd-mediawiki.conf
Alias /mediawiki "/usr/share/webapps/mediawiki"
php_admin_value open_basedir "/usr/share/webapps/:/tmp/:/usr/bin/"
<Directory "/usr/share/webapps/mediawiki">
    AllowOverride All
    Options FollowSymlinks
    Require all granted
</Directory>

Revision as of 16:50, 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
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

# 设置一下 root 密码
sudo mariadbadmin -u root password YOURPASSWD
history -c

# 或,可选,用脚本设置 root 密码
sudo mariadb_secure_installation

<syntaxhighlight lang="bash" line>

  1. 设置服务器
  1. 去 /etc/webapps/mediawiki 把 apache.example.conf 中第二行删掉,建立 httpd-mediawiki.conf

cd /etc/webapps/mediawiki grep -v open_basedir apache.example.conf > httpd-mediawiki.conf

Alias /mediawiki "/usr/share/webapps/mediawiki" php_admin_value open_basedir "/usr/share/webapps/:/tmp/:/usr/bin/" <Directory "/usr/share/webapps/mediawiki">

   AllowOverride All
   Options FollowSymlinks
   Require all granted

</Directory>