Build Laravel Blog PigJian by PHP7 and Nginx on Ubuntu
Recently, I found an interesting framework Laravel written by PHP. i have never used PHP to write any
software. I searched the Internet to find any Blog written by Laravel. At last, I found one called PJ Blog,
which is written by Pigjian. I tried to build it with my curiosity.
1.Install PHP7
sudo apt-get install php7.-fpm php7.-mysql php7.-common php7.-mbstring php7.-gd php7.-json php7.-cli php7.-curl libapache2-mod-php7. php7.-xml php7.-mcrypt
2.Install Nginx(openresty)
wget https://openresty.org/download/openresty-1.11.2.1.tar.gz
tar -xvf openresty-1.11.2.1.tar.gz
apt-get install -y libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make build-essential
apt-get install -y libxslt-dev libxml2-dev
apt-get install -y libgd-dev libgd2-xpm-dev
apt-get install -y geoip-database libgeoip-dev
./configure \
--prefix=/usr/local/openresty \
--with-debug --with-cc-opt='-DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC -O2' \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-log-path=/var/log/nginx/access.log \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--lock-path=/var/lock/nginx.lock \
--pid-path=/var/run/nginx.pid \
--with-pcre-jit \
--with-http_addition_module \
--with-http_dav_module \
--with-http_geoip_module \
--with-http_gzip_static_module \
--with-http_image_filter_module \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_sub_module \
--with-http_xslt_module \
--with-ipv6 \
--with-mail \
--with-mail_ssl_module
make && make install
mkdir -p /var/lib/nginx/body
mkdir -p /var/log/nginx
ln -s /usr/local/openresty/nginx/sbin/nginx /usr/bin/nginx
3.Install Composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '55d6ead61b29c7bdee5cccfb50076874187bd9f21f65d8991d46ec5cc90518f447387fb9f76ebae1fbbacf329e583e30') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer
composer -V
4.Download and Install PJ Blog
composer create-project jcc/blog
composer update nothing
composer install -vvv
npm install
cp .env.example .env # modify database.
php artisan blog:install
5. Configure Nginx
groupadd www-data
useradd www-data -g www-data
user www-data www-data;
worker_processes ; error_log /var/logs/nginx/error.log;
#error_log /var/logs/nginx/error.log notice;
#error_log /var/logs/nginx/error.log info; pid /var/logs/nginx/nginx.pid; events {
worker_connections ;
} http { include mime.types;
default_type application/octet-stream; charset utf-; log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $bytes_sent $request_length "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" $request_time $upstream_response_time'; log_format proxy '$http_x_real_ip - $remote_user [$time_local] "$request" '
'$status $bytes_sent $request_length "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" $request_time $upstream_response_time'; sendfile on;
tcp_nopush on;
tcp_nodelay on; keepalive_timeout ; gzip on;
gzip_static on;
gzip_http_version 1.0;
gzip_vary on;
gzip_comp_level ;
gzip_min_length ;
gzip_buffers 16k;
gzip_types text/plain application/json application/x-javascript application/javascript text/css image/png image/jpeg image/gif; proxy_buffer_size 64k;
proxy_buffers 512k; fastcgi_connect_timeout ;
fastcgi_send_timeout ;
fastcgi_read_timeout ; server {
listen default_server; root /var/www/blog/public;
index index.php index.html index.htm; server_name localhost; location / {
try_files $uri $uri/ /index.php?$query_string;
include mime.types;
} location ~ \.php$ {
try_files $uri /index.php =;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
mv blog /var/www/
chown -R www-data:www-data /var/www/blog
chmod -R /var/www/blog/storage
More information,click here

Link: http://www.cnblogs.com/zhuangzebo/p/6281986.html
Build Laravel Blog PigJian by PHP7 and Nginx on Ubuntu的更多相关文章
- How To Install Nginx on Ubuntu 16.04  zz
		
Introduction Nginx is one of the most popular web servers in the world and is responsible for hostin ...
 - [django] Deploy Django Applications Using uWSGI and Nginx on Ubuntu 14.04
		
关键点1:chmod-socket=666 (mysite_uwsgi.ini) 关键点2 : 工程目录和虚拟环境目录搞清楚 几个参考: http://uwsgi-docs.readthedocs.i ...
 - How to install nginx in Ubuntu
		
The steps for installing the nginx on Ubuntu below. 1.install the packages first. apt-get install gc ...
 - Debian8 部署 laravel 5.3 (php7.0 + nginx)
		
web根目录:/var/www/html 更换 apt-get 源cd /etc/apt/sources.listdeb http://ftp.debian.org/debian jessie mai ...
 - Mac下PHP7.1+Nginx安装和配置
		
https://blog.csdn.net/haiyanggeng/article/details/79186982 PHP:7.1.13Nginx:1.12.2 1. 安装PHP# 添加源brew ...
 - 在Laravel中使用swoole来取代nginx作为http服务器
		
1.是什么限制Laravel框架的速度? Laravel框架启动的时候需要加载很多文件,再加上其出了名的生态环境好,所以在开发过程中我们就会发现有非常多的已经造好的轮子,这也就使得Laravel的一次 ...
 - 全志a20安卓电视盒子安装可道云kodexplorer服务-编译安装php7.3+nginx
		
可道云真的很强大,安装包很小,功能却很齐全,还可以自定义轻应用如果有手机客户端就更好了 研究了一下,可道云根目录放到外置存储设备(移动硬盘)会更合适,改路径的方法下面有提到上传文件时一个文件会在用户目 ...
 - 在服务器上搭建wordpress个人博客 php7.2+nginx+mysql+wordperss
		
买了台VPS,准备搭建一个博客.用过几个博客框架还是觉得Wordpress好用.主题多,插件也非常的便利,而且大多还免费开源.搭建也很简单,其实安装好php+mysql+nginx+wordpress ...
 - win10 php7.2 nginx 安装 imagick,适用于phpstudy
		
imagick 拓展的下载地址 https://windows.php.net/downloads/pecl/releases/imagick/ 可惜的是这个地址最新版没有php7.2, 如果是7.1 ...
 
随机推荐
- 使用gearman进行异步的邮件或短信发送
			
一.准备工作 1.为了防止,处理业务途中出现的宕机,请配置好gearman的持久化方式.2.使用gearmanManager来管理我们的worker脚本,方便测试. 上述两条请看我之前写的两篇文章 二 ...
 - stark组件开发之列表页面定制列
			
先看一张页面展示的效果图: 看一看我的 model 表!是什么样子: 看一看数据库是什么样子: 看 页面展示图,有表头. 有数据.模型表中,每一个字段, 都指定了 verbose_name. 如何解 ...
 - socket错误代码
			
Socket error 0 - Directly send error Socket error 10004 - Interrupted function call一个封锁操作被对 WSACance ...
 - Linux apt-get命令
			
一.简介 Ubuntu系列系统包管理工具. 二.常用指令 1.查询功能 apt-cache search package 搜索软件包 apt-cache show package 获取包的相关 ...
 - Linux服务器有什么优势?
			
为您的企业选择服务器时,您可以选择几种不同的选项.虽然许多公司使用基于Windows的服务器,但选择Linux服务器可能是您最好的选择.为什么Linux服务器比其他服务器更好?以下是使用Linux服务 ...
 - Java中的四种内部类
			
Java中有四种内部类: 成员内部类:定义在另一个类(外部类)的内部,而且与成员属性和方法平级,故称成员内部类.类比于外部类的非静态方法,如果用static修饰就变成了静态内部类 静态内部类:使用st ...
 - Spring IOC(七)类型推断
			
Spring IOC(七)类型推断 Spring 系列目录(https://www.cnblogs.com/binarylei/p/10198698.html) Spring 容器中可以根据 bean ...
 - Python之路(第二十五篇) 面向对象初级:反射、内置方法
			
[TOC] 一.反射 反射的概念是由Smith在1982年首次提出的,主要是指程序可以访问.检测和修改它本身状态或行为的一种能力(自省).这一概念的提出很快引发了计算机科学领域关于应用反射性的研究.它 ...
 - python正则表达式获取两段标记内的字符串
			
比如获取绿色字符串 ModelData.PayTableData =[{"}, {"}, {"}]; ModelData.PayTableData1 =[{"} ...
 - Windows server 2008 被ntlmssp安装攻击 解决
			
进行NTLM策略控制,彻底阻止LM响应