配置linux服务器常用命令 Sep 28, 2016 1. 安装lnmp2. 安装composer3. 配置 www \ www-data 用户权限4. 安装ohmyzsh5. 安装配置node环境6. 配置git 安装lnmp123456789sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/phpsudo apt install -y language-pack-en-baselocale-gen en_US.UTF-8sudo apt -y install php7.1sudo apt install -y php7.1-fpm php7.1-mysql php7.1-curl php7.1-xml php7.1-mcrypt php7.1-json php7.1-gd php7.1-mbstringsudo apt install mysql-server-5.7sudo apt install nginxsudo apt install redis-server php-redis 安装composer123php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"\nphp composer-setup.phpphp -r "unlink('composer-setup.php');" 配置 www \ www-data 用户权限12345sudo -Hu www-data ssh-keygen -t rsa -C "entimm@gmail.com"sudo chown -R www-data:www-data /var/www/sudo visudosudo passwd www-datavim /etc/passwd 安装ohmyzsh12apt install zshsh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" 安装配置node环境12345curl --silent --location https://deb.nodesource.com/setup_4.x | bash -apt install -y nodejsnpm install -g gulpnpm install -g bowerecho '\n#alias for cnpm\nalias cnpm="npm --registry=https://registry.npm.taobao.org \\n --cache=$HOME/.npm/.cache/cnpm \\n --disturl=https://npm.taobao.org/dist \\n --userconfig=$HOME/.cnpmrc"' >> ~/.zshrc && source ~/.zshrc 配置git12git config --global user.name entimmgit config --global user.email entimm@gmial.com