linux服务端配置简记

准备工作
阿里云配置 域名   (*和@)


1.域名的解析,服务器service配置  

/usr/local/nginx/conf/vhost   melo.conf


    server {
        listen 80;
        #listen [::]:80 default_server ipv6only=on;

       #这里需要配置
        server_name melo.wangjingye.top;

        index index.html index.htm index.php;

       #这里需要配置
        root  /melo/product/firstgit;

        #error_page   404   /404.html;
        include enable-php.conf;

        location /nginx_status {
            stub_status on;
            access_log   off;
        }


        location / {
                if (!-e $request_filename) {
                        rewrite ^(.*)$ /index.php last;
                        break;
                }
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
            expires      30d;
        }

        location ~ .*\.(js|css)?$ {
            expires      12h;
        }

        location ~ /\. {
            deny all;
        }

     }

2.配置数据库的域名

/usr/local/nginx/conf /       vi  nginx.conf


server
    {
        listen 80 default_server;
        #listen [::]:80 default_server ipv6only=on;
        //这里把数据库默认IP地址修改 为其他域名
        server_name manage.wangjingye.top;
        index index.html index.htm index.php;
        root  /home/wwwroot/default;

        #error_page   404   /404.html;

        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }


3.ftp或者git的配置  https://www.cnblogs.com/cidgur/p/8028932.html    https://www.cnblogs.com/HuSay/p/9101130.html
    
    git仓库配置
    
   

  git仓库配置完成后需要配置git仓库/执行工作区的读写权限,否则也是无法执行的

4. 创建文件pushcode.sh 在master目录同级


 内容 :
    #!/bin/bash

    rsync -auv --delete-after    (a)  master/rizhi/*    (b)     master_online;  
    
            注释:讲路径a的内容  同步到b   此文件经过  ./pushcode.sh   后自动同步 , ./pushcode.sh要在当前文件所在目录执行 ,别忘了检查 文件夹执行/读写权限


5.钩子 

 #!/bin/bash
#An  example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".

read z j fm
branch=${fm:11}

cd /melo/web/firstweb
rm -rf $branch
mkdir $branch
cd $branch
git clone -b $branch /melo/storage/firstgit.git
~


新钩子  使用git内置命令 效率更高


#! /bin/sh
GIT_WORK_TREE=test_work git checkout -f
sudo chmod -R 777 test_work

web/firstweb/master/firstgit/shop/public


     }

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值