osstech-jp / nginx-mod-am

OpenAM Policy Agent for NGINX
16 stars 11 forks source link

install nginx_agent issue #12

Closed Git-Rajkumar closed 7 years ago

Git-Rajkumar commented 7 years ago
  1. I have before install Apache webserver + apache Webagent to product a website. using this document, its working fine.

Apache Web_agent Setup:

While Installing apache Webagent its asking couple of Configurations:

  Apache httpd Conf:  /path/to/httpd.conf
  openam Server Url : http://openam.test.mobi:8080/openam
  agent url : http://apache.test.mobi:80
  webagent name: xxxxx
  Enter the Realm/Organization: /
  password File : /tmp/pwd.txt

After installing apache_webagent add redirect configuration to apache httpd.conf and agent Configuration.

  LoadModule amagent_module /opt/web_agents/apache24_agent/bin/../lib/mod_openam.so
  AmAgent On
  AmAgentConf /opt/web_agents/apache24_agent/bin/../instances/agent_1/config/agent.conf

After that, try to load Agent Url its Redirect to OpenAm, Aftet Authenticate only show our Site.

But, My web application run nginx Server, so try to follow your Document to install nginx agent.

Nginx Web_agent Setup: (what I did)

install nginx webserver in ubuntu16.04 and setup webapplication, now run webapplication fine,

nginx web_server conf file: /etc/nginx/conf/nginx.conf

Next, Try to install Ngnix_ web agent.

  1. extract the nginx_agent_20160226.deb.x86_64.zip and copy to /opt
  2. Execute agentadmin.sh ./bin/agentadmin.sh

it,s asking couple of question:

OpenSSO Server Url : http://openam.test.mobi:8080/openam
Agernt Profile Name : agentname
Agent password : agent_password

Then, I run nginx

# ./bin/nginx

its throw, error

nginx: [alert] could not open error log file: open() ".//logs/error.log" failed (2: No such file or directory) 2016/12/17 10:04:49 [emerg] 13615#0: open() ".//conf/nginx.conf" failed (2: No such file or directory)

Build way Install Nginx_agent:

i try to install nginx _agent using build instuction way,

I download your git-hub code and extract it,

Then make to install:

   $ make 

while make install throw below error:

     make[2]: Entering directory '/opt/nginx-mod-am-master/build'
  cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -g -I../extlib/common/include/ -DLINUX  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
    -o objs/addon/../ngx_http_am_module.o \
    ..//ngx_http_am_module.c
  ..//ngx_http_am_module.c: In function 'ngx_http_am_init_process':
  ..//ngx_http_am_module.c:798:5: error: implicit declaration of function 'am_agent_version' [-Werror=implicit-function-declaration]
       am_agent_version(agent_version);
       ^
  ..//ngx_http_am_module.c:804:18: error: too many arguments to function 'am_web_init'
           status = am_web_init((char *)conf->boot_file.data,
                    ^
  In file included from ..//ngx_http_am_module.c:36:0:
  src/http/am_web.h:441:27: note: declared here
   AM_WEB_EXPORT am_status_t am_web_init(const char *config_file);
                             ^
  ..//ngx_http_am_module.c:807:18: error: too many arguments to function 'am_web_init'
           status = am_web_init((char *)conf->boot_file.data,
                    ^
  In file included from ..//ngx_http_am_module.c:36:0:
  src/http/am_web.h:441:27: note: declared here
   AM_WEB_EXPORT am_status_t am_web_init(const char *config_file);
                             ^
  ..//ngx_http_am_module.c:818:14: error: implicit declaration of function 'am_agent_init' [-Werror=implicit-function-declaration]
       status = am_agent_init(&agent_initialized);
                ^
  ..//ngx_http_am_module.c:826:20: error: implicit declaration of function 'am_web_get_agent_configuration' [-Werror=implicit-function-declaration]
       agent_config = am_web_get_agent_configuration();
                      ^
  ..//ngx_http_am_module.c:826:18: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
       agent_config = am_web_get_agent_configuration();
                    ^
  ..//ngx_http_am_module.c: In function 'ngx_http_am_notification_handler':
  ..//ngx_http_am_module.c:867:5: error: too many arguments to function 'am_web_handle_notification'
       am_web_handle_notification(body, strlen(body), agent_config);
       ^
  In file included from ..//ngx_http_am_module.c:36:0:
  src/http/am_web.h:537:20: note: declared here
   AM_WEB_EXPORT void am_web_handle_notification(const char *data,
                      ^
  ..//ngx_http_am_module.c:868:5: error: implicit declaration of function 'am_web_delete_agent_configuration' [-Werror=implicit-function-declaration]
       am_web_delete_agent_configuration(agent_config);
       ^
  ..//ngx_http_am_module.c: In function 'ngx_http_am_handler':
  ..//ngx_http_am_module.c:928:22: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
           agent_config = am_web_get_agent_configuration();
                        ^
  ..//ngx_http_am_module.c:945:8: error: too many arguments to function 'am_web_is_notification'
       if(am_web_is_notification(req_params.url, agent_config) == B_TRUE){
          ^
  In file included from ..//ngx_http_am_module.c:36:0:
  src/http/am_web.h:511:25: note: declared here
   AM_WEB_EXPORT boolean_t am_web_is_notification(const char *request_url);
                           ^
  ..//ngx_http_am_module.c:959:14: error: too many arguments to function 'am_web_process_request'
       result = am_web_process_request(
                ^
  In file included from ..//ngx_http_am_module.c:36:0:

my question is:

Why? This Error Occur and explain me Following questions:

  1. where to configure AgentUrl in nginx_agent like apache_agent?
    1. my nginx webserver(web application) use /etc/nginx/conf/nginx.conf, But, nginx_agent have one nginx.conf file, which one i need to use?
    2. nginx_agent two Years old, this can Support openam 13.0?.
hamano commented 7 years ago

nginx: [alert] could not open error log file: open() ".//logs/error.log" failed (2: No such file or directory) 2016/12/17 10:04:49 [emerg] 13615#0: open() ".//conf/nginx.conf" failed (2: No such file or directory) I don't know why you can't find logs dir. please ensure exists logs dir: mkdir logs; then execute ./bin/nginx

hamano commented 7 years ago

Build way Install Nginx_agent:

did you download exilib? If you don't have it, please ask to forgerock. thank you.

hamano commented 7 years ago

where to configure AgentUrl in nginx_agent like apache_agent?

Actualy, no need to set agent URL to agent side config.

Git-Rajkumar commented 7 years ago

After create a logs, directory, throw below error

 2016/12/19 15:34:56 [emerg] 4229#0: open() ".//conf/nginx.conf" failed (2: No such file or directory)

i have installed nginx and run my web application,

nginx have one nginx.conf file and nginx_agent have one nginx.con file , which one i need to use.

hamano commented 7 years ago

my nginx webserver(web application) use /etc/nginx/conf/nginx.conf, But, nginx_agent have one nginx.conf file, which one i need to use?

please use nginx agen's nginx.conf

nginx_agent two Years old, this can Support openam 13.0?.

please test it

Git-Rajkumar commented 7 years ago

when i run ./nginx file in nginx_agent file, whats happend background?.

this should start nginx server?

hamano commented 7 years ago

you can avoid log dir issue by fix nginx.conf:

daemon off;
#error_log  logs/error.log; #comment out
error_log  /dev/stdout;