(OK) 运行cBPM—Fedora23—ALL

++++++++++++++++++++++第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-server mysql-*


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

systemctl start mariadb.service

# pwd

/opt/cBPM/criteria-lin/database/scripts/mysql


# mysqladmin -u root -p create criteria

# mysql -uroot -p criteria < criteria_mysql.sql

mysqladmin -u root -p password '123456'

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



++++++++++++++++++++++第6步:install nginx
dnf install nginx
root document dir: /usr/share/nginx/html


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




++++++++++++++++++++++第7步:编译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

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

++++++++++++++++++++++第8步:启动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         内容如下:


[root@localhost ~]# gedit /etc/nginx/nginx.conf

#user  nobody;
worker_processes  1;

#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 {
    #fastcgi_connect_timeout 300;  fastcgi_send_timeout 300;  fastcgi_read_timeout 300;
    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       9090;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;
		
		location / {
			 if ($request_method = 'OPTIONS') {
				add_header 'Access-Control-Allow-Origin' '*';
				#
				# Om nom nom cookies
				#
				#add_header 'Access-Control-Allow-Credentials' 'true';
				add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
				#
				# Custom headers and headers various browsers *should* be OK with but aren't
				#
				add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
				#
				# Tell client that this pre-flight info is valid for 20 days
				#
				add_header 'Access-Control-Max-Age' 1728000;
				add_header 'Content-Type' 'text/plain charset=UTF-8';
				add_header 'Content-Length' 0;
				return 204;
			 }
			 if ($request_method = 'POST') {
				add_header 'Access-Control-Allow-Origin' '*';
				#add_header 'Access-Control-Allow-Credentials' 'true';
				add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
				add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
			 }
			 if ($request_method = 'GET') {
				add_header 'Access-Control-Allow-Origin' '*';
				#add_header 'Access-Control-Allow-Credentials' 'true';
				add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
				add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
			 }
		}

        location /criteria {
			fastcgi_pass   127.0.0.1:8000;
            root   /usr/share/nginx/html;
            index  index.html index.htm;
			
			fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
			fastcgi_param  SERVER_SOFTWARE    nginx;
			fastcgi_param  QUERY_STRING       $query_string;
			fastcgi_param  REQUEST_METHOD     $request_method;
			fastcgi_param  CONTENT_TYPE       $content_type;
			fastcgi_param  CONTENT_LENGTH     $content_length;
			fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
			fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
			fastcgi_param  REQUEST_URI        $request_uri;
			fastcgi_param  DOCUMENT_URI       $document_uri;
			fastcgi_param  DOCUMENT_ROOT      $document_root;
			fastcgi_param  SERVER_PROTOCOL    $server_protocol;
			fastcgi_param  REMOTE_ADDR        $remote_addr;
			fastcgi_param  REMOTE_PORT        $remote_port;
			fastcgi_param  SERVER_NAME        $server_name;
        }

location /forms {
			fastcgi_pass   127.0.0.1:8000;
            root   html;
            index  index.html index.htm;
			
			fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
			fastcgi_param  SERVER_SOFTWARE    nginx;
			fastcgi_param  QUERY_STRING       $query_string;
			fastcgi_param  REQUEST_METHOD     $request_method;
			fastcgi_param  CONTENT_TYPE       $content_type;
			fastcgi_param  CONTENT_LENGTH     $content_length;
			fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
			fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
			fastcgi_param  REQUEST_URI        $request_uri;
			fastcgi_param  DOCUMENT_URI       $document_uri;
			fastcgi_param  DOCUMENT_ROOT      $document_root;
			fastcgi_param  SERVER_PROTOCOL    $server_protocol;
			fastcgi_param  REMOTE_ADDR        $remote_addr;
			fastcgi_param  REMOTE_PORT        $remote_port;
			fastcgi_param  SERVER_NAME        $server_name;
        }
        #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;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # 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;
    #    }
    #}

}

[root@localhost ~]# gedit /usr/share/nginx/html/database/Criteria.xml

