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的更多相关文章

  1. 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 ...

  2. [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 ...

  3. How to install nginx in Ubuntu

    The steps for installing the nginx on Ubuntu below. 1.install the packages first. apt-get install gc ...

  4. 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 ...

  5. Mac下PHP7.1+Nginx安装和配置

    https://blog.csdn.net/haiyanggeng/article/details/79186982 PHP:7.1.13Nginx:1.12.2 1. 安装PHP# 添加源brew ...

  6. 在Laravel中使用swoole来取代nginx作为http服务器

    1.是什么限制Laravel框架的速度? Laravel框架启动的时候需要加载很多文件,再加上其出了名的生态环境好,所以在开发过程中我们就会发现有非常多的已经造好的轮子,这也就使得Laravel的一次 ...

  7. 全志a20安卓电视盒子安装可道云kodexplorer服务-编译安装php7.3+nginx

    可道云真的很强大,安装包很小,功能却很齐全,还可以自定义轻应用如果有手机客户端就更好了 研究了一下,可道云根目录放到外置存储设备(移动硬盘)会更合适,改路径的方法下面有提到上传文件时一个文件会在用户目 ...

  8. 在服务器上搭建wordpress个人博客 php7.2+nginx+mysql+wordperss

    买了台VPS,准备搭建一个博客.用过几个博客框架还是觉得Wordpress好用.主题多,插件也非常的便利,而且大多还免费开源.搭建也很简单,其实安装好php+mysql+nginx+wordpress ...

  9. win10 php7.2 nginx 安装 imagick,适用于phpstudy

    imagick 拓展的下载地址 https://windows.php.net/downloads/pecl/releases/imagick/ 可惜的是这个地址最新版没有php7.2, 如果是7.1 ...

随机推荐

  1. 为ListView的子列表添加不同的响应事件

    如何实现当点击不同的listView中的每个子列表出发不同的事件? 当在布局中,设置对应的ListView主布局及对应子布局时,在Activity中向ListView中添加子列表,利用每个子列表的Po ...

  2. html标签一

    <body></body> 网页内容 <p></p>段落 <h1></h1> ----<h6></h6> ...

  3. Python 官方文件

    7.2. 文件读写 函数 open() 返回 文件对象,通常的用法需要两个参数:open(filename, mode). >>> f = open('workfile', 'w') ...

  4. hdu 5532 (LIS) Almost Sorted Array

    http://acm.hdu.edu.cn/showproblem.php?pid=5532 题意大致是一组数中去掉一个数后问剩下的数是否构成非严格单调序列 正反各跑一遍最长非严格连续子序列,存在长度 ...

  5. (O)JS核心:call、apply和bind

    1. var func=function(a,b,c){ console.log([a,b,c]); }; func.apply(null,[1,2,3]); //[1,2,3] func.call( ...

  6. python入门科普IDE工具和编译环境

            应友人之邀,今天来讲述python的一些入门内容.本次讲解的并不是语法或者某个模块.                  python下载安装 大多数 Linux 发行版在默认安装的情况 ...

  7. java指针与引用(转载)

    大家都知道java和C#中没有指针这个概念.但是也导致了编程中常常忽略了对象与引用的区别,难道java真的没有指针吗?句柄是什么?变量地址在哪里?没有地址是不可能的,关键是java中如何避免了指针这个 ...

  8. Ubunton安装mysql

    #手下下载tar.gz包#首先手工建立mysql用户和用户组 > groupadd mysql > useradd -r -g mysql mysql#然后就是安装的解压 编译安装 > ...

  9. MySQL中varchar与char区别

    MySQL中varchar与char区别(转) MySQL中varchar最大长度是多少? 一. varchar存储规则: 4.0版本以下,varchar(20),指的是20字节,如果存放UTF8汉字 ...

  10. c++11 并发 条件变量 超时等待的代码练习

    资料地址 http://en.cppreference.com/w/cpp/thread/condition_variable/wait_until http://www.cnblogs.com/ha ...