当前位置: 首页 > news >正文

网站开发都用什么语言西安网站seo收费

网站开发都用什么语言,西安网站seo收费,网站优化外包推荐,网站原创内容目录 ##编辑hosts文件 ##copy模块##复制过去 ##fetch模块##拉取 ##shell模块 ##好用 ##command模块## ##file模块### ##cron模块### ##crontab 计划任务 ##下载好时间插件 ##script模块 ##yum模块## ##yum下载源配置文件 /etc/yum.repos.d/CentOS-Base.repo ##ser…目录 ##编辑hosts文件 ##copy模块##复制过去 ##fetch模块##拉取 ##shell模块 ##好用 ##command模块## ##file模块### ##cron模块### ##crontab 计划任务 ##下载好时间插件 ##script模块 ##yum模块## ##yum下载源配置文件 /etc/yum.repos.d/CentOS-Base.repo ##service模块 ##anisble-playbook## ##yaml格式 ##template模版 ##传递变量 ##yaml文本里面传递 ##直接接-e传递变量 ##还可以在hosts文件里指定变量 ##setup模块## ##absible roles 模块## ##handlers和notify 的使用 ##yaml格式 ##拓展时间的命令 ansible的重要组成部分 Palybook --#剧本 让主机按照我给的剧本去完成一些事情 Module --#模块 去实现一个个功能的程序 Pluging --#插件 实现一些额外的小功能 ansible 的yum 安装 ##安装 yum install epel-release -yyum install ansible -y ##配置文件 /etc/ansible/ansible.cfg Ansible 的主配置文件此文件主要定义了roles_path的路径 /etc/ansible/hosts 默认主机清单配置文件可以通过ansible.cfg ##复制一个备份文件 [rootwangyalin-hunan-changsha ansible]# cp hosts{,.bak} ##先备份 [rootwangyalin-hunan-changsha ansible]# ls ansible.cfg hosts hosts.bak roles [rootwangyalin-hunan-changsha ansible]# hosts #在清空文件 ##编辑hosts文件 [rootwangyalin-hunan-changsha ansible]# vim hosts [rootwangyalin-hunan-changsha ansible]# cat hosts #将需要管理的主机添加到webser组 #默认端口号就是22 #如果通过ssh登录的端口不是22端口就需要在配置文件里面指明端口号 [web] 192.168.47.196 192.168.47.200 [all] 192.168.47.196 192.168.47.200 192.168.47.205 除了以上两个重要的配置文件还有三个重要的可执行文件 ansible ##主执行程序一般用于命令行下的执行任务 ansible-palybook ##执行playbook中的任务一般是配合yaml文件使用 ansible-doc ##获取各个模块的帮助信息 用法 [rootdhcp-clinet roles]# ansible-doc copy COPY    (/usr/lib/python2.7/site-packages/ansible/modules/files/copy.py) The copy module copies a file from the local or remote machine to a location on the remote         machine. Use the [fetch] module to copy files from remote locations to the local box. If you need         variable interpolation in copied files, use the [template] module. Using a variable in the         content field will result in unpredictable output. For Windows targets, use the [win_copy]         module instead. ##copy模块##复制过去 #复制本台主机的信息到远程主机上 [rootwangyalin-hunan-changsha ansible-test]# ansible web -m copy -a srcopt/ansible-test/ansible.txt dest/opt/ansible.txt mode755 ownersc ###创建过去文件会把那边的文件进行覆盖 ##fetch模块##拉取 ##copy的功能很相似就是把远程主机的信息复制到本台主机上 #不能指定属主和属组以及模式权限 [rootwangyalin-hunan-changsha ansible]# ansible web -m fetch -a src/etc/passwd dest/opt/ansible-test 192.168.47.196 | CHANGED { changed: true, checksum: 297601f83a2a36e93e7992aeaf1f976d7199a433, dest: /opt/ansible-test/192.168.47.196/etc/passwd, md5sum: 766c45a30bc8408edb2065ea3e9559b0, remote_checksum: 297601f83a2a36e93e7992aeaf1f976d7199a433, remote_md5sum: null } 192.168.47.200 | CHANGED { changed: true, checksum: 4d3bcc31d1f61f892f342f0a0e23823edbd73773, dest: /opt/ansible-test/192.168.47.200/etc/passwd, md5sum: d0af7a0f15cc1b9c76b47d4e38249bae, remote_checksum: 4d3bcc31d1f61f892f342f0a0e23823edbd73773, remote_md5sum: null } ##shell模块 ##好用 在web的用户进行shell编程在各个用户下下面/tnp/sc 创建这个sc文件夹 [rootwangyalin-hunan-changsha ansible]# ansible web -m shell -a mkdir /tmp/sc [WARNING]: Consider using the file module with statedirectory rather than running mkdir. If you need to use command because file is insufficient you can add warn: false to this command task or set command_warningsFalse in ansible.cfg to get rid of this message. 192.168.47.196 | CHANGED | rc0 192.168.47.200 | CHANGED | rc0 ###效果注意的是结果返回值是零表示成功非零则为失败 [rootwangyalin-hunan-changsha pssh-test]# ls /tmp/ sc ##command模块## #很像那个shell但是shell还是更加好用一点 [rootwangyalin-hunan-changsha ssh]# ansible web -m command -a ip add |gerp ens33 192.168.47.196 | FAILED | rc255 Command |gerp is unknown, try ip address help.non-zero return code 192.168.47.200 | FAILED | rc255 Command |gerp is unknown, try ip address help.non-zero return code ##file模块### State-- abset删除文件和目录 Direcstory 目录 Touch 创建空文件 Hard 建立硬链接 Link 建立软连接 ##创建文件效果 [rootwangyalin-hunan-changsha ssh]# ansible web -m file -a path/opt/aniblle-file-test statedirectory 192.168.47.200 | CHANGED { ###创建软连接 [rootwangyalin-hunan-changsha ssh]# ansible web -m file -a path/opt/ansible-link statelink src/etc/passwd ##ip为192.168.47.200##效果如下 [rootwangyalin opt]# ls aniblle-file-test ansible-link ansible.txt pssh-test wangyalin.txt ##cron模块### #计划任务 ##crontab 计划任务 ###编辑计划任务 #1.crontab -e #2.vim /etc/crontab [rootwangyalin-hunan-changsha cron]# pwd /var/spool/cron #查看当前用户有哪些的计划任务 Crontab -l [rootwangyalin-hunan-changsha cron]# crontab -l 0 2 * * * bash /backup/backup_log.sh #*/1 * * * * mkdir /backup/sc$RANDOM #Ansible: ansible-test */2 * * * * date /temp/time.txt ##每两分钟实现将date时间输出到/temp/time.txt文本里面 [rootwangyalin-hunan-changsha etc]# ansible web -m cron -a minute*/2 jobdate /temp/time.txt nameansible-test statepresent 192.168.47.200 | CHANGED { ansible_facts: { discovered_interpreter_python: /usr/bin/python }, changed: true, envs: [], jobs: [ ansible-test ] } 192.168.47.196 | CHANGED { ansible_facts: { discovered_interpreter_python: /usr/bin/python }, changed: true, envs: [], jobs: [ ansible-test ] } ##下载好时间插件 [rootwangyalin opt]# yum install chrony -y ##script模块 把本地的脚本到远端执行前提是到远端可以执行不要把linux下的脚本同步到Windows下执行 #只能在远端服务器执行脚本不上传脚本到远端服务器 [rootsanchuang-wangyalin  test]# ansible web -m script -a ./script_model_test.sh ##yum模块## ##ansible使用yum模块 安装wget模块 [rootsanchuang-wangyalin  ansible]# ansible web -m yum -a namewget statepresent [rootsanchuang-wangyalin  ansible]# ansible web -m yum -a namewget stateinstalled 卸载wget模块 [rootsanchuang-wangyalin  ansible]# ansible web -m yum -a namewget stateabsent [rootsanchuang-wangyalin  ansible]# ansible web -m yum -a namewget stateremoved ##安装vsftpd 和nginx [rootsanchuang-wangyalin  ansible]# ansible web -m yum -a namevsftpd statepresent 用于安全快速传输文件服务器 [rootsanchuang-wangyalin  ansible]# ansible web -m yum -a namenginx statepresent 用于是一个高性能的开源 Web 服务器软件也可以用作反向代理服务器、负载均衡器和 HTTP 缓存等 ##yum下载源配置文件 /etc/yum.repos.d/CentOS-Base.repo ##eqel--拓展源 [rootsanchuang-wangyalin  yum.repos.d]# yum install eqel-release -y [base] nameCentOS-$releasever - Base mirrorlisthttp://mirrorlist.centos.org/?release$releaseverarch$basearchrepoosinfra$infra #baseurlhttp://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck1 #为1开启检验 gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 enabled0 #是否启动当前源  0表示禁用 #released updates ##service模块 服务管理参数 常用参数 name服务名 state服务状态 started 启动 stopped 关闭 enabled 是否开启启动 truefalse [rootsanchuang-wangyalin  etc]# ansible web -m service -a namenginx statestarted runevel:启动级别systemctl方式忽略 ##anisble-playbook## 剧本--》连续性的要求--》按照步骤走 #语法按照yaml格式 playbook的核心元素 hosts:playbook配置文件作用的主机 tasks:任务列表 variables: 变量 templates:包含模块语法的文本文件 handlers 有特定条件出发的任务 roles用于层次性结构化地组织playbook roles能根据层次型结构自动装载变量文件、tasks以及handles等 ##yaml格式 缩进必须对齐空格不然会乱 [rootsanchuang-wangyalin  ansible-playbook]# cat playbook01.yaml --- - hosts: 192.168.47.196 ##定义远程执行主机 remote_user: root    ##定义远程用户 tasks:               ##指定任务可以执行很多个 - name: create user  ##任务名字 user: namepb       ##任务执行的模块和参数 - name: cpoy file copy: src/opt/ansible-test/index.html  dest/opt/index.html name:sc2 ##层级关系 hunan: shengfen: changsha hupo: dongtinghu #列表 classes: -yingboshuyuan -yuelushuyuan ##template模版 ##遵循jinja2模版语法 大部分内容是一样的 结合变量一起使用以 .j2结尾 {{}}双大括号里面放变量 ##传递变量 ##变量的不同的指定方式 #写在playbook文件中--vars指令 ##yaml文本里面传递 [rootsanchuang-wangyalin  ansible-playbook]# cat playbook03.yaml --- - hosts: web vars: - file_name: test.txt tasks: - name: create file file: path: /tmp/{{file_name}} state: touch ##直接接-e传递变量 [rootsanchuang-wangyalin  ansible-playbook]# ansible-playbook playbook03.yaml -e file_nametest01.txt ##还可以在hosts文件里指定变量 ##运行 [rootsanchuang-wangyalin  ansible-playbook]# ansible-playbook playbook03.yaml ##查看 [rootsanchuang-wangyalin  ansible-playbook]# cat /etc/ansible/hosts #将需要管理的主机添加到webser组 #默认端口号就是22 #如果通过ssh登录的端口不是22端口就需要在配置文件里面指明端口号 [web] 192.168.47.196  file_nameweb1.txt 192.168.47.200  file_nameweb2.txt [all] 192.168.47.196 192.168.47.200 192.168.47.205 ##setup模块## Ansible 中的一个特殊模块用于收集主机的详细信息 ##absible roles 模块## 分块管理目录 建立目录结构编写nginx配置文件模版 ##handlers和notify 的使用 详见Ansible--Ansible之Playbook - 别来无恙- - 博客园 (cnblogs.com) ##yaml格式 playbook的运作方式 ##变量的不同的指定方式 #写在playbook文件中--vars指令 ##拓展:时间的命令 %Y4位数的年份例如2022%y2位数的年份例如22%m2位数的月份例如01到12%B完整的月份名称例如January、February%b缩写的月份名称例如Jan、Feb%d2位数的日期例如01到31%A完整的星期几名称例如Sunday、Monday%a缩写的星期几名称例如Sun、Mon%H24小时制的小时数例如00到23%I12小时制的小时数例如01到12%M分钟数例如00到59%S秒数例如00到59%pAM或PM%Z时区 ##这里是之前ansible的补充内容
http://www.zqtcl.cn/news/178790/

