52杰奇论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 5201|回复: 0

小白搭建论坛carbon-Forum教程

[复制链接]

597

主题

251

回帖

100万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1004945
发表于 2022-4-23 16:00:00 | 显示全部楼层 |阅读模式
简介
  • Carbon—Forum 是一个 PHP 的论坛程序。至于 UI 大家就不要吐槽了,作者的重心在性能优化,自己点开就能发现比其他论坛程序都要快很多~ 美工就需要各位自己修改啦。
    官方 Demo 地址:https://www.94cb.com/
  • 演示图

搭建过程基础环境搭建
  • 如果想要搭建这个论坛,首先需要搭建基于 PHP7.0 的 LNMP 环境(个人比较喜欢 nginx)
    推荐使用 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 configurationerror_page 404 /404.php;# rewritelocation / {    try_files $uri $uri/ /index.php?$query_string;}# Git folder vulnerabilitylocation /.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安装
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|52杰奇论坛  

GMT+8, 2024-4-27 21:01 , Processed in 0.671578 second(s), 24 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表