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. php 通过stomp协议连接ActiveMQ

    一.安装php的stomp扩展 http://pecl.php.net/package/stomp 如:stomp-2.0.0.tgz > tar xf stomp-1.0.9.tgz > ...

  2. Aspose.Words三 创建表格

    创建表格,实现合并行.和并列.表居中.表格水平和垂直居中.设置单元格边框颜色和样式. string templateFile = Server.MapPath("table_templ.do ...

  3. C#生成二维码(可保存二维码图片)

    https://www.cnblogs.com/wlays/p/7994393.html 1.NuGet中搜索QRCoder,安装这个插件. 2.创建一个一般处理程序,代码: public void ...

  4. opencv 3.2 vs2015 debug assertion __acrt_first_block == header

    网上复制了一个转直方图的代码 ,说来也奇怪, 用imshow 显示 图片在独立窗体内,不存在问题, 要注释掉这段代码就出现了下边的错误. 网上查了查,原来是程序中 有个std::vector<c ...

  5. Android开发之自定义Dialog简单实现

    本文着重研究了自定义对话框,通过一下步骤即可清晰的理解原理,通过更改界面设置和style类型,可以应用在各种各样适合自己的App中. 首先来看一下效果图: 首先是activity的界面 点击了上述图片 ...

  6. JS-事件心得

    写在前面的话:就我目前的水平来看,这两种方法不能一起使用,用on添加的事件removeEventListener()没办法删除,反之一样 注册事件的两种方式: on+事件名称 addEventList ...

  7. PAT 1088 三人行(20 分)(暴力破解+流程分析)

    1088 三人行(20 分) 子曰:"三人行,必有我师焉.择其善者而从之,其不善者而改之." 本题给定甲.乙.丙三个人的能力值关系为:甲的能力值确定是 2 位正整数:把甲的能力值的 ...

  8. Tools.Eclipse.HowToImportAnAndroidLibraryProjectIntoWorkspace

    1. File->New->Other Picture-1 2. Select "Android Project from Existing Code", and cl ...

  9. UEFI、BIOS、Secure Boot的关系和知识介绍

      从Windows 8操作系统时代开始,安装操作系统的方法也有了很大的改变,Windows 8采用了Secure Boot引导启动的方式,而不是过去Win XP和Win 7的Legacy启动方式,从 ...

  10. jquery全选反选

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...