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\robmorgan\phinx\bin\phinx.bat

    可選步驟

$ php artisan config:cache
$ php artisan route:cache

13.開發相關

Jitamin代碼里自帶編譯后的前端靜態資源。如果你不想修改前端樣式,請直接忽略本環節。

工具集:

    Node.js
    Bower
    Gulp

yarn install || npm install
bower install


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM