Changeset 553 for branches/PublicaMundi_David-devel
- Timestamp:
- Feb 3, 2015, 6:38:21 PM (10 years ago)
- Location:
- branches/PublicaMundi_David-devel/zoo-project/zoo-kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PublicaMundi_David-devel/zoo-project/zoo-kernel/main.cfg
r465 r553 1 [mm] 2 biLayerAlias=Carte,Ortophoto,Ortophoto 2005,Parcels,Etat Major,Cassini,Elev 3 editingToolbar=select,add,edit 4 navName=Authenticate,Permalink,Twitter sharing,Facebook sharing,Scroll,Pan,Geolocate,Track my position,Zoom Box,Zoom To Max Extent,Identify,Identify Circle,Mesure Distance,Mesure Area,Print,Profile 5 scales=443744273,221872136,110936068,55468034,27734017,13867008,6933504,3466752,1733376,866688,433344,216672,108336,54168,27084,13542,6771,3385,1692 6 rasterToolbarAlias=Profile,Contour,Shaded Relief,Color Relief,Slope Map,Clip 7 supportedDbs=PostGIS,MySQL 8 mapcacheUrl=http://127.0.0.1/cache/ 9 biLayers=GEOGRAPHICALGRIDSYSTEMS.MAPS,ORTHOIMAGERY.ORTHOPHOTOS,ORTHOIMAGERY.ORTHOPHOTOS2000-2005,CADASTRALPARCELS.PARCELS,GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40,GEOGRAPHICALGRIDSYSTEMS.CASSINI,ELEVATION.SLOPES 10 bgLayers=google.maps.MapTypeId.TERRAIN,null,google.maps.MapTypeId.SATELLITE,google.maps.MapTypeId.HYBRID 11 bpDefault=g 12 bgName=Google 13 bbLayers=Road,Aerial,AerialWithLabels 14 navIcon=auth,permalink,tshare,fshare,scroll,pan,geoloc,track,zoom-in,zoomtomaxextent,info,infocircle,dist,area,print,terrain-profile 15 bbName=Bing 16 boLayerAlias=OpenStreetMap 17 bmLayerAlias=Streets,Satelite 18 toolbars=Vector 19 navId=authenticate,permalink,tshare,fshare,scroll,control,geolocate,track,zoomin,zoomtomaxextent,getFeature,getFeatureCircle,line,polygon,print,profile 20 navIdX=authenticate,permalink,tshare,fshare,zoomtomaxextent,print 21 navIdXX=scroll 22 navIdF=loadLoginForm,permalink,shareOnTwitter,shareOnFB,gotoMaxExtent,printIntoDocument 23 nvIID=getFeature,getFeatureCircle 24 osmApiUrl=http://open.mapquestapi.com/xapi/api/0.6/ 25 vectorToolbar=buffer,spatial-buffer,centroid,boundary,convexhull,simplify,spatial-query 26 bmLayers=Map,Aerial 27 boName=OSM 28 editingToolbarAlias=Select feature,Add feature,Edit feature 29 boLayers=OSM 30 address=http://127.0.0.1/mm 31 bmName=MapQuest 32 bpList=g,b,i 33 uomsName=Foot,Meter,Deegree 34 adminTheme=green 35 vectorToolbarAlias=Buffer,BufferMask,Centroid,Boundary,ConvexHull,Simplify,SpatialQuery 36 mapcacheCfg=/Users/djay/Sites/mapcache.xml 37 dateFormat=%A %d %B %Y 38 uomsId=english,metric,geographic 39 oldToolbars=Editing,Raster 40 rasterToolbar=profile,contour,shaded_relief,color_relief,slope_map,clip 41 bgLayerAlias=Physical,Streets,Satelite,Hybrid 42 bbLayerAlias=Streets,Satelite,Hybrid 43 sizeLimit=100M 44 biName=IGN 1 [server] 2 req_worker=10 3 async_worker=10 4 max_requests=200 5 listen=/tmp/zoo.sock 6 listen_queue=200 7 listen_owner=81 8 listen_group=81 9 listen_mode=0660 10 uid=65534 11 gid=65534 12 #rootDir=/var/www/zoo-wps/cgi-bin 45 13 46 14 [headers] … … 73 41 isTrial=true 74 42 dataPath=/Users/djay/Sites/data 75 tmpPath=/ Users/djay/Sites/tmp43 tmpPath=/tmp/ 76 44 supportedDbs=PostGIS,MySQL,WFS 77 cacheDir=/ Users/djay/Sites/cache45 cacheDir=/tmp/ 78 46 rootUrl=/~djay/mm-np/public/ 79 47 publicationUrl=/~djay/pm-np/ 80 48 dblink=/Users/djay/Sites/mm.db 81 mmPath=/Users/djay/Sites/mm-np/82 49 sessPath=/Users/djay/Sites/tmp 83 50 version=1.0.0 … … 88 55 Rpy2=true 89 56 applicationAddress=http://127.0.0.1/~djay/mm-np/ 90 mmAddress=/~djay/mm-np/91 57 publicationPath=/Users/djay/Sites/pm-np/ 92 msOgcVersion=1.0.0 93 serverAddress=http://127.0.0.1/np-bin/zoo_loader.cgi 58 serverAddress=http://127.0.0.1 94 59 lang=fr-FR,en-US,ja-JP 95 mapserverAddress=http://127.0.0.1/np-bin/mapserv.cgi96 60 tmpUrl=http://127.0.0.1/~djay/tmp/ 97 templatesPath=/Users/djay/Sites/mm-np/templates/98 61 templatesAddress=http://127.0.0.1/~djay/pm-np/tmpl/ 99 crs=IGNF:LAMB93100 62 jsCache=dev 101 63 cssCache=prod 102 64 cookiePrefix=MMID 103 65 104 [npdb]105 host=127.0.0.1106 schema=velo107 user=postgres108 dbname=demogis109 port=5432110 111 [oo]112 external=true113 path=/Applications/LibreOffice.app/Contents/program/python114 ghostscript=/usr/local/bin/gs -
branches/PublicaMundi_David-devel/zoo-project/zoo-kernel/service_zcfg.c
r549 r553 126 126 init_services_conf (char *rootDir) 127 127 { 128 maps *m = (maps *) malloc (MAP _SIZE);128 maps *m = (maps *) malloc (MAPS_SIZE); 129 129 GList *L = NULL; 130 130 scanServiceCfg (rootDir, &L, 0); … … 138 138 serviceCfgList = g_list_append (serviceCfgList, s1); 139 139 } 140 freeMaps(&m); 140 141 //freeMaps(&m); 141 142 } 142 143 -
branches/PublicaMundi_David-devel/zoo-project/zoo-kernel/zoo_loader.c
r549 r553 62 62 #include <glib.h> 63 63 #include <sys/stat.h> 64 #include <ctype.h> 65 64 66 } 65 67 … … 476 478 main (int argc, char *argv[]) 477 479 { 478 maps *main_config; 479 int max_requests, start_servers; 480 start_servers = 10; 481 max_requests= 100; 482 main_config = (maps *) malloc (MAP_SIZE); 483 conf_read ("main.cfg", main_config); 484 char ntmp[1024]; 485 #ifndef WIN32 486 getcwd (ntmp, 1024); 487 #else 488 _getcwd (ntmp, 1024); 489 #endif 490 char *rootDir = "/var/www/zoo-wps/cgi-bin"; 480 481 482 int debug_flag = 0; 483 int background_flag = 0; 484 char *file_value = NULL; 485 int index; 486 int c; 487 488 opterr = 0; 489 while ((c = getopt (argc, argv, "dbhf:")) != -1) 490 switch (c) 491 { 492 case 'd': 493 debug_flag = 1; 494 break; 495 case 'b': 496 background_flag = 1; 497 break; 498 case 'h': 499 fprintf(stderr,"TODO: need to print help\n"); 500 fflush(stderr); 501 return 0; 502 case 'f': 503 file_value = optarg; 504 break; 505 case '?': 506 if (optopt == 'f') 507 fprintf (stderr, "Option -%c requires an argument.\n", optopt); 508 else if (isprint (optopt)) 509 fprintf (stderr, "Unknown option `-%c'.\n", optopt); 510 else 511 fprintf (stderr,"Unknown option character `\\x%x'.\n",optopt); 512 return 1; 513 default: 514 abort (); 515 } 516 517 518 maps *conf; 519 conf = (maps *) malloc (MAPS_SIZE); 520 521 int ret = conf_read (file_value, conf); 522 if ( ret == 2){ 523 //a verifier mais conf_read ne renvoie jamais 0 524 fprintf(stderr,"Erreur lors de la lecture de %s\n",file_value); 525 return 1; 526 } 527 528 char *rootDir; 529 map *m_rootDir = getMapFromMaps (conf, "server", "rootDir"); 530 if (m_rootDir == NULL){ 531 fprintf(stderr,"Configuration error: rootDir"); 532 return 2; 533 } 534 else { 535 rootDir = (char*)malloc((strlen(m_rootDir->value) +1)*sizeof(char*)); 536 strncpy(rootDir,m_rootDir->value,strlen(m_rootDir->value)); 537 rootDir[strlen(m_rootDir->value)] = '\0'; 538 //freeMap(&m_rootDir); 539 } 540 541 int req_worker; 542 map *m_req_worker = getMapFromMaps (conf, "server", "req_worker"); 543 if (m_req_worker == NULL){ 544 fprintf(stderr,"Configuration error: req_worker not found"); 545 return 2; 546 } 547 else { 548 req_worker=atoi(m_req_worker->value); 549 //freeMap(&m_req_worker); 550 if (req_worker == 0){ 551 fprintf(stderr,"Configuration error: req_worker"); 552 return 2; 553 } 554 } 555 556 int async_worker; 557 map *m_async_worker = getMapFromMaps (conf, "server", "async_worker"); 558 if (m_async_worker == NULL){ 559 fprintf(stderr,"Configuration error: async_worker not found"); 560 return 2; 561 } 562 else { 563 async_worker = atoi(m_async_worker->value); 564 //freeMap(&m_async_worker); 565 if (async_worker == 0){ 566 fprintf(stderr,"Configuration error: req_worker"); 567 return 2; 568 } 569 } 570 571 int max_requests; 572 map *m_max_requests = getMapFromMaps (conf, "server", "max_requests"); 573 if (m_max_requests == NULL){ 574 fprintf(stderr,"Configuration error: max_requests"); 575 return 2; 576 } 577 else { 578 max_requests = atoi(m_max_requests->value); 579 //freeMap(&m_max_requests); 580 if (max_requests == 0){ 581 fprintf(stderr,"Configuration error: max_requests"); 582 return 2; 583 } 584 } 585 586 map *m_listen = getMapFromMaps (conf, "server", "listen"); 587 char *listen; 588 if (m_listen == NULL){ 589 fprintf(stderr,"Configuration error: listen not found"); 590 return 2; 591 } 592 else { 593 listen = (char *)malloc((strlen(m_listen->value) +1)*sizeof(char*)); 594 strncpy(listen,m_listen->value,strlen(m_listen->value)); 595 listen[strlen(m_listen->value)] = '\0'; 596 //freeMap(&m_listen); 597 } 598 int listen_owner; 599 map *m_listen_owner = getMapFromMaps (conf, "server", "listen_owner"); 600 if (m_listen_owner == NULL){ 601 fprintf(stderr,"Configuration error: listen_owner"); 602 return 2; 603 } 604 else { 605 listen_owner = atoi(m_listen_owner->value); 606 //freeMap(&m_listen_owner); 607 if (listen_owner == 0){ 608 fprintf(stderr,"Configuration error: listen_owner"); 609 return 2; 610 } 611 } 612 613 int listen_group; 614 map *m_listen_group = getMapFromMaps (conf, "server", "listen_group"); 615 if (m_listen_group == NULL){ 616 fprintf(stderr,"Configuration error: listen_group"); 617 return 2; 618 } 619 else { 620 listen_group = atoi(m_listen_group->value); 621 //freeMap(&m_listen_group); 622 if (listen_group == 0){ 623 fprintf(stderr,"Configuration error: listen_group"); 624 return 2; 625 } 626 } 627 628 char * listen_mode; 629 map *m_listen_mode = getMapFromMaps (conf, "server", "listen_mode"); 630 if (m_listen_mode == NULL){ 631 fprintf(stderr,"Configuration error: listen_mode"); 632 return 2; 633 } 634 else { 635 listen_mode = (char *)malloc((strlen(m_listen_mode->value) +1)*sizeof(char*)); 636 strncpy(listen_mode,m_listen_mode->value,strlen(m_listen_mode->value)); 637 listen_mode[strlen(m_listen_mode->value)] = '\0'; 638 //freeMap(&m_listen_mode); 639 } 640 641 int listen_queue; 642 map *m_listen_queue = getMapFromMaps (conf, "server", "listen_queue"); 643 if (m_listen_queue == NULL){ 644 fprintf(stderr,"Configuration error: listen_queue"); 645 return 2; 646 } 647 else { 648 listen_queue = atoi(m_listen_queue->value); 649 //freeMap(&m_listen_queue); 650 if (listen_queue == 0){ 651 fprintf(stderr,"Configuration error: listen_queue"); 652 return 2; 653 } 654 } 655 656 int id_user; 657 map *m_user = getMapFromMaps (conf, "server", "uid"); 658 if (m_user == NULL){ 659 fprintf(stderr,"Configuration error: id_user"); 660 return 2; 661 } 662 else { 663 id_user = atoi(m_user->value); 664 //freeMap(&m_user); 665 if (id_user == 0){ 666 fprintf(stderr,"Configuration error: id_user"); 667 return 2; 668 } 669 } 670 671 672 int id_group; 673 map *m_group = getMapFromMaps (conf, "server", "gid"); 674 if (m_group == NULL){ 675 fprintf(stderr,"Configuration error: gid"); 676 return 2; 677 } 678 else { 679 id_group = atoi(m_group->value); 680 //freeMap(&m_group); 681 if (id_group == 0){ 682 fprintf(stderr,"Configuration error: id_group"); 683 return 2; 684 } 685 } 686 687 int sock = FCGX_OpenSocket(listen, listen_queue); 688 init_services_conf (rootDir); 689 690 ret = chown(listen, listen_owner, listen_group); 691 if (ret != 0){ 692 fprintf(stderr,"Change owner error on : %s\n",listen); 693 return 3; 694 } 695 696 ret = setgid(id_group); 697 if (ret != 0){ 698 fprintf(stderr,"Change gid error\n"); 699 return 3; 700 } 701 702 ret = setuid(id_user); 703 if (ret != 0){ 704 fprintf(stderr,"Change uid error\n"); 705 return 3; 706 } 707 491 708 int fork_status = fork(); 492 709 if (fork_status == 0){ 493 710 //child 494 711 int forker_pid = getpid(); 495 init_services_conf (rootDir);496 int sock = FCGX_OpenSocket(PATH_SOCKET, 1000);497 712 FCGX_Init(); 498 713 FCGX_Request request; … … 500 715 int i; 501 716 int count_request = 0; 502 for (i = 0; i< start_servers; i++){717 for (i = 0; i< req_worker; i++){ 503 718 fork_status = fork(); 504 719 if (fork_status == 0){ … … 532 747 while(1); 533 748 534 535 536 749 } 537 750 -
branches/PublicaMundi_David-devel/zoo-project/zoo-kernel/zoo_service_loader.c
r549 r553 212 212 } 213 213 214 /**215 int216 recursReaddirF (maps * m, xmlNodePtr n, char *conf_dir, char *prefix,217 int saved_stdout, int level, void (func) (maps *,218 xmlNodePtr,219 service *))220 {221 struct dirent *dp;222 int scount = 0;223 224 if (conf_dir == NULL)225 return 1;226 DIR *dirp = opendir (conf_dir);227 if (dirp == NULL)228 {229 if (level > 0)230 return 1;231 else232 return -1;233 }234 char tmp1[25];235 sprintf (tmp1, "sprefix_%d", level);236 char levels[17];237 sprintf (levels, "%d", level);238 setMapInMaps (m, "lenv", "level", levels);239 while ((dp = readdir (dirp)) != NULL)240 if ((dp->d_type == DT_DIR || dp->d_type == DT_LNK)241 && dp->d_name[0] != '.' && strstr (dp->d_name, ".") == NULL)242 {243 244 char *tmp =245 (char *)246 malloc ((strlen (conf_dir) + strlen (dp->d_name) +247 2) * sizeof (char));248 sprintf (tmp, "%s/%s", conf_dir, dp->d_name);249 250 if (prefix != NULL)251 {252 prefix = NULL;253 }254 prefix = (char *) malloc ((strlen (dp->d_name) + 2) * sizeof (char));255 sprintf (prefix, "%s.", dp->d_name);256 257 // map* tmpMap=getMapFromMaps(m,"lenv",tmp1);258 259 int res;260 if (prefix != NULL)261 {262 setMapInMaps (m, "lenv", tmp1, prefix);263 char levels1[17];264 sprintf (levels1, "%d", level + 1);265 setMapInMaps (m, "lenv", "level", levels1);266 res =267 recursReaddirF (m, n, tmp, prefix, saved_stdout,268 level + 1, func);269 sprintf (levels1, "%d", level);270 setMapInMaps (m, "lenv", "level", levels1);271 free (prefix);272 prefix = NULL;273 }274 else275 res = -1;276 free (tmp);277 if (res < 0)278 {279 return res;280 }281 }282 else283 {284 if (dp->d_name[0] != '.' && strstr (dp->d_name, ".zcfg") != 0)285 {286 int t;287 char tmps1[1024];288 memset (tmps1, 0, 1024);289 snprintf (tmps1, 1024, "%s/%s", conf_dir, dp->d_name);290 service *s1 = (service *) malloc (SERVICE_SIZE);291 if (s1 == NULL)292 {293 dup2 (saved_stdout, fileno (stdout));294 errorException (m, _("Unable to allocate memory."),295 "InternalError", NULL);296 return -1;297 }298 #ifdef DEBUG299 fprintf (stderr,300 "#################\n%s\n#################\n", tmps1);301 #endif302 t = readServiceFile (m, tmps1, &s1, dp->d_name);303 304 if (t < 0)305 {306 map *tmp00 = getMapFromMaps (m, "lenv", "message");307 char tmp01[1024];308 if (tmp00 != NULL)309 sprintf (tmp01,310 _311 ("Unable to parse the ZCFG file: %s (%s)"),312 dp->d_name, tmp00->value);313 else314 sprintf (tmp01,315 _316 ("Unable to parse the ZCFG file: %s."),317 dp->d_name);318 dup2 (saved_stdout, fileno (stdout));319 errorException (m, tmp01, "InternalError", NULL);320 freeMaps (&m);321 free (m);322 return -1;323 }324 #ifdef DEBUG325 dumpService (s1);326 fflush (stdout);327 fflush (stderr);328 #endif329 func (m, n, s1);330 freeService (&s1);331 free (s1);332 scount++;333 }334 }335 (void) closedir (dirp);336 return 1;337 }338 **/339 214 xmlXPathObjectPtr 340 215 extractFromDoc (xmlDocPtr doc, const char *search)
Note: See TracChangeset
for help on using the changeset viewer.