安装 wordpress
安装 apache
sudo apt-get install apache2 sudo apt-get install apache2-utils(可选)
启动
sudo systemctl enable apache2 sudo systemctl start apache2
安装 mariadb
sudo apt-get install mariadb-server sudo apt-get install mariadb-client(可选)
sudo systemctl start mariadb.service sudo systemctl enable mariadb.service
配置 mariadb
sudo mysql_secure_installation
连接 mariadb
sudo mariadb
创建 mariadb 新用户
GRANT ALL ON . TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
刷新权限
FLUSH PRIVILEGES;
退出
exit
测试新用户
mariadb -u admin -p
安装 php
添加仓库(可选)
sudo apt-get install software-properties-common sudo add-apt-repository ppa:ondrej/php
sudo apt install php libapache2-mod-php php-mysql sudo apt install php-curl php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip sudo apt install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-mysql php7.2-gmp php7.2-curl php7.2-intl php7.2-mbstring # 处理语言编码问题 php7.2-xmlrpc # 支持 xmlrpc 客户端发布协议 php7.2-gd # 用来剪切图片
php7.2-xml php7.2-cli php7.2-zip php7.2-cgi
修改 apache 配置,查找 index.php
sudo vi /etc/apache2/mods-enabled/dir.conf
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>
重启 apache
sudo systemctl restart apache2
查看 apache 状态
sudo systemctl status apache2
查看可选的 php 插件
apt search php- | less
查看 php 插件详细信息
apt show package_name
安装 php 插件
sudo apt install php-cli