添加用戶 deployer
groupadd deployer
adduser deployer -g deployer
passwd deployer
sudo vi /etc/sudoers #加上 deployer ALL=(ALL:ALL) ALL
su - deployer
安裝 ruby
\curl -sSL https://get.rvm.io | bash -s stable
sed -i -e 's/ftp.ruby-lang.org/pub/ruby/gems.ruby-china.org/mirrors/ruby/g' ~/.rvm/config/db
rvm install 2.3.1
rvm use 2.3.1 --default
gem source -r https://rubygems.org/
gem source -a http://mirrors.aliyun.com/rubygems/
gem install bundler
sudo yum install mysql-devel
安裝nginx
sudo yum -y install nginx
sudo service nginx start
sudo systemctl enable nginx
創(chuàng)建程序目錄
mkdir /var/www/app_name
需要 /var/www/app_name 這些目錄都有 755 權(quán)限
sudo chmod 755 /var/www
sudo chmod 755 /var/www/app_name
sudo chown -R -v deployer:deployer /var/www
開(kāi)放80端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo systemctl stop firewalld.service
sudo systemctl start firewalld.service