zoukankan      html  css  js  c++  java
  • (OK) 运行cBPM in Fedora23


    ###--- 第1步:在Fedora23上安装Codelocks 16.01的过程。

    参考:http://blog.chinaunix.net/uid-14735472-id-5671522.html

    ###--- 第2步:install xerces-c

    dnf install xerces*
    cp /lib64/libxerces-c-3.1.so /opt/cBPM/criteria-lin/lib/libxerces-c-3.1.so

    ------------上面两条命令即可,下面是源代码安装,仅供参考:xerces-c-3.1.2.tar.gz
    [root@localhost xerces-c-3.1.2]# pwd
    /opt/cBPM/xerces-c-3.1.2
    [root@localhost xerces-c-3.1.2]# ./configure --prefix=/opt/cBPM/xerces-c
    [root@localhost xerces-c-3.1.2]# make -j
    [root@localhost xerces-c-3.1.2]# ll src/.libs/libxerces-c-3.1.so
    -rwxr-xr-x. 1 root root 25155928 9月  24 09:11 src/.libs/libxerces-c-3.1.so
    [root@localhost xerces-c-3.1.2]# cp src/.libs/libxerces-c-3.1.so /opt/cBPM/criteria-lin/lib/
    ------------------------------------------------------------------------

    ###--- 第3步: 设置codeblocks 参数

    参考:http://blog.chinaunix.net/uid-14735472-id-5204752.html

    ###--- 第4步:install fastcgi

    wget http://www.fastcgi.com/dist/fcgi.tar.gz
    tar -zxvf fcgi.tar.gz
    cd fcgi-2.4.1-SNAP-0311112127
    vi include/fcgio.h

    在include/fcgio.h文件中加上 #include <cstdio>,然后再编译安装就通过了。

    make -j5
    make install

    ###--- 第5步:install mariadb

    dnf install mysql mysql-devel

    ###--- 第6步:install nginx

    dnf install nginx
    root document dir: /usr/share/nginx/html

    ###--- 第7步:install spawn-fcgi

    dnf install spawn-fcgi

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    运行cBPM in Fedora23    ————运行cBPM in CentOS7(http://blog.chinaunix.net/uid-14735472-id-5587052.html)
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


    ###--- 第8步:编译cBPM

    -----------------------------------
    在codeblocks中编译cBPM成功后 (参考:http://blog.chinaunix.net/uid-14735472-id-5204752.html),

    gedit /etc/ld.so.conf
    最后一行添加:
    /opt/cBPM/criteria-lin/lib
    保存退出,然后运行 ldconfig 即可。

    [root@localhost lib]# pwd
    /opt/cBPM/criteria-lin/lib
    [root@localhost lib]# ls
    executer  libLibraries.so  libWorkflowEngineD.so  libxerces-c-3.1.so

    [root@localhost lib]# cp executer /usr/share/nginx/html

    cp /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/executer /usr/share/nginx/html
    cp /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/executer /opt/cBPM/criteria-lin/lib

    -----------------------------------

    ###--- 第9步:启动nginx

    setsebool -P mysql_connect_http 1
    setsebool -P named_tcp_bind_http_port 1
    setsebool -P httpd_can_network_connect 1

    grep nginx /var/log/audit/audit.log | audit2allow -M mypol
    semodule -i mypol.pp

    systemctl start nginx.service
    systemctl stop nginx.service
    systemctl restart nginx.service

    cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bac
    gedit /etc/nginx/nginx.conf         内容如下:

    点击(此处)折叠或打开

    1. #user nobody;
    2. worker_processes 1;

    3. #error_log logs/error.log;
    4. #error_log logs/error.log notice;
    5. #error_log logs/error.log info;

    6. #pid logs/nginx.pid;


    7. events {
    8.     worker_connections 1024;
    9. }


    10. http {
    11.     #fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300;
    12.     include mime.types;
    13.     default_type application/octet-stream;

    14.     #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
    15.     # '$status $body_bytes_sent "$http_referer" '
    16.     # '"$http_user_agent" "$http_x_forwarded_for"';

    17.     #access_log logs/access.log main;

    18.     sendfile on;
    19.     #tcp_nopush on;

    20.     #keepalive_timeout 0;
    21.     keepalive_timeout 65;

    22.     #gzip on;

    23.     server {
    24.         listen 9090;
    25.         server_name localhost;

    26.         #charset koi8-r;

    27.         #access_log logs/host.access.log main;
    28.         
    29.         location / {
    30.              if ($request_method = 'OPTIONS') {
    31.                 add_header 'Access-Control-Allow-Origin' '*';
    32.                 #
    33.                 # Om nom nom cookies
    34.                 #
    35.                 #add_header 'Access-Control-Allow-Credentials' 'true';
    36.                 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
    37.                 #
    38.                 # Custom headers and headers various browsers *should* be OK with but aren't
    39.                 #
    40.                 add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
    41.                 #
    42.                 # Tell client that this pre-flight info is valid for 20 days
    43.                 #
    44.                 add_header 'Access-Control-Max-Age' 1728000;
    45.                 add_header 'Content-Type' 'text/plain charset=UTF-8';
    46.                 add_header 'Content-Length' 0;
    47.                 return 204;
    48.              }
    49.              if ($request_method = 'POST') {
    50.                 add_header 'Access-Control-Allow-Origin' '*';
    51.                 #add_header 'Access-Control-Allow-Credentials' 'true';
    52.                 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
    53.                 add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
    54.              }
    55.              if ($request_method = 'GET') {
    56.                 add_header 'Access-Control-Allow-Origin' '*';
    57.                 #add_header 'Access-Control-Allow-Credentials' 'true';
    58.                 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
    59.                 add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
    60.              }
    61.         }

    62.         location /criteria {
    63.             fastcgi_pass 127.0.0.1:8000;
    64.             root /usr/share/nginx/html;
    65.             index index.html index.htm;
    66.             
    67.             fastcgi_param GATEWAY_INTERFACE CGI/1.1;
    68.             fastcgi_param SERVER_SOFTWARE nginx;
    69.             fastcgi_param QUERY_STRING $query_string;
    70.             fastcgi_param REQUEST_METHOD $request_method;
    71.             fastcgi_param CONTENT_TYPE $content_type;
    72.             fastcgi_param CONTENT_LENGTH $content_length;
    73.             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    74.             fastcgi_param SCRIPT_NAME $fastcgi_script_name;
    75.             fastcgi_param REQUEST_URI $request_uri;
    76.             fastcgi_param DOCUMENT_URI $document_uri;
    77.             fastcgi_param DOCUMENT_ROOT $document_root;
    78.             fastcgi_param SERVER_PROTOCOL $server_protocol;
    79.             fastcgi_param REMOTE_ADDR $remote_addr;
    80.             fastcgi_param REMOTE_PORT $remote_port;
    81.             fastcgi_param SERVER_NAME $server_name;
    82.         }

    83.         #error_page 404 /404.html;

    84.         # redirect server error pages to the static page /50x.html
    85.         #
    86.         error_page 500 502 503 504 /50x.html;
    87.         location = /50x.html {
    88.             root html;
    89.         }

    90.         # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    91.         #
    92.         #location ~ .php$ {
    93.         # proxy_pass http://127.0.0.1;
    94.         #}

    95.         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    96.         #
    97.         #location ~ .php$ {
    98.         # root html;
    99.         # fastcgi_pass 127.0.0.1:9000;
    100.         # fastcgi_index index.php;
    101.         # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
    102.         # include fastcgi_params;
    103.         #}

    104.         # deny access to .htaccess files, if Apache's document root
    105.         # concurs with nginx's one
    106.         #
    107.         #location ~ /.ht {
    108.         # deny all;
    109.         #}
    110.     }


    111.     # another virtual host using mix of IP-, name-, and port-based configuration
    112.     #
    113.     #server {
    114.     # listen 8000;
    115.     # listen somename:8080;
    116.     # server_name somename alias another.alias;

    117.     # location / {
    118.     # root html;
    119.     # index index.html index.htm;
    120.     # }
    121.     #}


    122.     # HTTPS server
    123.     #
    124.     #server {
    125.     # listen 443 ssl;
    126.     # server_name localhost;

    127.     # ssl_certificate cert.pem;
    128.     # ssl_certificate_key cert.key;

    129.     # ssl_session_cache shared:SSL:1m;
    130.     # ssl_session_timeout 5m;

    131.     # ssl_ciphers HIGH:!aNULL:!MD5;
    132.     # ssl_prefer_server_ciphers on;

    133.     # location / {
    134.     # root html;
    135.     # index index.html index.htm;
    136.     # }
    137.     #}

    138. }

    systemctl start nginx.service
    systemctl stop nginx.service
    systemctl restart nginx.service

    systemctl stop httpd.service

    ------------
    systemctl start mariadb.service

    # pwd
    /opt/cBPM/criteria-lin/database/scripts/mysql
    # mysql -uroot -p criteria < criteria_mysql.sql

    mysqladmin -u root -p password '123456'
    ------------
    [root@localhost recieve form Maurizio Farina]# pwd
    /opt/cBPM/recieve form Maurizio Farina
    [root@localhost recieve form Maurizio Farina]# cp -r html /usr/share/nginx/html
    [root@localhost html]# chmod 755 -R /usr/share/nginx/html
    ------------

    ++++++++++++++++++++++++++++++++++++++++

    问题:Criteria session Initialization [KO].Error[Unknow Error]. Exit.
    解决:cp /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/database/ /usr/share/nginx/html -r

    问题:black bar in browser
    解决:(注意 大小写)
    cd /usr/share/nginx/html
    mv Scripts/JavaScript/Vendor/AngularFormBuilder Scripts/JavaScript/Vendor/AngularFormbuilder

    问题:the right area is blank in home
    解决:
    +++++++++++++++++++++++++++++++++++++
    /opt/cBPM/criteria-lin/src/Criteria/Criteria.WorkflowEngine/DataBase/FileSystemDataBase.cpp
            CM_TRACE_CODEPATH("TemplatesFolder [" << fsConnection.getProcessTemplatesFolder().c_str() << "]")    //ztg add
            //bOS::IO::FileSystem::ls(fsConnection.getProcessTemplatesFolder().c_str(), files,".xml");
            bOS::IO::FileSystem::ls("/usr/share/nginx/html/database/processTemplate/", files,".xml");
    +++++++++++++++++++++++++++++++++++++
    /opt/cBPM/criteria-lin/src/Criteria/Criteria.Libraries.bOS/IO/bOSFileSystem.cpp
    void FileSystem::ls(const String& sDir, FilesList& files, const char* acExtension)
    +++++++++++++++++++++++++++++++++++++

    MariaDB [criteria]> delete from SF_WorkflowProcesses;
    MariaDB [criteria]> delete from SF_Attributes;
    MariaDB [criteria]> delete from SF_Activities;
    MariaDB [criteria]> select * from SF_WorkflowProcesses;

    +++++++++++++++++++++++++++++++++++++注意:先只放这两个xml文件
    [root@localhost html]# ls database/processTemplate/
    HeatingRepair.xml  TestNotePad.xml
    +++++++++++++++++++++++++++++++++++++
    iptables -F

    export WF_HOME=/usr/share/nginx/html; export CRITERIA_HOME=/usr/share/nginx/html

    [root@localhost html]# pwd
    /usr/share/nginx/html

    systemctl start nginx.service
    systemctl stop nginx.service
    systemctl restart nginx.service

    spawn-fcgi -p 8000 -n executer
    # spawn-fcgi -a 127.0.0.1 -p 8000 -n /usr/share/nginx/html/executer

    --------if wrong, use the following commands
    tail -f /var/log/nginx/error.log
    less /var/log/nginx/access.log
    --------
    less /var/log/nginx/error.log
    错误如下(表面错误:the right area is blank in home):
    *15 connect() to 127.0.0.1:8000 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /criteria/processes/instances HTTP/1.1", upstream: "fastcgi://127.0.0.1:8000", host: "localhost:9090", referrer: "http://localhost:9090/"
    解决方法:
    setsebool -P httpd_can_network_connect 1
    --------


    至此,OK



    ++++++++++++++++++++++++下面不用看

    http://serverfault.com/questions/236795/restart-spawn-fcgi

    how can i restart spawn-fcgi on nginx server?
    Run it with option -P to store the PID in some temp file. For example:
    /usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -P /var/run/fcgi.pid
    Then you can kill it by this pid:
    kill -9 `cat /var/run/fcgi.pid`

    How was the process for spawn-fcgi started, was it by a command line (manually) or using a rc-script. In either case you can kill the process by first finding the PID
    Use the command ps aux | grep spawn-fcgi to locate the process and the command kill -9 PID
    I recommend slashdot's recommendation of using the rc-script to start and end your spawn-fcgi process.

    Update: This answer randomly failed on me (I'm not sure why) but I'm leaving this here because it might help someone.
    killall -9 -w php-cgi
    The "-w" waits. Because if you try to (re)start spawn-fcgi too soon (without a delay) spawn-fcgi always gave me error, something like "...already in use." (I don't remember the exact error, sorry.) However, "-w" doesn't work 100% of the time if you plan to put this in cron. After months of random php failures I decided to switch to php-fpm, which has its own unique problems--proceed with caution.
    ++++++++++++++++++++++++
    /opt/cBPM/criteria-lin/src/Criteria/Criteria.WorkflowEngine/DataBase/FileSystemDataBase.cpp
            CM_TRACE_CODEPATH("TemplatesFolder [" << fsConnection.getProcessTemplatesFolder().c_str() << "]")    //ztg add
            //bOS::IO::FileSystem::ls(fsConnection.getProcessTemplatesFolder().c_str(), files,".xml");
            bOS::IO::FileSystem::ls("/usr/share/nginx/html/database/processTemplate/", files,".xml");
    ++++++++++++++++++++++++
    /opt/cBPM/criteria-lin/src/Criteria/Criteria.WorkflowEngine/WAPI/WAPI.cpp
        String sDirectory = "/usr/share/nginx/html";
            String sWfHome = "/usr/share/nginx/html";


    <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
    阅读(51) | 评论(0) | 转发(0) |
    给主人留下些什么吧!~~
    评论热议
  • 相关阅读:
    Channel
    MemCache
    算法笔记_124:密码脱落(Java)
    算法笔记_123:蓝桥杯第七届省赛(Java语言B组部分习题)试题解答
    算法笔记_122:蓝桥杯第七届省赛(Java语言A组)试题解答
    算法笔记_121:蓝桥杯第六届省赛(Java语言C组部分习题)试题解答
    算法笔记_120:蓝桥杯第六届省赛(Java语言B组部分习题)试题解答
    算法笔记_119:蓝桥杯第六届省赛(Java语言A组)试题解答
    算法笔记_118:算法集训之结果填空题集二(Java)
    算法笔记_117:算法集训之结果填空题集一(Java)
  • 原文地址:https://www.cnblogs.com/ztguang/p/12649608.html
Copyright © 2011-2022 走看看