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

重庆好的网站建设今天重大新闻2021

重庆好的网站建设,今天重大新闻2021,建中英文网站,南昌seo实用技巧目录 一#xff1a;集中式编写lnmp剧本 二#xff1a;分布式安装lnmp 1、nginx 配置 2、mysql配置 3、php配置 4、运行剧本 一#xff1a;集中式编写lnmp剧本 vim /etc/ansible/lnmp.yml- name: lnmp playhosts: dbserversremote_user: roottasks:- name: perpare condif…目录 一集中式编写lnmp剧本 二分布式安装lnmp 1、nginx 配置 2、mysql配置 3、php配置 4、运行剧本 一集中式编写lnmp剧本 vim /etc/ansible/lnmp.yml- name: lnmp playhosts: dbserversremote_user: roottasks:- name: perpare condifurecopy: src/etc/yum.repos.d/nginx.repo dest/etc/yum.repos.d/nginx.repo- name: install nginxyum: namenginx statelatest- name: start nginxservice: namenginx statestarted enabledyes- name: install mysqlyum: namemysql57-community-release-el7-10.noarch.rpm statelatest- name: modify filereplace:path: /etc/yum.repos.d/mysql-community.reporegexp: gpgcheck1replace: gpgcheck0- name: install mysql-community-serveryum: namemysql-community-server statelatest- name: start mysqlservice: namemysqld statestarted enabledyes- name: add yum filecommand: wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm -P /etc/yum.repos.d - name: rpm epelcommand: rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm- name: rpm el7command: rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm- name: install phpcommand: yum install -y php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-gd php72w-mbstring php72w-pdo php72w-xml php72w-fpm php72w-mysqlnd php72w-opcache- name: start php-fpmservice: namephp-fpm statestarted enabledyes- name: copy configurecopy: src/usr/local/nginx/conf/nginx.conf dest/etc/nginx/conf.d/default.conf- name: restart nginxservice: namenginx statestarted enabledyesansible-playbook lnmp.yml 运行 二分布式安装lnmp 1、nginx 配置 #创建各个服务的节点 vim /etc/ansible/hosts[webservers] 192.168.231.102[dbservers] 192.168.231.103[phpservers] 192.168.231.110#免交互 ssh-keygen -t rsa sshpass -p 123456 ssh-copy-id 192.168.231.102 #创建文件 mkdir /etc/ansible/roles/nginx/{files,templates,tasks,handlers,vars,defaults,meta} -p mkdir /etc/ansible/roles/mysql/{files,templates,tasks,handlers,vars,defaults,meta} -p mkdir /etc/ansible/roles/php/{files,templates,tasks,handlers,vars,defaults,meta} -ptouch /etc/ansible/roles/nginx/{defaults,vars,tasks,meta,handlers}/main.yml touch /etc/ansible/roles/mysql/{defaults,vars,tasks,meta,handlers}/main.yml touch /etc/ansible/roles/php/{defaults,vars,tasks,meta,handlers}/main.ymlcd /etc/ansible/roles/nginx/filesindex.php nginx.repo #编写php测试文件vim /etc/ansible/roles/nginx/files/index.php ?php phpinfo(); ?#编辑nginx配置源 vim /etc/ansible/roles/nginx/files/nginx.repo [nginx-stable] namenginx stable repo baseurlhttp://nginx.org/packages/centos/7/$basearch/ gpgcheck0 enabled1vim /etc/ansible/roles/nginx/main.yml - include: init.yml- name: copy nginx repocopy: srcnginx.repo dest/etc/yum.repos.d/ - name: install nginxyum: namenginx statelatest - name: copy index.phpcopy: srcindex.php dest/var/www/html - name: transmit nginx configurationtemplate: srcdefault.conf.j2 dest/etc/nginx/conf.d/default.conf - name: start nginxservice: namenginx statestarted enabledyesvim /etc/ansible/roles/index.php - name: stop firewalldservice: namefirewalld statestopped enabledno - name: stop selinuxcommand: setenforce 0vim /etc/ansible/roles/nginx/template/default.conf.j2 server {listen 80;server_name localhost;#access_log /var/log/nginx/host.access.log main;location / {root /var/www/html;index index.php index.html index.htm;}#error_page 404 /404.html;# redirect server error pages to the static page /50x.html#error_page 500 502 503 504 /50x.html;location /50x.html {root /usr/share/nginx/html;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {# proxy_pass http://127.0.0.1;#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000#location ~ \.php$ {root html;fastcgi_pass 192.168.321.110:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;include fastcgi_params;}# deny access to .htaccess files, if Apaches document root# concurs with nginxs one##location ~ /\.ht {# deny all;#} } 2、mysql配置 vim /etc/ansible/roles/mysql/tasks/init.yml - name: stop firewalldservice: namefirewalld statestopped enabledno - name: stop selinuxcommand: setenforce 0vim /etc/ansible/roles/mysql/main.yml - include: init.yml- name: remove mariadbshell: yum remove mariadb* -y - name: wgetshell: wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm -P /etc/yum.repos.d - name: install mysql57-community-release-el7-10.noarch.rpmyum: nameepel-release - name: sedreplace: path/etc/yum.repos.d/mysql-community.repo regexpgpgcheck1 replacegpgcheck0 - name: install mysql-community-serveryum: namemysql-community-server - name: start mysqlservice: namemysqld.service statestarted - name: passdshell: passd$(grep password /var/log/mysqld.log | awk NR1 {print $NF}) - name: mysql 1shell: mysql -uroot -ppassd --connect-expired-password -e ALTER USER rootlocalhost IDENTIFIED BY admin123;ignore_errors: true - name: mysql 2shell: mysql -uroot -padminabc123 -e grant all privileges on *.* to root% identified by admin123 with grant option;ignore_errors: true 3、php配置 vim /etc/ansible/roles/php/tasks/init.yml - name: stop firewalldservice: namefirewalld statestopped enabledno - name: stop selinuxcommand: setenforce 0vim /etc/ansible/rolesphp/tasks/main.yml - include: init.yml- name: install yum reposhell: rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpmignore_errors: true - name: install phpcommand: yum install -y php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-gd php72w-mbstring php72w-pdo php72w-xml php72w-fpm php72w-mysqlnd php72w-opcache - name: add useruser:name: phpshell: /sbin/nologinsystem: yes - name: copy php.inicopy: srcphp.ini dest/etc/php.ini - name: copy www.confcopy: srcwww.conf dest/etc/php-fpm.d/www.conf - name: copy index.phpcopy: srcindex.php dest/var/www/html - name: start php-fpmservice: namephp-fpm statestarted 4、运行剧本 vim /etc/ansible/lnmp.yml - name: nginx playhosts: webserversremote_user: rootroles:- nginx - name: mysql playhosts: dbserversremote_user: rootroles:- mysql- name: php playhosts: phpserversremote_user: rootroles:- php
http://www.hkea.cn/news/14441265/

