Last active
November 28, 2018 03:02
-
-
Save yogoeasy/44d479d8da1fc0d388f782545621de87 to your computer and use it in GitHub Desktop.
裝完RunCloud之後做的事[優易教學網]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # by Jack Wu 優易教學網 https://www.yogoeasy.com | |
| # set date | |
| echo "********************************************" | |
| echo "set date" | |
| echo "********************************************" | |
| timedatectl set-timezone Asia/Taipei | |
| #root SSH key | |
| mkdir /root/.ssh | |
| wget https://www.dropbox.com/s/用你自己的/id_rsa.pub --no-check-certificate | |
| cat /root/id_rsa.pub >> /root/.ssh/authorized_keys | |
| rm /root/id_rsa.pub | |
| chmod 700 /root/.ssh | |
| chmod 600 /root/.ssh/authorized_keys | |
| # turn password authentication off | |
| sudo nano /etc/ssh/sshd_config | |
| sudo service ssh restart | |
| #install ncdu | |
| sudo apt-get install ncdu | |
| #ubuntu 16.04 如果語系有問題再改 | |
| #sudo locale-gen en_US.UTF-8 zh_TW.UTF-8 #AWS login suggestion | |
| #sudo dpkg-reconfigure locales | |
| # 把email改成自己的信箱 install notify administrator when system needs to update (http://debian-handbook.info/browse/stable/sect.regular-upgrades.html) | |
| echo "********************************************" | |
| echo "install apticron." | |
| echo "********************************************" | |
| sudo apt-get install apticron | |
| sudo nano /etc/apticron/apticron.conf | |
| #Vultr only, edit postfix with MailGun 找到relayhost之後,從該行刪除,然後貼上下面的 | |
| echo "********************************************" | |
| echo "#relayhost =" | |
| echo "mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128" | |
| echo "mailbox_size_limit = 0" | |
| echo "recipient_delimiter = +" | |
| echo "#inet_interfaces = all" | |
| echo "inet_protocols = all" | |
| echo "inet_interfaces = loopback-only" | |
| echo "#smtp_tls_wrappermode = yes" | |
| echo "#smtp_tls_security_level = encrypt" | |
| echo "relayhost = [smtp.mailgun.org]:587" | |
| echo "smtp_sasl_auth_enable = yes" | |
| echo "smtp_sasl_password_maps = static:帳號@mg.xxx.com:密碼" | |
| echo "smtp_sasl_security_options = noanonymous" | |
| echo "********************************************" | |
| read -p "Please copy and hit enter to edit postfix with MailGun: " | |
| sudo nano /etc/postfix/main.cf | |
| sudo service postfix restart | |
| echo "VPS Mail Sending Test" | mail -s "發信測試" 你的信箱@gmail.com | |
| echo "********************************************" | |
| echo 'Install Database tuner' | |
| echo "********************************************" | |
| cd /usr/local/bin | |
| wget https://launchpadlibrarian.net/78745738/tuning-primer.sh | |
| chmod u+x tuning-primer.sh | |
| #install nginx-rocket | |
| cd /etc/nginx-rc | |
| git clone https://github.com/maximejobin/rocket-nginx.git | |
| cd rocket-nginx | |
| cp rocket-nginx.ini.disabled rocket-nginx.ini | |
| php rocket-parser.php | |
| #install WP-cli | |
| cd ~ | |
| curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
| php wp-cli.phar --info | |
| chmod +x wp-cli.phar | |
| sudo mv wp-cli.phar /usr/local/bin/wp | |
| wp --info | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment