Flarum 安装记录
nginx -v
nginx version: nginx/1.20.0
php -v
PHP 8.0.6 (cli) (built: Jul 15 2021 22:54:55) ( NTS )
Copyright © The PHP Group
Zend Engine v4.0.6, Copyright © Zend Technologies
mysql –version
mysql Ver 15.1 Distrib 10.4.19-MariaDB, for Linux (aarch64) using readline 5.1
Linux
neofetch
andy@hwg
--------
█ █ █ █ █ █ █ █ █ █ █ OS: Armbian buster (20.10) aarch64
███████████████████████ Host: Amlogic Meson G12A U200 Development Board
▄▄██ ██▄▄ Kernel: 5.9.0-arm-64
▄▄██ ███████████ ██▄▄ Uptime: 2 days, 23 hours, 27 mins
▄▄██ ██ ██ ██▄▄ Packages: 562 (dpkg)
▄▄██ ██ ██ ██▄▄ Shell: zsh 5.7.1
▄▄██ ██ ██ ██▄▄ Resolution: 720x576i
▄▄██ █████████████ ██▄▄ Terminal: /dev/pts/0
▄▄██ ██ ██ ██▄▄ CPU: (4) @ 1.800GHz
▄▄██ ██ ██ ██▄▄ Memory: 938MiB / 3630MiB
▄▄██ ██ ██ ██▄▄
▄▄██ ██▄▄
███████████████████████
█ █ █ █ █ █ █ █ █ █ █
Nginx
cat /usr/local/nginx/conf/nginx.conf
user www www;
worker_processes auto;
worker_cpu_affinity auto;
error_log /home/wwwlogs/nginx_error.log crit;
pid /usr/local/nginx/logs/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
multi_accept off;
accept_mutex off;
}
http
{
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
sendfile on;
sendfile_max_chunk 512k;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\.";
#limit_conn_zone $binary_remote_addr zone=perip:10m;
##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.
server_tokens off;
access_log off;
server
{
listen 80 default_server reuseport;
#listen [::]:80 default_server ipv6only=on;
server_name _;
index index.html index.htm index.php;
root /home/wwwroot/default;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log /home/wwwlogs/access.log;
}
include vhost/*.conf;
}
cat /usr/local/nginx/conf/vhost/flarum.conf
server
{
listen 80;
#listen [::]:80;
server_name flarum ;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/flarum/public;
include /home/wwwroot/flarum/.nginx.conf;
include rewrite/other.conf;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log /home/wwwlogs/flarum.log;
location /api {
try_files $uri $uri/ /api.php?$query_string;
}
location /flarum {
deny all;
return 404;
}
location ~ .php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
MariaDB
sudo lnmp database list
+--------------------+
| Database |
+--------------------+
| flarum |
| information_schema |
| mysql |
| performance_schema |
| zblog |
+--------------------+
PHP
cat /usr/local/php/etc/php.ini
disable_funtions= ... 删除 proc_open,proc_get_status ...
Composer
cd /home/wwwroot/
composer create-project flarum/flarum flarum/
绿色通过无报错~
权限调整
sudo chown -R www.www flarum/public flarum/storage
sudo chmod -R 755 flarum
网站文件
cd /home/wwwroot/
ls -alt flarum
total 380
drwxr-xr-x 5 root root 4096 Jul 18 21:49 .
drwxr-xr-x 38 root root 4096 Jul 18 21:14 vendor
-rwxr-xr-x 1 root root 328997 Jul 18 21:14 composer.lock
drwxr-xr-x 4 root root 4096 Jul 18 21:14 ..
-rwxr-xr-x 1 root root 1757 May 27 16:54 CHANGELOG.md
-rwxr-xr-x 1 root root 1225 May 27 16:54 composer.json
-rwxr-xr-x 1 root root 361 May 27 16:54 .editorconfig
-rwxr-xr-x 1 root root 265 May 27 16:54 extend.php
-rwxr-xr-x 1 root root 634 May 27 16:54 flarum
-rwxr-xr-x 1 root root 1168 May 27 16:54 LICENSE
-rwxr-xr-x 1 root root 1764 May 27 16:54 .nginx.conf
drwxr-xr-x 3 www www 4096 May 27 16:54 public
-rwxr-xr-x 1 root root 2665 May 27 16:54 README.md
-rwxr-xr-x 1 root root 1800 May 27 16:54 site.php
drwxr-xr-x 10 www www 4096 May 27 16:54 storage
客户端
cat /etc/hosts
HTTP ERROR 500,😂说好的安装引导界面呢~