内网服务器部署

前言

这几天实在太忙了,没有更新博客,最近把内网服务器重新装了一遍,下面有一些教程,希望可以帮到大家
本来是想写一篇博客来着,但是奈何我太懒了,其实相关的教程已经比较完善了,所以就直接把我参考的教程的链接写在文章里吧

我自己的安装流程是:2.3(关闭selinux) → 1.1(安装配置Nginx) → 2.1(放通Nginx相关端口) → 1.2(安装配置PHP+扩展) → 1.3(配置Smba) → 1.4(安装Mysql) → 2.1(放通Mysql 3306端口) → 1.5(安装Openvpn) → 2.1(放通Openvpn 1194端口)


1.基础环境

1.1 Nginx

1.1.1.编译安装:https://blog.csdn.net/wenhuangwei/article/details/110685205
缺失 libpcre.so.1:https://blog.csdn.net/weixin_34198797/article/details/92301606
1.1.2.多站点:https://www.yisu.com/zixun/587897.html
1.1.3.注册为系统服务+开机自启:https://blog.csdn.net/lakelise/article/details/89315518
(1.1.4).开启Gzip压缩:https://cloud.tencent.com/developer/article/1696134
注:修改配置后需重启(载)Nginx生效

1.2 PHP

1.2.1.编译安装+注册系统服务:https://blog.csdn.net/qq_16885135/article/details/119811883
No package oniguruma found:https://cyhour.com/1627/
注:修改配置后需重启(载)PHP生效
1.2.2.安装PHP扩展:https://blog.csdn.net/qq_34206560/article/details/81453658

1.3 Smba(SMB协议的Linux版)

必选:关闭 selinux ,教程见本文 系统-selinux
1.3.1.安装配置:https://www.cnblogs.com/muscleape/p/6385583.html (看到步骤三即可)
一般默认配置文件即可,无需修改
1.3.2.放通端口:https://www.cnblogs.com/faberbeta/p/samba002.html
1.3.3.为smba添加用户:useradd 用户名
1.3.4.为smba用户设置密码:smbpasswd 用户名
1.3.5.禁止smb用户登陆终端:smbpasswd 用户名 (可有可无)

1.4 Mysql

1.4.1.安装:https://blog.csdn.net/qq_36582604/article/details/80526287
1.4.2.新建用户,为用户授权,指定用户访问数据库:https://www.cnblogs.com/faberbeta/p/mysql002.html

1.5 Openvpn

1.5.1.安装脚本 https://github.com/linglaoda/Openvpn-deployment 我写的(炫耀.ing)

2.系统

2.1 防火墙

2.1.1 防火墙配置:https://www.cnblogs.com/shawhe/p/9485746.html
注:放通或关闭端口后需要重启防火墙服务生效

2.2 定时任务

2.2.1 Cron表达式生成器:https://cron.qqe2.com/
2.2.2 定时任务配置:https://blog.csdn.net/weixin_45753881/article/details/126181946

2.3 selinux

1
2
3
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config #关闭

sed -i 's/SELINUX=enforcing/SELINUX=enforcing/g' /etc/selinux/config #开启

2.3 后台跑Py脚本

https://zhuanlan.zhihu.com/p/159551493

先写这么多吧,后续再更新~

Author

芙樱竹

Posted on

2022-08-21

Updated on

2024-03-03

Licensed under

Comments

若您使用我站的"评论"功能发表观点,则代表您已阅读并同意遵守 ICUA协议隐私政策