相关文章:

  • 阿里巴巴免费做国际网站网站有权重可以对title做更改
  • 一个专门做特产的网站上海监理建设协会网站
  • 正规网站建设加盟合作长沙做网站报价
  • 哪个公司做网站好网站建设参考文献外文
  • 商业网站开发入门选课朝阳网络信息有限公司
  • 河南郑州网站推广优化公司招聘网站 哪个部门做
  • 郑州网络营销与网站推广视频拍摄教程
  • 外贸网站怎么营销请简述网站开发的流程图
  • 什么网站做博客好免费软件下载存在哪些风险
  • 服务器建站html家具网站源代码
  • 网站编程工具wordpress video插件
  • 做设计网站的工作两学一做网站按钮图片
  • 网站建设各部门职责策划响应式网站开发原理
  • 惠州市建设规划局网站用户体验设计书籍
  • 网站接入服务单位wordpress 当前页面登录
  • 备案系统网站网站建设需求书模板
  • 阿里云个人备案可以做企业网站吗小程序源码使用教程
  • 网站建设与规划实训总结南县网站建设
  • 有哪些图片设计网站有哪些问题网站开发团队 分工
  • 贵州住房城乡建设厅官方网站电子书网站模板
  • VIP视频网站有得做吗涟源网络建站
  • 做电影免费ppt模板下载网站网站输入一级域名自动跳转二级域名
  • 网站被挂马原因站长工具域名备案查询
  • cms 做网站网站页面的宽度
  • 网站代管理系统做网站的地方
  • 北京建设建网站移动互联网开发考研方向
  • 快站 淘宝优惠券汉邦未来网站开发
  • 学校网站建设规划网络项目分享平台
  • 深圳专门网站建设网站怎么设置qq
  • 榆林电商网站建设盐山联通大厦 网站建设