相关文章:

  • 重庆网站seo营销模板wordpress学习 知乎
  • 桃子网站logowordpress post meta
  • 做网站一般需要什么青岛网络推广
  • 东莞网站建设 光龙wordpress4.6 nodejs
  • 宁海县建设局网站网站建设行业前景
  • 2003网站的建设谷歌seo新手快速入门
  • 网站建设服务开发网页制作下载链接怎么做
  • 网站更改域名河源建网站
  • 陕西培训网站建设校园网站建设目的
  • 做网站赚钱容易吗怎么创建自己网站平台
  • 肥料网站建设江门好的建站网站
  • 女朋友在互联网公司做网站规范网络直播平台的可行性建议
  • wordpress酷站微信推广平台自己可以做
  • 下载类网站如何做wordpress 文章分页 插件
  • 什么做书籍的网站好梅县区住房和城乡规划建设局网站
  • 网站开发的研究方法网站内容规划流程
  • 什么网站可以做数据调查深圳住房城乡建设局网站
  • 民治网站建设yihe kj程序外包公司
  • 男人与女人做视频网站wordpress无法上传图片
  • 二手手表回收网站海外推广渠道有哪些
  • 怎么把地图放到网站上如何做色流量网站
  • 常见的导航网站有哪些郑州核酸vip服务
  • 网站开发老板排名关键词优化师
  • 迈诺网站建设跨境电商平台网站建设
  • 做t恤的网站外贸仿牌网站建设
  • 网站建设的学习网站建站后维护需要做哪些
  • 为什么建设网站很多公司没有网站界面分析
  • 旅游网网站建设的管理大连淘宝网站建设
  • 无锡锡牛网站建设做汽配的外贸网站
  • 黄石公司做网站临湘做网站