systemctl

前端同学 linux常用指令汇总

久未见 提交于 2020-02-01 00:57:39
删除文件 rm -rf file11 -r:递归的删除目录下面文件以及子目录下文件。 -f:强制删除,忽略不存在的文件,从不给出提示 查看文件内容 cat file1 liunx 服务器上面查找文件 find / -name httpd.conf find 目录 -name 文件名 查找文件里面内容 cat httpd.conf | grep listen cat httpd.conf | grep -ignore listen / cat httpd.conf | grep -i listen 忽略大小写 递归创建目录 mkdir -p a/b/c/d/e/f/g zip 压缩包 zip -r public.zip public -r 递归 表示将指定的目录下的所有子目录以及文件一起处理 zip解压 unzip public.zip unzip public.zip -d dir gz 压缩包 tar czvf public.tar.gz public 解压 gz tar xzvf public.tar.gz tar 包 tar cvf wwwroot.tar wwwroot 仅打包,不压缩! 解压 tar 包 tar xvf wwwroot.tar xz 压缩包 tar cvf xxx.tar xxx // 这样创建 xxx.tar 文件 xz xxx.tar //将 xxx

Linux笔记

青春壹個敷衍的年華 提交于 2020-01-31 22:12:39
Options 选项   pwd 当前工作路径 etc/ 配置文件    Cd 切换工作路径后加文件名 Linux 文件系统结构是从 / 开始,都叫绝对路径 指明路径 = 》 从当前路径开始,叫相对路径 手册查看:   man man 打开手册 , man 后加指令名称( man+ 路径)   以点开头的文件隐藏 -a 打开 l 开头的文件为长文件 -l 打开 显示文件信息     查询目录 id -i 打开 ( -l -a =-la )     带有字节格式 -h 打开     只查询目录身 -d 打开   [ -m 系统名][ -p 前处理程序][ -c 配置文件][ -m 路径][- p 浏览方式][ -s 区域清单]   cat 查看文件内容, 后面 + 路径     more 或 less 查看文件内容以及进度,多用 less 后面 + 路径     cat/...( 文件 )/filepath 显示文件全部内容 /key 搜索   在一个文件下向另一个文件夹创建文件 / 文件夹 Touch/mkdir+ 另一个文件夹名 / 要创建的文件夹名   head+ 文件路径 显示文件开头 ( -n 显示文件开头 n 行)     tail 末尾   复制cp [-r( 目录 )] srcpath destpath     剪切mv srcpath destpath   

静态web网站搭建---https&虚拟目录&用户控制

谁都会走 提交于 2020-01-31 12:48:28
https 端口–443 在超文本传输协议http+ssl认证—超文本传输安全协议–应用层与传输层之间加 Ssl建立在tcp之上,三个特点: 1)认证用户和服务器,确保数据发送到正确的客户机和服务器; 2)加密数据以防止数据中途被窃取 3)维护数据的完整性,确保数据在传输过程中不被改变 分为:1、共享密钥加密(对成密钥)2、公开密钥加密(非对称密钥加密) 3、 公钥(公共拥有)—加密 4、私钥----解密 工作流程:认证服务器—>协商会话密钥(非对称密钥)---->数据加密通信 [root@b ~]# rpm -qa | grep httpd ----安装httpd httpd-2.4.6-40.el7.x86_64 httpd-tools-2.4.6-40.el7.x86_64 [root@b ~]# yum install mod_ssl -y ----安装ssl [root@b ~]# systemctl stop firewalld.service [root@b ~]# setenforce 0 [root@b ~]# rpm -ql mod_ssl----查看释放的文件列表信息 /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.modules.d/00-ssl.conf /usr/lib64/httpd/modules/mod_ssl

Centos7下搭建LAMP平台环境

此生再无相见时 提交于 2020-01-30 19:15:43
centos发布7.0版本,新版本带来很多特性,除了内核更新到3.10外,支持 Linux 容器、Open VMware Tools 及 3D 图像能即装即用,转用 systemd、firewalld 及 GRUB2 ,而默认的文件系统为XFS等等,可以说是比较重大的升级。笔者尝试了使用Centos7搭建LAMP服务器平台,记录如下。 1.启用Apache2 Centos7默认已经安装httpd服务,只是没有启动。如果你需要全新安装,可以yum install -y httpd 启动服务:systemctl start httpd.service 设置开机自动启动:systemctl enable httpd.service HTTP服务器已经启动,进行一下简单配置 vi /etc/httpd/conf/httpd.conf #编辑文件 ServerSignature On #添加,在错误页中显示Apache的版本,Off为不显示 Options Indexes FollowSymLinks #修改为:Options Includes ExecCGI FollowSymLinks(允许服务器执行CGI及SSI,禁止列出目录) #AddHandler cgi-script .cgi  #修改为:AddHandler cgi-script .cgi .pl (允许扩展名为

Centos7下搭建LAMP平台环境

