This commit is contained in:
BoHung Chiu 2022-02-09 19:26:06 +08:00
parent 26ded5c0ad
commit 407bcf9a93
2 changed files with 16 additions and 3 deletions

View File

@ -19,7 +19,7 @@ $ exit; exit # 第一次 exit 退回 root 帳號,第二次 exit 退回剛登
```sh
$ wget http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/install_orbit_environment.sh
$ bash install_orbit_environment.sh #請使用要執行網站的user(須為具有sudo權限之帳號)來執行執行後會需要輸入user密碼
$ source install_orbit_environment.sh #請使用要執行網站的user(須為具有sudo權限之帳號)來執行執行後會需要輸入user密碼
## 以下其他內容均不需執行,可直接進行架站或移機
```

View File

@ -1,6 +1,7 @@
#!/bin/bash
ubuntu_version=$(lsb_release -rs)
sudo apt update
org_pwd=$(pwd)
if [[ $ubuntu_version =~ '14' ]]; then
sudo apt install libgmp-dev -y
fi
@ -8,14 +9,21 @@ echo "postfix postfix/mailname string $USER" | sudo debconf-set-selections
echo "postfix postfix/main_mailer_type string 'Local only'" | sudo debconf-set-selections
sudo apt-get install -y postfix
sudo service postfix start
#install nginx 1.18
sudo apt install nginx -y
sudo service nginx restart
cd /etc/nginx/
sudo mkdir orbit_sites/
sudo sed -i 's/\(include\ \/etc\/nginx\/sites-enabled\/\*\;\)/\1\n\tinclude\ \/etc\/nginx\/sites-enabled\/\*\;\n\tinclude\ \/etc\/nginx\/orbit_sites\/*;/g' nginx.conf
if [ -z "$(grep 'orbit_sites' nginx.conf)" ]; then
sudo sed -i 's/\(include\ \/etc\/nginx\/sites-enabled\/\*\;\)/\1\n\tinclude\ \/etc\/nginx\/orbit_sites\/*;/g' nginx.conf
fi
cd $org_pwd
if [[ $ubuntu_version =~ '20' ]] || [[ $ubuntu_version =~ '21' ]]; then
sudo wget -nc http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0-dev_1.0.2n-1ubuntu5.7_amd64.deb
sudo dpkg -i libssl1.0-dev_1.0.2n-1ubuntu5.7_amd64.deb
sudo wget -nc http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.7_amd64.deb
sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.7_amd64.deb
# install mongod 5.0
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
sudo apt-get install gnupg -y
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
@ -23,6 +31,7 @@ if [[ $ubuntu_version =~ '20' ]] || [[ $ubuntu_version =~ '21' ]]; then
sudo apt-get install -y mongodb-org=5.0.6 mongodb-org-database=5.0.6 mongodb-org-server=5.0.6 mongodb-org-shell=5.0.6 mongodb-org-mongos=5.0.6 mongodb-org-tools=5.0.6
sudo service mongod restart
fi
# build ImageMagick and install
if [ -z $(which convert) ]; then
sudo bash -l -c "cd /root && \
apt-get install libjpeg62 -y && \
@ -45,6 +54,7 @@ if [ -z $(which convert) ]; then
ln -s /usr/local/bin/* /usr/bin/. && \
convert -list configure"
fi
## install rvm
if [ -z $(which rvm) ]; then
sudo apt-get install software-properties-common -y
sudo apt-add-repository -y ppa:rael-gc/rvm
@ -55,8 +65,11 @@ if [ -z $(which rvm) ]; then
source "/etc/profile.d/rvm.sh"
sudo chown $USER:$USER $HOME -R
rvm user gemsets
rvm install 2.1.10
sudo chown $USER:$USER /usr/share/rvm -R
fi
source "/etc/profile.d/rvm.sh"
# install ruby 2.1.10
rvm install 2.1.10
rvm --default use 2.1.10
if [[ $ubuntu_version =~ '20' ]] || [[ $ubuntu_version =~ '21' ]]; then
gem install nokogiri -v 1.7.0.1