zoukankan      html  css  js  c++  java
  • Jitamin安装配置一

    1.新建目录

    mkdir -p /var/www

    2.克隆jitamin的版本库

    git clone https://github.com/jitamin/jitamin.git 

    3.下载&安装composer

    #进入jitmain目录
    curl -sS https://getcomposer.org/installer | php php composer.phar install -o --no-dev

    4.创建数据库(Mysql)

    #用户名&数据库名
    jitamin/jitamin

    5.修改环境变量

    vi .env #修改数据库配置

    6.初始化&创建模板库

    vendor/bin/phinx init
    vendor/bin/phinx create MyNewMigrate
    #初始化表
    vendor/bin/phinx migrate
    #初始化数据
    vendor/bin/phinx seed:run

    7.设置文件夹权限

    chmod -R 0777 bootstrap/cache
    chmod -R 0777 storage
    php artisan config:cache
    php artisan route:cache

    8.修改nginx配置

     vi /usr/local/webserver/nginx/conf/nginx.conf
    
    [root@ll log]# cat /usr/local/webserver/nginx/conf/nginx.conf
    user  www www;
    worker_processes  1;
    error_log /usr/local/webserver/nginx/logs/nginx_error.log crit; #日志位置和日志级别
    pid /usr/local/webserver/nginx/nginx.pid;
    #error_log  logs/error.log;
    #error_log  logs/error.log  notice;
    #error_log  logs/error.log  info;
    #pid        logs/nginx.pid;
    
    events {
        worker_connections  1024;
    }
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
    
        #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
        #                  '$status $body_bytes_sent "$http_referer" '
        #                  '"$http_user_agent" "$http_x_forwarded_for"';
    
        #access_log  logs/access.log  main;
        sendfile        on;
        #tcp_nopush     on;
        #keepalive_timeout  0;
        keepalive_timeout  65;
        #gzip  on;
    
        server {
            listen       80;
            server_name  localhost;
            root /var/www/jitamin/public;
            index index.php;
            charset utf-8;
            access_log off;
            error_log  /var/log/nginx/jitamin.yourdomain.com-error.log error;
            #access_log  logs/host.access.log  main;
            sendfile off;
            client_max_body_size 100m;
            location / {
            #    root   html;
            try_files $uri $uri/ /index.php$is_args$args;
            #    index  index.html index.htm;
            }
            #error_page  404              /404.html;
    
            # redirect server error pages to the static page /50x.html
            #
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
            # proxy the PHP scripts to Apache listening on 127.0.0.1:80
            #
            #location ~ .php$ {
            #    proxy_pass   http://127.0.0.1;
            #}
    
            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            #
            location ~ .php$ {
            #    root           html;
                try_files $uri =404;        
                fastcgi_pass   127.0.0.1:9000;
               # fastcgi_index  index.php;
               # fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
               # include        fastcgi_params;
                include fastcgi.conf;
            }
    
            # deny access to .htaccess files, if Apache's document root
            # concurs with nginx's one
            #
            #location ~ /.ht {
            #    deny  all;
            #}
        }
        # another virtual host using mix of IP-, name-, and port-based configuration
        #
        #server {
        #    listen       8000;
        #    listen       somename:8080;
        #    server_name  somename  alias  another.alias;
    
        #    location / {
        #        root   html;
        #        index  index.html index.htm;
        #    }
        #}
    
        # HTTPS server
        #
        #server {
        #    listen       443 ssl;
        #    server_name  localhost;
    
        #    ssl_certificate      cert.pem;
        #    ssl_certificate_key  cert.key;
    
        #    ssl_session_cache    shared:SSL:1m;
        #    ssl_session_timeout  5m;
    
        #    ssl_ciphers  HIGH:!aNULL:!MD5;
        #    ssl_prefer_server_ciphers  on;
    
        #    location / {
        #        root   html;
        #        index  index.html index.htm;
        #    }
        #}
    }
    View Code

    9.重启nginx服务

    10.登陆

    #初始用户名/密码
    admin/admin

    11.备注

    用二级域名来链接, 比如jit.com
    不支持二级目录, 比如, xx.com/jitamin
    
    二级域名直接跳转到jitamin/public这个文件夹下面, 才可以显示首页是 jitamin/public/index.php
    
    每次修改config.php之后, 要更新一下缓存(config 和route文件的缓存)
    
    php artisan config:cache
    php artisan route:cache

     12.升级步骤

    一. 获取最新代码
    $ git fetch --all
    $ git checkout latest_tag // 请将 latest_tag 修改为最新的tag,比如:0.4.4
    
    二. 更新依赖
    $ composer install -o --no-dev
    
    三. 更新数据表
    vendor/bin/phinx migrate
    
        Windows环境请将上述命令中的 vendor/bin/phinx 替换为 vendor
    obmorganphinxinphinx.bat
    
        可选步骤
    
    $ php artisan config:cache
    $ php artisan route:cache

    13.开发相关

    Jitamin代码里自带编译后的前端静态资源。如果你不想修改前端样式,请直接忽略本环节。
    
    工具集:
    
        Node.js
        Bower
        Gulp
    
    yarn install || npm install
    bower install
  • 相关阅读:
    unexpected inconsistency;run fsck manually esxi断电后虚拟机启动故障
    centos 安装mysql 5.7
    centos 7 卸载mysql
    centos7 在线安装mysql5.6,客户端远程连接mysql
    ubuntu 14.04配置ip和dns
    centos7 上搭建mqtt服务
    windows eclipse IDE打开当前类所在文件路径
    git 在非空文件夹clone新项目
    eclipse中java build path下 allow output folders for source folders 无法勾选,该如何解决 eclipse中java build path下 allow output folders for source folders 无法勾选,
    Eclipse Kepler中配置JadClipse
  • 原文地址:https://www.cnblogs.com/aongao/p/12385374.html
Copyright © 2011-2022 走看看