在Arch Linux上使用Makepkg
在Arch Linux上使用Makepkg可以避免系统污染,确保仅安装必要的依赖关系。
Vanilla是一个用PHP编写的简单讨论论坛。Vanilla源代码公开托管在Github上。本指南将引导您在使用PHP,MariaDB作为数据库以及Nginx作为Web服务器的新Fedora 29 Vultr服务器实例上完成Vanilla安装过程。
香草论坛推荐的软件堆栈:
mbstringcurlgdPDOmysqliopenssl。检查Fedora版本。
cat /etc/fedora-release
# Fedora release 29 (Twenty Nine)
创建一个non-root具有sudo访问权限的新用户帐户并切换到该帐户。
useradd -c "John Doe" johndoe && passwd johndoe
usermod -aG wheel johndoe
su - johndoe
注意:用您的用户名替换johndoe。
设置时区。
timedatectl list-timezones
sudo timedatectl set-timezone 'Region/City'
确保您的系统是最新的。
sudo dnf check-update; sudo dnf update -y
如果未安装一些基本的系统管理软件包,请安装它们。
sudo dnf install -y vim curl wget git unzip bash-completion
为简单起见,请禁用SELinux和防火墙。
sudo setenforce 0;sudo systemctl stop firewalld;sudo systemctl disable firewalld
安装PHP 7.2和PHP扩展。
sudo dnf install -y php-cli php-fpm php-common php-mbstring php-curl php-gd php-pdo php-mysqlnd php-json
检查版本。
php --version
# PHP 7.2.14 (cli) (built: Jan 8 2019 09:59:17) ( NTS )
# Copyright (c) 1997-2018 The PHP Group
# Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
检查已安装的PHP扩展。
php -m
# mbstring
# curl
# gd
# PDO
# mysqli
# openssl
# . . .
启动并启用PHP-FPM。
sudo systemctl start php-fpm.service
sudo systemctl enable php-fpm.service
安装MariaDB。
sudo dnf install -y mariadb-server
检查版本。
mysql --version
# mysql Ver 15.1 Distrib 10.3.11-MariaDB, for Linux (x86_64) using readline 5.1
启动并启用MariaDB。
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
运行mysql_secure_installation脚本以提高MariaDB安装的安全性。
sudo mysql_secure_installation
以root用户身份登录MariaDB。
mysql -u root -p
# Enter password:
创建一个新的数据库和用户。记住该新用户的凭据。
CREATE DATABASE dbname;
GRANT ALL ON dbname.* TO 'username' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit;
安装Nginx。
sudo dnf install -y nginx
检查版本。
nginx -v
# nginx version: nginx/1.14.1
启动并启用Nginx。
sudo systemctl start nginx.service
sudo systemctl enable nginx.service
配置Nginx for Vanilla论坛。
sudo vim /etc/nginx/conf.d/vanilla.conf
使用以下配置填充文件。
server {
listen 80;
server_name forum.example.com;
root /var/www/vanilla;
index index.php;
location ~* /\.git { deny all; return 403; }
location /build/ { deny all; return 403; }
location /cache/ { deny all; return 403; }
location /cgi-bin/ { deny all; return 403; }
location /uploads/import/ { deny all; return 403; }
location /conf/ { deny all; return 403; }
location /tests/ { deny all; return 403; }
location /vendor/ { deny all; return 403; }
location ~* ^/index\.php(/|$) {
include default.d/php.conf;
fastcgi_param SCRIPT_NAME /index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root/index.php;
fastcgi_param X_REWRITE 1;
fastcgi_pass 127.0.0.1:9000;
}
location ~* \.php(/|$) {
rewrite ^ /index.php$uri last;
}
location / {
try_files $uri $uri/ @vanilla;
}
location @vanilla {
rewrite ^ /index.php$uri last;
}
}
测试配置。
sudo nginx -t
重新加载Nginx。
sudo systemctl reload nginx.service
创建一个文档根目录。
sudo mkdir -p /var/www/vanilla
将/var/www/vanilla目录的所有权更改为johndoe。
sudo chown -R johndoe:johndoe /var/www/vanilla
导航到文档根目录。
cd /var/www/vanilla
下载最新的Vanilla论坛。
wget https://open.vanillaforums.com/get/vanilla-core-2.6.4.zip
解压缩并删除压缩文件。
unzip vanilla-core-2.6.4.zip
rm vanilla-core-2.6.4.zip
提供适当的所有权。
sudo chown -R nginx:nginx /var/www/vanilla
运行sudo vim /etc/php-fpm.d/www.conf并将用户和组设置为nginx。最初,它将设置为apache。
sudo vim /etc/php-fpm.d/www.conf
# user = nginx
# group = nginx
重新启动PHP-FPM。
sudo systemctl restart php-fpm.service
导航到您在网络浏览器中上传Vanilla的文件夹,然后按照屏幕上的说明完成设置。
在Arch Linux上使用Makepkg可以避免系统污染,确保仅安装必要的依赖关系。
快速学习如何在Ubuntu 16.04上安装OpenSIPS控制面板,为VoIP提供商提供支持的功能。
学习如何在Fedora 28上安装Akaunting,一款适合小型企业和自由职业者的开源会计软件。
使用其他系统?Mailtrain是一个基于Node.js和MySQL / MariaDB构建的开源自托管新闻通讯应用程序。
了解導致Minecraft延遲的原因和解決方案,包括優化伺服器性能和減少滯後的步驟。
勒索軟件攻擊呈上升趨勢,但人工智能能否幫助應對最新的計算機病毒?AI 是答案嗎?在這裡閱讀知道是 AI 布恩還是禍根
ReactOS,一個開源和免費的操作系統,這裡有最新版本。它能否滿足現代 Windows 用戶的需求並打倒微軟?讓我們更多地了解這種老式但更新的操作系統體驗。
Whatsapp 終於為 Mac 和 Windows 用戶推出了桌面應用程序。現在您可以輕鬆地從 Windows 或 Mac 訪問 Whatsapp。適用於 Windows 8+ 和 Mac OS 10.9+
閱讀本文以了解人工智能如何在小型公司中變得流行,以及它如何增加使它們成長並為競爭對手提供優勢的可能性。
最近,Apple 發布了 macOS Catalina 10.15.4 補充更新以修復問題,但似乎該更新引起了更多問題,導致 mac 機器變磚。閱讀這篇文章以了解更多信息