简介

  • Carbon—Forum是一个PHP的论坛程序。至于UI大家就不要吐槽了,作者的重心在性能优化,自己点开就能发现比其他论坛程序都要快很多~美工就需要各位自己修改啦。
    官方Demo地址:https://www.94cb.com/

  • 演示图

演示

搭建过程

基础环境搭建

  • 如果想要搭建这个论坛,首先需要搭建基于PHP7.0的LNMP环境(个人比较喜欢nginx)
    搭建LNMP环境参考这个教程:https://qiujunya.com/aptgetlnmp.html
    推荐使用oneinstack

程序下载

数据库

  • mysql里创建一个数据库
mysql -u root -p

输入密码后,输入:

create database carbon;

这样就建了一个名字叫carbon的数据库。

配置nginx

  • 在 /etc/nginx/sites-available/里新建一个文件:
vi carbon

然后贴以下nginx配置,注意更换域名:

server {
 listen 80;
 listen [::]:80;
 root /var/www/carbon;
# Add index.php to the list if you are using PHP
 index index.php index.html index.htm index.nginx-debian.html;
 server_name test.abc.com;
# nginx configuration
error_page 404 /404.php;
# rewrite
location / {
    try_files $uri $uri/ /index.php?$query_string;
}
# Git folder vulnerability
location /.git {
    deny all;
    return 403;
}
location /controller {
    deny all;
    return 403;
}
location /docker_resources {
    deny all;
    return 403;
}
location /library {
    deny all;
    return 403;
}
location /service {
    deny all;
    return 403;
}
location /view {
    deny all;
    return 403;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
   deny all;
   return 403;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
 location ~ \.php$ {
 include snippets/fastcgi-php.conf;
#
## With php7.0-cgi alone:
 fastcgi_pass 127.0.0.1:9000;
## With php7.0-fpm:
# fastcgi_pass unix:/run/php/php7.0-fpm.sock;
 }

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
}

然后创建软链使其生效:

ln -s /etc/nginx/sites-available/carbon /etc/nginx/sites-enabled/

然后nginx -t排错一下,然后重启nginx:

service nginx restart

安装

文章参考:小白搭建论坛carbon-Forum教程