版本:ubuntu 14.04(64位)php
Nginx(version:1.9)html
wget http://nginx.org/keys/nginx_signing.key sudo apt-key add nginx_signing.key
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx">> /etc/apt/sources.list echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx">> /etc/apt/sources.list
sudo apt-get update sudo apt-get install nginx
打開配置文件。node
vim /etc/nginx/nginx.conf
修改user:python
user www-data;
增長server:mysql
server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /var/www/laravel/public; index index.php index.html index.htm; server_name server_domain_or_IP; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { try_files $uri /index.php =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
注意:root中的laravel應爲你的項目名稱,server_name應爲你的服務器公網IP。linux
配置完以後重啓Nginx,使上面的配置項生效。nginx
sudo service nginx restart
sudo apt-get install python-software-properties software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt-get update
sudo apt-get install php7.0-fpm php7.0-mysql php7.0-common php7.0-curl php7.0-cli php7.0-mcrypt php7.0-mbstring php7.0-dom php7.0-gd
打開php.ini配置文件:laravel
sudo vim /etc/php/7.0/fpm/php.ini
找到cgi.fix_pathinfo選項,去掉註釋;,而後將值設置爲0 (這個操做是爲了不PHP7的一個漏洞,PS:vim使用「/」進入查找模式)git
cgi.fix_pathinfo=0
啓用php7.0-mcryptgithub
sudo phpenmod mcrypt
重啓php7.0-fpm
sudo service php7.0-fpm restart
sudo apt-get install mysql-server-5.6 mysql-client-5.6
途中會提示設置MySQL的密碼,安裝好後:
mysql -uroot -p
而後輸入剛剛設置的密碼,能成功進入即成功安裝。
sudo apt-get install curl cd ~ curl -sS https://getcomposer.org/installer| php sudo mv composer.phar /usr/local/bin/composer
sudo apt-get install zip unzip
sudo apt-get install git
而後在Coding上建立一個私有項目laravel,裏面包含全部該Laravel項目所需代碼。
cd /var mkdir www cd www git clone your-project-git-link
注意:git clone 的地址應是你本身Coding倉庫中的項目SSL連接地址
sudo chown -R :www-data /var/www/laravel sudo chmod -R 775 /var/www/laravel/storage
cd /var/www/laravel composer install
注意:5,6兩部操做中的「laravel」 應該是你本身項目的的名稱。
最新版地址:http://redis.io/download
cd ~ wget http://download.redis.io/releases/redis-3.0.7.tar.gz tar xzf redis-3.0.7.tar.gz
配置並啓動Redis
cd redis-3.0.7 vi redis.conf
搜索bind,將# bind 127.0.0.1的註釋去掉後保存(這樣作後只有本地服務能夠訪問Redis,否則就有安全隱患)
make src/redis-server
看到redis的運行提示即完成。
添加下面連接中的源,而後安裝
https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
github:sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" sudo apt-get install zsh chsh -s $(which zsh) sh -c"$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
sudo apt-get install python-software-properties software-properties-common sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php sudo apt-get update
sudo apt-get remove php5-common -y sudo apt-get purge php5-common -y
sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y sudo apt-get --purge autoremove -y