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. docker-ce-17.09 网络基础配置

    一.端口映射实现访问容器 1.我们先从pull一个nginx镜像,然后后台运行该镜像 > docker pull nginx > docker run -d -P nginx:latest ...

  2. Struts2把数据封装到集合中之封装到map中

    struts框架封装数据可以封装到集合中也可以封装到map中,该篇博客主要讲解将数据封装到map中. 1. 封装复杂类型的参数(集合类型 Collection .Map接口等) 2. 需求:页面中有可 ...

  3. jqPaginator分页(每次只取一页数据)

    应用技术点:jqPaginator.template7.bootstrap.css 参考网址: jqPaginator:http://jqpaginator.keenwon.com/#a3 templ ...

  4. zh-cn 与 zh-hans 是什么关系、有什么区别

    回答一: 作者:知乎用户 链接:https://www.zhihu.com/question/21980689/answer/19923726 来源:知乎 著作权归作者所有.商业转载请联系作者获得授权 ...

  5. KubeletNotReady runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized

    1.  mkdir -p /etc/cni/net.d 2. vi 10-flannel.conflist {  "name": "cbr0",  " ...

  6. 如何通过class文件来查看java的版本

    我们知道class文件是通过javac编译生成的,如果我们想知道是java的那个版本生成的,该怎么做? 很简单,Linux下只要使用od命令,如下: 前四个字节为固定的cafe babe,接下来的四个 ...

  7. 转载(windows下安装mysql)

    转载请声明出处:http://blog.csdn.net/u013067166/article/details/49951577             最近重装了系统,去MySQL官网下载了最新的M ...

  8. egg 为企业级框架和应用而生, 阿里出品

    https://eggjs.org/zh-cn/intro/ egg 是什么? egg 为企业级框架和应用而生,我们希望由 egg 孕育出更多上层框架,帮助开发团队和开发人员降低开发和维护成本. 设计 ...

  9. Python GUI中 text框里实时输出

    首先GUI中不同函数的局部变量的问题. 发现不同button定义的函数得到的变量无法通用. 通过global 函数内的变量可以解决这个问题 def openfiles2(): global s2fna ...

  10. [AI]神经网络章1 神经网络基本工作原理

    神经元细胞的数学计算模型 神经网络由基本的神经元组成,下图就是一个神经元的数学/计算模型,便于我们用程序来实现. 输入 (x1,x2,x3) 是外界输入信号,一般是一个训练数据样本的多个属性,比如,我 ...