Skip to content

Instantly share code, notes, and snippets.

@shrekuu
Last active October 27, 2017 07:56
Show Gist options
  • Save shrekuu/67b84d4cf1e48032ae2f58cf5b5d004f to your computer and use it in GitHub Desktop.
Save shrekuu/67b84d4cf1e48032ae2f58cf5b5d004f to your computer and use it in GitHub Desktop.
ubuntu-14-server-configuration-procedure 2017

ubuntu 14 server configuration procedure

sudo apt install vim zip unzip git node

git https://stackoverflow.com/questions/7335420/global-git-ignore

git config --global core.excludesfile '~/.gitignore'

vim

sudo add-apt-repository ppa:pkg-vim/vim-daily
sudo apt-get update && sudo apt-get upgrade

vimrc https://gitee.com/shrekuu/vimrc https://github.com/amix/vimrc

oh-my-zsh https://gitee.com/shrekuu/oh-my-zsh/

sh -c "$(curl -fsSL https://gitee.com/shrekuu/oh-my-zsh/raw/master/tools/install.sh)"

https://github.com/zsh-users/zsh-autosuggestions

git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

must-have plugin

plugins=(zsh-autosuggestions)

mysql 5.7 https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-14-04 https://dev.mysql.com/downloads/repo/apt/

php7.1 https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-php-7-on-ubuntu-14-04

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1-mbstring php7.1-bcmath php7.1-xml php7.1-mysql php7.1-mcrypt php7.1-gd php7.1-curl

nodejs https://github.com/creationix/nvm npm config https://npm.taobao.org/

composer https://getcomposer.org/download/ https://pkg.phpcomposer.com/

composer config -g repo.packagist composer https://packagist.phpcomposer.com

redis https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-redis-on-ubuntu-16-04

nginx https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-in-ubuntu-16-04

CORS, apache

Header always set Access-Control-Allow-Origin "http://localhost:8080"
Header always set Access-Control-Allow-Credentials "true"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Header always set Access-Control-Max-Age "1000"
Header always set Access-Control-Allow-Headers "Content-Type, origin, authorization, accept, client-security-token"

CORS, nginx

add_header 'Access-Control-Allow-Origin' 'http://localhost:8080';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Accept, Cookie, X-Requested-With';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE';
add_header 'Access-Control-Allow-Credentials' 'true';

project 字体

sudo cp -R ~/trade-gothic /usr/share/fonts/truetype/    
sudo chmod 755 /usr/share/fonts/truetype/trade-gothic/
Install the fonts so applications can use them
sudo fc-cache -f -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment