运行环境及版本
- 操作系统版本:CentOS7.x 64bit
- 服务器推荐配置:4核8G
- 版本信息环境版本Nginx1.20.2Mysql5.7.30Redis6.0.4PHP7.2.18
- 获取环境安装包
cd /homewget https://qiniu.feelec.net/install/open/install.zip
- 解压环境安装包
unzip install
- 执行安装脚本
cd installchmod -R 755 install.shsh install.sh
输入数字 1,等待安装完成
服务配置
- Redis配置- 管理命令【检查Redis】
systemctl start redis.service
【检查Redis】systemctl status redis.service
【停止Redis】systemctl stop redis.service
- 默认端口和密码port: 6379requirepass: FeelDesk
- 修改redis密码和端口vim /www/server/redis/redis7001.conf
修改如下内容:port 6379requirepass 密码
- 重启redissystemctl restart redis.service
- 检查redis是否启动netstat -untpa | grep 6379
如图所示:
- Mysql配置- 管理命令【启动mysql】
systemctl start mysqld
【检查mysql】systemctl status mysqld
【停止mysql】systemctl stop mysqld
- 查看初始密码grep "password" /www/server/mysql/log/mysqld.log
- 修改密码mysql -uroot -p 初始密码mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';mysql> exitmysql -uroot -p 新密码
- 新建数据库mysql> create database ticket;mysql> source /www/project/ticket/Sql/ticket.sql
- 创建用户并授权数据库mysql> grant all privileges on `ticket`.* to`ticket`@`localhost` identified by '你的密码' with grant option;mysql> flush privileges;mysql> exit;
- Nginx配置
vim /www/server/nginx/feelec/ticket.conf
加入如下内容:server{ listen 80; # 配置HTTPS listen 443 ssl; if ($server_port !~ 443){ rewrite ^(/.*)$ https://$host$1 permanent; } ssl_certificate /www/server/nginx/ssl/ticket.pem; ssl_certificate_key /www/server/nginx/ssl/ticket.key; ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; add_header Strict-Transport-Security "max-age=31536000"; # 配置域名及项目路径 server_name 你的域名; root /www/project/ticket/Web; index index.php index.html; # 配置fastcgi模式 location ~ ^/index\.php$ { root /www/project/ticket/Web; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } # 配置伪静态 location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } # 安全配置 if ($request_uri ~* "php") { return 404; } if ($request_uri ~* "ph70%") { return 404; } location ~ .*\.log$ { deny all; } # 配置日志路径 access_log /www/server/nginx/logs/ticket-access.log; error_log /www/server/nginx/logs/ticket-error.log; }
重启Nginxsystemctl restart nginx.service
代码配置
- Gitee安装
yum -y install gitmkdir -p /www/project/ticketcd /www/project/ticketgit https://gitee.com/feelecs/feeldesk-dev-base.gitmkdir -p /ticket/App/Feeldesk/Runtimechmod -R 777 /ticket/App/Feeldesk/Runtimechmod -R 777 /ticket/Web/Attachs
- 配置HTTP协议和系统域名
vim /www/project/ticket/App/Feeldesk/Common/Conf/define.php
如图所示,修改红框中的内容
- 配置数据库
vim /www/project/ticket/App/Feeldesk/Common/Conf/database.php
如图所示,修改红框中的内容
- 配置Redis
vim /www/project/ticket/App/Feeldesk/Common/Conf/redis.php
如图所示,修改红框中的内容
- 配置Socket
vim /www/project/ticket/App/Feeldesk/Common/Conf/socket.php
如图所示,修改红框中的内容 - 配置端口在防火墙和服务器安全组中放行端口:80、443、5050、5051
- 启动服务
chmod +x /www/project/ticket/Shell/*sh /www/project/ticket/Shell/ticket-server.sh
- 检查Socket服务
ps -ef | grep WorkerMan
如图所示
- 检查Message服务
ps -ef | grep message
如图所示
开始使用
- 浏览器打开:http(s)//:你的域名,如图:
登录账号:18288880000
登录密码:123456
本文转载自: https://blog.csdn.net/LAOLIUSHUO/article/details/128119765
版权归原作者 LAOLIUSHUO 所有, 如有侵权,请联系我们删除。
版权归原作者 LAOLIUSHUO 所有, 如有侵权,请联系我们删除。