滴滴云备案服务器环境

  1. 登陆滴滴云备案服务器
    ssh [email protected]

     

  2. 添加Linux用户www
    [root@10-255-20-98 ~]# adduser www
    [root@10-255-20-98 ~]# passwd www
    [root@10-255-20-98 ~]# chmod -v u+w /etc/sudoers
    [root@10-255-20-98 ~]# vim /etc/sudoers
    www ALL=(ALL) PASSWD:ALL
    [root@10-255-20-98 ~]# chmod -v u-w /etc/sudoers

     

  3. 配置ssh免登录
    1. 域名:
      liangmydeMacBook-Pro:~ liangmy$ ssh-copy-id [email protected]

       

    2. IP:
      liangmydeMacBook-Pro:~ liangmy$ ssh-copy-id [email protected]

       

  4. 更新yum源
    [www@10-255-20-98 ~]$ cd /etc/yum.repos.d/
    [www@10-255-20-98 yum.repos.d]$ sudo mv Base.repo Base.repo.backup
    [www@10-255-20-98 yum.repos.d]$ sudo wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
    [www@10-255-20-98 yum.repos.d]$ sudo mv CentOS7-Base-163.repo Base.repo
    [www@10-255-20-98 yum.repos.d]$ yum clean all
    [www@10-255-20-98 yum.repos.d]$ yum makecache

     

  5. 安装MySQL
    [www@10-255-20-98 ~]$ wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
    [www@10-255-20-98 ~]$ sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm
    [www@10-255-20-98 ~]$ sudo yum install mysql-server
    [www@10-255-20-98 ~]$ sudo systemctl start mysqld
    [www@10-255-20-98 ~]$ sudo grep 'temporary password' /var/log/mysqld.log
    [www@10-255-20-98 ~]$ mysql -uroot -p
    mysql> set password for root@localhost = password('zjlm@123456A');
    mysql> create user 'dev'@'%' identified by 'Dev123456,';
    mysql> grant all privileges on *.* to 'dev'@'%';
    mysql> grant all privileges on *.* to 'dev'@'%' WITH GRANT OPTION;
    mysql> FLUSH PRIVILEGES;
    mysql> exit

     

  6. 安装Redis
    [www@10-255-20-98 ~]$ sudo yum install redis
    [www@10-255-20-98 ~]$ sudo vim /etc/redis.conf
    requirepass 654321
    [www@10-255-20-98 ~]$ cd script/
    [www@10-255-20-98 script]$ vim redis-start 
    redis-server /etc/redis.conf > redis.log &
    [www@10-255-20-98 script]$ sudo ./redis-start 

     

  7. 项目目录结构
    [www@10-255-20-98 ~]$ scp -r [email protected]:~/deploy_files .
    [www@10-255-20-98 ~]$ cd deploy_files/
    [www@10-255-20-98 deploy_files]$ vim admin/application.properties 
    mysql/redis/im/asr/pns/oss
    [www@10-255-20-98 deploy_files]$ vim admin/etc.properties 
    staffRegisterUrl/staffRedirectHtmlUrl
    [www@10-255-20-98 ~]$ mkdir jars
    [www@10-255-20-98 ~]$ mkdir log
    [www@10-255-20-98 ~]$ cd log
    [www@10-255-20-98 log]$ mkdir das
    [www@10-255-20-98 log]$ mkdir das-front_en
    [www@10-255-20-98 ~]$ scp -r [email protected]:~/script .
    [www@10-255-20-98 ~]$ mkdir src

     

  8. 安装Nodejs
    [www@10-255-20-98 ~]$ yum install nodejs
    [www@10-255-20-98 ~]$ npm set registry https://registry.npm.taobao.org/

     

  9. 安装Maven
    [www@10-255-20-98 ~]$ sudo yum install -y maven
    [www@10-255-20-98 ~]$ sudo vim /etc/maven/settings.xml

     

  10. 安装git
    [www@10-255-20-98 ~]$ sudo yum install git
    [www@10-255-20-98 ~]$ git config --global user.name www.limeyu.com
    [www@10-255-20-98 ~]$ git config --global user.email [email protected]
    [www@10-255-20-98 ~]$ ssh-keygen -t rsa -C [email protected]
    [www@10-255-20-98 ~]$ cat /home/www/.ssh/id_rsa.pub
    [www@10-255-20-98 ~]$ cd src/
    [www@10-255-20-98 src]$ git clone [email protected]:limeyu/das_en.git
    [www@10-255-20-98 src]$ git clone [email protected]:limeyu/das-front_en.git
    [www@10-255-20-98 ~]$ cd /home/www/src/das_en/
    [www@10-255-20-98 das_en]$ git checkout autox3_en_master
    [www@10-255-20-98 ~]$ cd /home/www/src/das-front_en/
    [www@10-255-20-98 das-front_en]$ git checkout autox3_en_master
    [www@10-255-20-98 ~]$ cd /home/www/src/das-front_en/www.bba.vip/
    [www@10-255-20-98 www.bba.vip]$ npm install

     

  11. 安装nginx
    [www@10-255-20-98 ~]$ sudo yum install nginx
    [www@10-255-20-98 ~]$ sudo vim /etc/hosts
    23.44.51.8 ocsp.int-x3.letsencrypt.org
    [www@10-255-20-98 ~]$ sudo vim /etc/nginx/nginx.conf
    [www@10-255-20-98 ~]$ sudo nginx -t
    [www@10-255-20-98 ~]$ sudo systemctl start nginx.service
    [www@10-255-20-98 ~]$ systemctl status nginx.service

     

  12. 启动服务
  13. 配置SSL
    [www@10-255-20-98 ~]$ sudo yum install certbot python2-certbot-nginx

     

你可能感兴趣的:(Linux)