雨燕双飞 提交于 2020-01-30 19:13:23
centos发布7.0版本,新版本带来很多特性,除了内核更新到3.10外,支持 Linux 容器、Open VMware Tools 及 3D 图像能即装即用,转用 systemd、firewalld 及 GRUB2 ,而默认的文件系统为XFS等等,可以说是比较重大的升级。笔者尝试了使用Centos7搭建LAMP服务器平台,记录如下。 1.启用Apache2 Centos7默认已经安装httpd服务,只是没有启动。如果你需要全新安装,可以yum install -y httpd 启动服务:systemctl start httpd.service 设置开机自动启动:systemctl enable httpd.service HTTP服务器已经启动,进行一下简单配置 vi /etc/httpd/conf/httpd.conf #编辑文件 ServerSignature On #添加,在错误页中显示Apache的版本,Off为不显示 Options Indexes FollowSymLinks #修改为:Options Includes ExecCGI FollowSymLinks(允许服务器执行CGI及SSI,禁止列出目录) #AddHandler cgi-script .cgi  #修改为:AddHandler cgi-script .cgi .pl (允许扩展名为

Centos7下搭建LAMP平台环境

六月ゝ 毕业季﹏ 提交于 2020-01-30 19:12:02
1.启用Apache2 Centos7默认已经安装httpd服务,只是没有启动。如果你需要全新安装,可以yum install -y httpd 启动服务:systemctl start httpd.service 设置开机自动启动:systemctl enable httpd.service HTTP服务器已经启动,进行一下简单配置 vi /etc/httpd/conf/httpd.conf #编辑文件 ServerSignature On #添加,在错误页中显示Apache的版本,Off为不显示 Options Indexes FollowSymLinks #修改为:Options Includes ExecCGI FollowSymLinks(允许服务器执行CGI及SSI,禁止列出目录) #AddHandler cgi-script .cgi  #修改为:AddHandler cgi-script .cgi .pl (允许扩展名为.pl的CGI脚本运行) AllowOverride None  #修改为:AllowOverride All (允许.htaccess) AddDefaultCharset UTF-8  #修改为:AddDefaultCharset GB2312 (添加GB2312为默认编码) #Options Indexes FollowSymLinks

How to execute a scp command before reboot or shutdown?

跟風遠走 提交于 2020-01-30 04:27:56
问题 I want to upload file before reboot or shutdown. 1.From my vps to vps Setting for upload.service vim /etc/systemd/system/upload.service [Unit] Description=upload files into my vps Before=shutdown.target reboot.target Requires=network-online.target After=network.target [Service] ExecStart=/bin/true ExecStop=/bin/bash /home/upload.sh [Install] WantedBy=multi-user.target Script for upload.sh vim /home/upload.sh /usr/bin/scp -P 22 -i /home/.ssh/id_rsa /home/wp.bak root@remote_ip:/home It is time

How to execute a scp command before reboot or shutdown?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-30 04:27:31
问题 I want to upload file before reboot or shutdown. 1.From my vps to vps Setting for upload.service vim /etc/systemd/system/upload.service [Unit] Description=upload files into my vps Before=shutdown.target reboot.target Requires=network-online.target After=network.target [Service] ExecStart=/bin/true ExecStop=/bin/bash /home/upload.sh [Install] WantedBy=multi-user.target Script for upload.sh vim /home/upload.sh /usr/bin/scp -P 22 -i /home/.ssh/id_rsa /home/wp.bak root@remote_ip:/home It is time

Service3

一曲冷凌霜 提交于 2020-01-29 09:03:38
RAID阵列概述 • 廉价冗余磁盘阵列 – 通过硬件/软件技术,将多个较小/低速的磁盘整合成一个大磁盘 – 阵列的价值:提升I/O效率、硬件级别的数据冗余 – 不同RAID级别的功能、特性各不相同 ################################################### 进程管理 程序:静态没有执行的代码,占用磁盘空间 进程:执行的代码放入内存中运行,占用内存、cpu PID:编号,标识进程 父进程、子进程 #################################################### 查看进程树 • pstree — Processes Tree – 格式:pstree [选项] [PID或用户名] • 常用命令选项 – -a:显示完整的命令行 – -p:列出对应PID编号 systemd:内核直接运行的第一个进程,PID永远为1 [root@svr7 ~]# pstree [root@svr7 ~]# pstree lisi bash───vim [root@svr7 ~]# pstree -p lisi bash(30712)───vim(30751) [root@svr7 ~]# pstree -ap lisi ################################################# • ps

centos安装hadoop 相关步骤

给你一囗甜甜゛ 提交于 2020-01-29 05:28:42
1.hostname修改 切换到root用户 vim /etc/sysconfig/network 修改为 NETWORKING=yes HOSTNAME=server60 2.防火墙 切换到root用户 service iptables stop chkconfig iptables off chkconfig --list | grep iptables 对于centos7 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status firewalld 开机禁用 : systemctl disable firewalld 开机启用 : systemctl enable firewalld 3.host修改 切换到root用户 vim /etc/hosts 修改为: ip server60 4.jdk安装 jdk链接: 参考这个安装方式 http://dblab.xmu.edu.cn/blog/install-hadoop/ 5.hadoop账户添加sudo全部权限 vim /etc/sudoers 找到 root ALL=(ALL) ALL 复制一行,名字改为server60 6.ssh免密登录 ssh localhost exit # 退出刚才的 ssh localhost