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. VsCode基本使用

    迫于公司统一编辑器,初次接触VsCode,小白入门笔记 安装插件及其用途: 1. Bracket Pair Colorizer :对括号对进行着色,再也不会搞不清状况了. 2. Git History ...

  2. Python 列表推导实例

    #!/usr/bin/python # -*- coding: utf-8 -*- with open('e:/123.txt') as fp:row = fp.readlines() #打开并读取所 ...

  3. vue 环境搭建

    目前我们的项目前端都采用的是vue js为了方便开发过程中前后端同事进行功能对接,建议每个同事都准备好前后端环境(前端的同事参考文档第二部分,后端同事请参考第一部分),只要保持前后端代码是最新的就可以 ...

  4. sublime 注释模版插件DocBlockr的使用

    一.gihub地址 https://github.com/spadgos/sublime-jsdocs/ 其中有使用的教程可以参考 二.配置示例 安装教程此处略,请自行查找教程 jsdocs_extr ...

  5. L1-030 一帮一(15)(代码)

    L1-030 一帮一(15 分) "一帮一学习小组"是中小学中常见的学习组织方式,老师把学习成绩靠前的学生跟学习成绩靠后的学生排在一组.本题就请你编写程序帮助老师自动完成这个分配工 ...

  6. iOS.Library.Architecture

    在用file查看library的architechture时有以下输出: $ file WebPWebP: Mach-O universal binary with 3 architecturesWe ...

  7. CF Round #516 (Div. 2, by Moscow Team Olympiad)

    前言:依旧菜,\(A\)了\(4\)题,不过这次上蓝了挺开心的. A. Make a triangle! Description 给出\(3\)根木棍,希望用它们拼成三角形,可以将其中的某些木棍增长, ...

  8. Nginx 如何设置反向代理

    网络结构如上图.可能你只有一个公网的Ip地址. 但是您的内网有个网站需要映射至外网.而又不想添加其它的非80端口.则你可以直接使用nginx来做反向代理即可.首先,配置nginx.conf文件. ht ...

  9. LibreOJ 2003. 「SDOI2017」新生舞会 基础01分数规划 最大权匹配

    #2003. 「SDOI2017」新生舞会 内存限制:256 MiB时间限制:1500 ms标准输入输出 题目类型:传统评测方式:文本比较 上传者: 匿名 提交提交记录统计讨论测试数据   题目描述 ...

  10. MySQL学习笔记-MySQL数据库优化实践[转]

    最近一段时间,我们整理了一些关于Percona,Linux,Flashcache,硬件设备的优化经验,分享给大家: 硬件 1.开启BBWC RAID卡都有写cache(Battery Backed W ...