day09 samba、nginx服务配置
2024-08-23 08:34:47
samba
1.环境准备
[root@localhost ~]# iptables -F #清除防火墙配置
[root@localhost ~]# systemctl stop firewalld #关闭防火墙
[root@localhost ~]# setenforce #关闭策略组,临时
[root@localhost ~]# vim /etc/sysconfig/selinux #文件中关闭策略组
[root@localhost ~]# systemctl status firewalld #查看防火墙状态
2.安装软件包
[root@localhost ~]# yum -y install samba #yum 安装samba
3.修改配置配置
[root@localhost ~]# vim /etc/samba/smb.conf #修改 samba 配置文件
[public]
comment = Public Stuff
path = /home/samba
public = yes
writable = yes
printable = no
write list = +staff
[root@localhost ~]# mkdir /home/samba #创建 public 公共目录
增加用户
[root@localhost ~]# smbpasswd -a jack # 用户名一定要是系统用户
New SMB password:
Retype new SMB password:
Added user jack.
补充知识
vim /etc/hosts 写入一条关于本地解析的命令
hostname 查看本机名
hostname set-hostname 设置主机名
增加samba链接的速度
vim /etc/ssh/sshd_config //UseDNS 改成no
systemctl restart sshd
增加xshell连接速度
4.启动服务
[root@localhost ~]# systemctl start smb
5.测试
nginx
1.准备环境
[root@localhost ~]# iptables -F #清除防火墙配置
[root@localhost ~]# systemctl stop firewalld #关闭防火墙
[root@localhost ~]# setenforce 0 #关闭策略组,临时
[root@localhost ~]# vim /etc/sysconfig/selinux #文件中关闭策略组
[root@localhost ~]# systemctl status firewalld #查看防火墙状态
[root@bogon ~]# yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel
# 安装依赖库
2.安装软件包
2.1 从 http://nginx.org/download/nginx-1.12.0.tar.gz 下载 nginx 的 压缩包
[root@bogon ~]# wget http://nginx.org/download/nginx-1.12.0.tar.gz -P /root/Downloads/
# 从网上下载 nginx 压缩的源码文件,保存路径为 /root/Downloads/
[root@bogon ~]# cd /root/Downloads/ #进入下载目录
[root@bogon Downloads]# ll #查看所有文件
总用量 17444
-rw-r--r--. 1 root root 980831 Apr 12 08:11 nginx-1.12.0.tar.gz
drwxr-xr-x. 18 501 501 4096 May 28 19:23 Python-3.6.1
-rw-r--r--. 1 root root 16872064 Mar 21 00:47 Python-3.6.1.tar.xz
[root@bogon Downloads]# tar xzf nginx-1.12.0.tar.gz # 解压
[root@bogon Downloads]# cd nginx-1.12.0/ #进入解压好的nginx文件
[root@bogon nginx-1.12.0]# mkdir /usr/local/nginx #创建存放文件目录
[root@bogon nginx-1.12.0]# ./configure --prefix=/usr/local/nginx #执行文件并放到存放文件目录
[root@bogon nginx-1.12.0]# make && make install #编译,安装
4.启动服务
[root@bogon nginx-1.12.0]# /usr/local/nginx/sbin/nginx
5.测试
在网页中输入服务端的ip地址
最新文章
- python基础(八)面向对象的基本概念
- css 九宫格
- QEMU-KVM中的多线程压缩迁移技术
- hdu 4565 So Easy!(矩阵+快速幂)
- tcp协议中mss的理解
- Python按照索引访问list
- C#中常用接口介绍
- uploadify按钮中文乱码问题
- AUL使用初记
- .NET(C#):浅谈程序集清单资源和RESX资源
- PHP生成缩略图函数
- Sql日期时间格式转换大全
- bzoj:1661 [Usaco2006 Nov]Big Square 巨大正方形
- python 验证码识别库pytesseract的使用
- python 网络编程之TCP传输&;粘包传输
- python反射和面向对象的知识并简述基本的异常
- Java上传和下载
- Java集合(Collection)综述
- CMS (内容管理系统)
- vi入门到精通
热门文章
- css3 常用的属性
- 4.1_springboot2.2任务之异步、定时、邮件任务
- Vue的项目搭建及请求生命周期
- Redis事务,持久化,哨兵机制
- 配置Spring Security 错误:Property or field 'ROLE_USER' cannot be found
- 将数据写到kafka的topic
- 【FHQ-Treap】P4146 序列终结者
- AOP-面向切面编程-1
- 【JZOJ5730】【luoguP2146】【Comet OJC0396】软件包管理器
- 长链接生成短链接Java源码(调用百度接口)