本篇文章介绍用LNPM架构部署知乎产品Wecenter,源码带注册、登录、发问题、评论各种功能,话不多说,直接开始!
第一步:配置Nginx虚拟主机站点,域名为wecenter.koten.com
[root@Web01 code]# vim /etc/nginx/conf.d/wecenter.conf
server {
listen 80;
server_name wecenter.koten.com;
root /code/wecenter;
index index.php index.html;
location ~ \.php$ {
root /code/wecenter;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fa
stcgi_script_name;
include fastcgi_params;
}
}
<conf.d/wecenter.conf" [New] 14L, 407C written
[root@Web01 code]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@Web01 code]# systemctl restart nginx
第二步:导入wecenter产品,部署wecenter并授权(wecenter下载见文末)
[root@Web01 code]# rz -E
rz waiting to receive.
[root@Web01 code]# mkdir wecenter
[root@Web01 code]# unzip WeCenter_V3.6.2.zip -d wecenter/
[root@Web01 code]# chown -R www.www /code/wecenter/
第三步:手动建立数据库
[root@Web01 wecenter]# mysql -uroot -pkoten.vip -e "create database wecenter"
[root@Web01 wecenter]# mysql -uroot -pkoten.vip -e "show databases"
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
| wecenter |
| wordpress |
+--------------------+
第四步:windows本地hosts解析后访问wecenter.koten.com得到如下安装流程
大功告成!
Wecenter下载链接:https://pan.baidu.com/s/1r3DrUWqlGVizQ8P_diTfrw?pwd=ejlp
我是koten,10年运维经验,持续分享运维干货,感谢大家的阅读和关注!