<DataBaseManager>  
  
  <Connections>  
  
  
    <MySQL Type="Primary" Id="1">  
  
      <PoolManager Min="1" Max="1" Retry="0" Delay="100" />  
  
      <Host>127.0.0.1</Host>  
      <Port></Port>  
      <User>root</User>  
      <Password>123456</Password>  
      <DataBase>criteria</DataBase>  
  
      <ObjectManager>  
        <Object Type="ProcessTemplate" Managed="No">${CRITERIA_HOME}/database/processTemplate</Object>  
        <Object Type="ProcessInstance" Managed="Yes" />  
        <Object Type="FormTemplate" Managed="No">${CRITERIA_HOME}/database/forms</Object>  
  
        <Object Type="Reports" Managed="No" />  
        <Object Type="DataTypes" Managed="No">${CRITERIA_HOME}/database/Criteria.DataTypes.xml</Object>  
        <Object Type="Services" Managed="No">${CRITERIA_HOME}/database/Criteria.Services.xml</Object>  
        <Object Type="Users" Managed="No">${CRITERIA_HOME}/database/Criteria.Users.xml</Object>  
        <Object Type="Roles" Managed="No">${CRITERIA_HOME}/database/Criteria.Roles.xml</Object>  
        <Object Type="Applications" Managed="No">${CRITERIA_HOME}/database/Criteria.Applications.xml</Object>  
        <Object Type="ApplicationsDataBase" Managed="Yes" />  
        <Object Type="Events" Managed="No"></Object>  
        <Object Type="OccurredEvents" Managed="No"></Object>  
        <Object Type="WaitingEvents" Managed="No"></Object>  
  
      </ObjectManager>  
  
    </MySQL>  
  
      
  
    <!--SQLite Type="Primary" Id="1">  
  
      <PoolManager Min="1" Max="1" Retry="0" Delay="50" />  
      <Path>${CRITERIA_HOME}\database</Path>  
      <DataBase>Criteria.db</DataBase>  
  
      <ObjectManager>  
          
        <Object Type="ProcessTemplate" Managed="No">${CRITERIA_HOME}/database/processTemplate</Object>  
        <Object Type="ProcessInstance" Managed="Yes" />  
        <Object Type="Reports" Managed="No" />  
        <Object Type="DataTypes" Managed="No">${CRITERIA_HOME}/database/Criteria.DataTypes.xml</Object>  
        <Object Type="Services" Managed="No">${CRITERIA_HOME}/database/Criteria.Services.xml</Object>  
        <Object Type="Users" Managed="No">${CRITERIA_HOME}/database/Criteria.Users.xml</Object>  
        <Object Type="Roles" Managed="No">${CRITERIA_HOME}/database/Criteria.Roles.xml</Object>  
        <Object Type="Applications" Managed="No">${CRITERIA_HOME}/database/Criteria.Applications.xml</Object>  
        <Object Type="Events" Managed="No"></Object>  
        <Object Type="OccurredEvents" Managed="No"></Object>  
        <Object Type="WaitingEvents" Managed="No"></Object>  
  
      </ObjectManager>  
  
    </SQLite-->  
  
    <CriteriaFileSystem Type="Primary" Id="2">  
  
      <ObjectManager>  
          
        <Object Type="ProcessTemplate" Managed="Yes" Repository="Folder">${CRITERIA_HOME}/database/processTemplate</Object>  
        <Object Type="ProcessInstance" Managed="Yes" Repository="Folder">${CRITERIA_HOME}/database/processInstance</Object>  
        <Object Type="FormTemplate" Managed="Yes" Repository="Folder">${CRITERIA_HOME}/database/forms</Object>  
  
        <!-- Object Type="DataTypes" Managed="Yes" Repository="File">${CRITERIA_HOME}/database/Criteria.DataTypes.xml</Object -->  
        <Object Type="Reports" Managed="No" />  
        <Object Type="DataTypes" Managed="Yes" Repository="Folder">${CRITERIA_HOME}/database/dataTypes</Object>  
        <Object Type="Services" Managed="Yes" Repository="File">${CRITERIA_HOME}/database/Criteria.Services.xml</Object>  
        <Object Type="Users" Managed="Yes" Repository="File">${CRITERIA_HOME}/database/Criteria.Users.xml</Object>  
        <Object Type="Roles" Managed="Yes" Repository="File">${CRITERIA_HOME}/database/Criteria.Roles.xml</Object>  
  
        <!--Object Type="Applications" Managed="Yes" Repository="File">${CRITERIA_HOME}/database/Criteria.Applications.xml</Object-->  
        <Object Type="Applications" Managed="Yes" Repository="Folder">${CRITERIA_HOME}/database/applications</Object>  
        <Object Type="ApplicationsDataBase" Managed="No" />  
        <Object Type="Events" Managed="No"></Object>  
        <Object Type="OccurredEvents" Managed="No"></Object>  
        <Object Type="WaitingEvents" Managed="No"></Object>  
        <Object Type="CheckList" Managed="Yes" Repository="Folder">${CRITERIA_HOME}/database/checkList</Object>  
  
      </ObjectManager>  
  
    </CriteriaFileSystem>  
  
  
  </Connections>  
  
</DataBaseManager>


###  启动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



systemctl stop httpd.service

systemctl start mariadb.service

[root@localhost recieve form Maurizio Farina]# cp -r html /usr/share/nginx/html
[root@localhost html]# chmod 755 -R /usr/share/nginx/html

iptables -F


[root@localhost html]# export WF_HOME=/usr/share/nginx; export CRITERIA_HOME=/usr/share/nginx
[root@localhost html]# ./executer

in browser:   http://127.0.0.1:9090



至此,OK



++++++++++++++++++++++++++下面解决问题,仅供参考
export WF_HOME=/usr/share/nginx; export CRITERIA_HOME=/usr/share/nginx
export WF_HOME=/usr/share/nginx/html; export CRITERIA_HOME=/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
或者:
sed -i "s/AngularFormbuilder/AngularFormBuilder/g" `grep "AngularFormbuilder" -rl ./`


问题:访问被拒绝

in browser:   http://127.0.0.1:9090

[root@localhost html]# less /var/log/nginx/error.log

2016/04/07 21:54:03 [error] 3522#0: *1 "/usr/share/nginx/html/index.html" is forbidden (13: Permission denied), client: 127.0.0.1, serv/var/log/nginx/error.log


解决:

chcon -R -t usr_t /usr/share/nginx/html







posted @ 2016-04-07 21:25  张同光  阅读(151)  评论(0编辑  收藏  举报