Issure with Facebook social plugin comment - facebook

I use Facebook social plugin comment. When I enter a comment, modal show with title "Opps" but no content, my comment still be created.
Here is my err: POST lrIDktcrT-0.js:31 POST https://www.facebook.com/plugins/comments/async/createComment/10150210921790548/?dpr=1 500 ()
AsyncRequest.send # lrIDktcrT-0.js:31
M # mDaPM9z_i0f.js:325
G # mDaPM9z_i0f.js:325
(anonymous) # mDaPM9z_i0f.js:325
j.__invokeCallback # mDaPM9z_i0f.js:20
j.$Dispatcher_DEPRECATED7 # mDaPM9z_i0f.js:20
j.dispatch # mDaPM9z_i0f.js:20
j.$DevxFluxDispatcher1 # mDaPM9z_i0f.js:299
j.handleViewAction # mDaPM9z_i0f.js:299
(anonymous function) # mDaPM9z_i0f.js:300
(anonymous) # mDaPM9z_i0f.js:346
J # 1Dk5dwOP3va.js:46
h # jeoyZtjV1Ng.js:41
g # jeoyZtjV1Ng.js:40
g # jeoyZtjV1Ng.js:40
og # jeoyZtjV1Ng.js:40
pg # jeoyZtjV1Ng.js:40
Di # jeoyZtjV1Ng.js:40
Fi # jeoyZtjV1Ng.js:40
Ai # jeoyZtjV1Ng.js:40
g # jeoyZtjV1Ng.js:40
Ki # jeoyZtjV1Ng.js:40
g # jeoyZtjV1Ng.js:40
Wi # jeoyZtjV1Ng.js:40
Eg # jeoyZtjV1Ng.js:40
Eg # jeoyZtjV1Ng.js:40
Gg # jeoyZtjV1Ng.js:40
g # jeoyZtjV1Ng.js:40
J # 1Dk5dwOP3va.js:46
x # 1Dk5dwOP3va.js:220
x # 1Dk5dwOP3va.js:220
(anonymous) # 1Dk5dwOP3va.js:214
I # 1Dk5dwOP3va.js:64
N # 1Dk5dwOP3va.js:64
u # 1Dk5dwOP3va.js:214
J # 1Dk5dwOP3va.js:46
N # 1Dk5dwOP3va.js:64
(anonymous) # 1Dk5dwOP3va.js:63
And here is my code:
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/vi_VN/sdk.js#xfbml=1&version=v2.10&appId={my_app_id}';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
</body>

Related

Apache Archiva upload artifact is not working for file size more than 50MB

Tried to upload war file which size is about 150MB manually using "upload Artifact" menu in Apache Archiva, it always fail with no error message shown.
While debugging, it shows the following error.
Uncaught TypeError: file.error.replace is not a function
at eval (eval at b (tmpl.min.js?_archivaVersion=2.2.5:1:74), <anonymous>:3:555)
at tmpl.min.js?_archivaVersion=2.2.5:1:253
at tmpl.min.js?_archivaVersion=2.2.5:1:253
at $.<computed>.<computed>._renderTemplate (jquery.fileupload-ui-6.6.3.js?_archivaVersion=2.2.5:358:26)
at $.<computed>.<computed>._renderTemplate (jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:90:26)
at $.<computed>.<computed>._renderDownload (jquery.fileupload-ui-6.6.3.js?_archivaVersion=2.2.5:420:25)
at $.<computed>.<computed>._renderDownload (jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:90:26)
at S.fn.init.<anonymous> (jquery.fileupload-ui-6.6.3.js?_archivaVersion=2.2.5:186:53)
at c (jquery-1.11.1.min.js?_archivaVersion=2.2.5:2:28327)
at Object.add [as done] (jquery-1.11.1.min.js?_archivaVersion=2.2.5:2:28605)
eval # VM83:3
(anonymous) # tmpl.min.js?_archivaVersion=2.2.5:1
(anonymous) # tmpl.min.js?_archivaVersion=2.2.5:1
_renderTemplate # jquery.fileupload-ui-6.6.3.js?_archivaVersion=2.2.5:358
(anonymous) # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:90
_renderDownload # jquery.fileupload-ui-6.6.3.js?_archivaVersion=2.2.5:420
(anonymous) # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:90
(anonymous) # jquery.fileupload-ui-6.6.3.js?_archivaVersion=2.2.5:186
c # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
add # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
(anonymous) # jquery.fileupload-ui-6.6.3.js?_archivaVersion=2.2.5:183
each # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
each # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
fail # jquery.fileupload-ui-6.6.3.js?_archivaVersion=2.2.5:178
_trigger # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:480
_onFail # jquery.fileupload-5.10.0.js?_archivaVersion=2.2.5:559
(anonymous) # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:90
(anonymous) # jquery.fileupload-5.10.0.js?_archivaVersion=2.2.5:604
c # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
fireWith # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
l # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
(anonymous) # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
error (async)
send # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
ajax # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
send # jquery.fileupload-5.10.0.js?_archivaVersion=2.2.5:599
_onSend # jquery.fileupload-5.10.0.js?_archivaVersion=2.2.5:655
(anonymous) # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:90
send # jquery.fileupload-5.10.0.js?_archivaVersion=2.2.5:897
(anonymous) # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:90
(anonymous) # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:185
each # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
each # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
$.fn.<computed> # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:175
submit # artifacts-management.js?_archivaVersion=2.2.5:109
_trigger # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:480
newData.submit # jquery.fileupload-5.10.0.js?_archivaVersion=2.2.5:693
_startHandler # jquery.fileupload-ui-6.6.3.js?_archivaVersion=2.2.5:431
(anonymous) # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:90
dispatch # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
v.handle # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
jquery-1.11.1.min.js?_archivaVersion=2.2.5:2 POST http://1-a-ab3devapp3:9096/restServices/archivaUiServices/fileUploadService net::ERR_CONNECTION_RESET
send # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
ajax # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
send # jquery.fileupload-5.10.0.js?_archivaVersion=2.2.5:599
_onSend # jquery.fileupload-5.10.0.js?_archivaVersion=2.2.5:655
(anonymous) # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:90
send # jquery.fileupload-5.10.0.js?_archivaVersion=2.2.5:897
(anonymous) # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:90
(anonymous) # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:185
each # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
each # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
$.fn.<computed> # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:175
submit # artifacts-management.js?_archivaVersion=2.2.5:109
_trigger # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:480
newData.submit # jquery.fileupload-5.10.0.js?_archivaVersion=2.2.5:693
_startHandler # jquery.fileupload-ui-6.6.3.js?_archivaVersion=2.2.5:431
(anonymous) # jquery.ui.widget-1.9.2.js?_archivaVersion=2.2.5:90
dispatch # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
v.handle # jquery-1.11.1.min.js?_archivaVersion=2.2.5:2
If try to upload files less than 50 MB, it is possible to upload into repository.
Same issue when tried using Maven Deploy(small files upload OK but big files end up with error)
Any help on this.

MapServer - msLoadMap(): Regular expression error. MS_DEFAULT_MAPFILE_PATTERN validation failed

I am trying to use MapServer to load tiles overtop of my google map. When hitting the endpoint, I am getting the error:
msLoadMap(): Regular expression error. MS_DEFAULT_MAPFILE_PATTERN validation failed.
An example of one of the endpoints is:
http://localhost:8080/cgi-bin/tiler?layer=layer_392&map.layer[layer_392].class[0].style[0]=SIZE%203&mode=tile&tilemode=gmap&tile=4%2011%205
The apache config with a ScriptAlias:
# 000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www/web
LogFormat "{ \"datetime\":\"%{%Y-%m-%d}tT%{%T}t.%{msec_frac}tZ\", \"network.client.ip\":\"%a\", \"http.url_details.host\":\"%V\", \"http.url\":\"%U\", \"http.url_details.queryString\":\"%q\", \"http.method\":\"%m\", \"http.status_code\":\"%>s\", \"http.useragent\":\"%{User-agent}i\", \"http.referer\":\"%{Referer}i\" }," json
CustomLog /dev/stdout json
ScriptAlias /cgi-bin/ /var/www/bin/tile-producer/docker/cron-jobs/
<Directory /var/www>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
# Setup rewrite rules
RewriteEngine on
RewriteBase "/var/www/web"
</Directory>
</VirtualHost>
mapfile:
#Generated by MapServer Generator MapWindow plug-in
#
# Start of map file
#
MAP
NAME telusdirectory
STATUS ON
EXTENT -180 -90 180 90
SHAPEPATH 'data'
IMAGETYPE png
PROJECTION
"init=epsg:4326"
END
WEB
METADATA
"wms_title" "TELUS Directory Service WMS"
"wms_onlineresource" "http://telus.magicsite.co.uk/cgi-bin/telus?"
"wms_srs" "EPSG:4326"
"tile_map_edge_buffer" "100" # 9 pixel rendering buffer
"http_max_age" "86400"
END
END
SYMBOL
NAME 'square'
TYPE VECTOR
FILLED TRUE
POINTS
0 1
0 0
1 0
1 1
0 1
END
END #SYMBOL
SYMBOL
NAME 'ellipse'
TYPE ELLIPSE
FILLED TRUE
POINTS
1 1
END
END #SYMBOL
IMAGEQUALITY 95
IMAGETYPE png
OUTPUTFORMAT
NAME png
DRIVER 'GD/PNG'
MIMETYPE 'image/png'
EXTENSION 'png'
IMAGEMODE RGBA
TRANSPARENT ON
END
#
# Start of layers definitions
#
#LAYER_DEFS
LAYER
PROJECTION
"init=epsg:4326"
END
NAME layer_392
TYPE point
STATUS ON
DATA 'layer_392.shp'
CLASS
NAME 'layer_392'
STYLE
SYMBOL 'ellipse'
SIZE 2
COLOR 73 22 109
END #STYLE
END #CLASS
TEMPLATE "xxx"
METADATA
"wms_title" "Data layer"
END
END #LAYER
#/LAYER_DEFS
END #MAP
tiler script that is hit on entry:
#!/usr/bin/perl
use CGI qw(:standard);
use URI::Escape;
use File::Basename;
use Cwd 'abs_path';
use v5.10;
my $q = CGI->new;
my #PARAMS = $q->param;
my $NEW_PARAMS;
my ($x, $y, $z) = split(' ', uri_unescape( scalar $q->param('tile') ) );
$NEW_PARAMS = "map="."/var/www/bin/tile-producer/docker/cron-jobs/mapdata"."/telus.map";
if ( #PARAMS ) {
foreach ( #PARAMS ) {
$NEW_PARAMS .= "&$_=" . uri_escape( $q->param( $_ ) );
}
}
$ENV{'QUERY_STRING'} = $NEW_PARAMS;
system("/usr/lib/cgi-bin/mapserv");
Contents of mapdata folder:
So after looking through all of this. My env variable in script that is hit on entry was not getting passed through to CGI. I had to enable it on Apache first and then it started working.

Flutter Web How to publish and host a site to other than a root folder

Currently i was testing flutter web with default app template
i created a new project and build web target with
`flutter build web`
put all the files in subdirectory of local server, thus i can access them from
say http://127.0.0.1:43110/1ETE7PzFgfVdJ9YBhoG2uq1g5jwZ6N9Dou/
but i was not able to load the flutter app correctly.
i was getting the below errors
Access to XMLHttpRequest at 'http://127.0.0.1:43110/assets/FontManifest.json' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Uncaught Failed to load asset at "assets/FontManifest.json" (0)
at Object.a (http://127.0.0.1:43110/1ETE7PzFgfVdJ9YBhoG2uq1g5jwZ6N9Dou/main.dart.js:3657:3)
at http://127.0.0.1:43110/1ETE7PzFgfVdJ9YBhoG2uq1g5jwZ6N9Dou/main.dart.js:15533:9
at WK.a (http://127.0.0.1:43110/1ETE7PzFgfVdJ9YBhoG2uq1g5jwZ6N9Dou/main.dart.js:5208:72)
at WK.$2 (http://127.0.0.1:43110/1ETE7PzFgfVdJ9YBhoG2uq1g5jwZ6N9Dou/main.dart.js:26450:23)
at VZ.$2 (http://127.0.0.1:43110/1ETE7PzFgfVdJ9YBhoG2uq1g5jwZ6N9Dou/main.dart.js:26445:25)
at UN.Sx (http://127.0.0.1:43110/1ETE7PzFgfVdJ9YBhoG2uq1g5jwZ6N9Dou/main.dart.js:27054:42)
at UN.Sw (http://127.0.0.1:43110/1ETE7PzFgfVdJ9YBhoG2uq1g5jwZ6N9Dou/main.dart.js:27056:32)
at fm.Qv (http://127.0.0.1:43110/1ETE7PzFgfVdJ9YBhoG2uq1g5jwZ6N9Dou/main.dart.js:26578:23)
at Tl.$0 (http://127.0.0.1:43110/1ETE7PzFgfVdJ9YBhoG2uq1g5jwZ6N9Dou/main.dart.js:26725:36)
at Object.n9 (http://127.0.0.1:43110/1ETE7PzFgfVdJ9YBhoG2uq1g5jwZ6N9Dou/main.dart.js:5324:76)
a # main.dart.js:3657
$0 # main.dart.js:27022
aec # main.dart.js:5356
aen # main.dart.js:5358
$1 # main.dart.js:26383
af9 # main.dart.js:3738
(anonymous) # main.dart.js:3746
childList (async)
$1 # main.dart.js:26390
a42 # main.dart.js:5363
nB # main.dart.js:5420
lW # main.dart.js:26656
d1 # main.dart.js:26573
nb # main.dart.js:26566
iB # main.dart.js:26567
(anonymous) # main.dart.js:3781
$1 # main.dart.js:29789
af9 # main.dart.js:3738
(anonymous) # main.dart.js:3746
error (async)
Ii # main.dart.js:29019
it # main.dart.js:29015
uz # main.dart.js:4897
yO # main.dart.js:29783
b3 # main.dart.js:7256
aae # main.dart.js:7243
(anonymous) # main.dart.js:15510
(anonymous) # main.dart.js:5208
$2 # main.dart.js:26450
a8 # main.dart.js:5194
Rn # main.dart.js:15542
ca # main.dart.js:15504
(anonymous) # main.dart.js:22768
(anonymous) # main.dart.js:5208
$2 # main.dart.js:26450
a8 # main.dart.js:5194
S9 # main.dart.js:22802
fe # main.dart.js:22762
(anonymous) # main.dart.js:6968
(anonymous) # main.dart.js:5208
$2 # main.dart.js:26450
a8 # main.dart.js:5194
Gl # main.dart.js:6970
(anonymous) # main.dart.js:6931
(anonymous) # main.dart.js:5208
$2 # main.dart.js:26450
a8 # main.dart.js:5194
nz # main.dart.js:6942
afD # main.dart.js:6919
(anonymous) # main.dart.js:13935
(anonymous) # main.dart.js:5208
$2 # main.dart.js:26450
a8 # main.dart.js:5194
Xj # main.dart.js:13946
(anonymous) # main.dart.js:50140
(anonymous) # main.dart.js:50134
dartProgram # main.dart.js:50137
(anonymous) # main.dart.js:50140
Show 26 more frames
main.dart.js:7244
GET http://127.0.0.1:43110/assets/FontManifest.json net::ERR_FAILED
Update the <base href="/"> tag in web/index.html
In your case: <base href="/1ETE7PzFgfVdJ9YBhoG2uq1g5jwZ6N9Dou/">
you should comment this line <base href="/"> on yourProjectDirectory/web/index.html
. after that run flutter build web in terminal and then copy folder yourProjectDirectory/build/web on your any directory that you want on server. it will work at the your address in browser.

How to enable auditing in postgres?

In SQL SERVER 2008/12, we can create audit log under Security Tab using audit specification as
How can we have this in postgres 9.3 ? Or how can we track and view logs in postgres 9.3?
I want to track all the statement/scripts that runs in server via our application or via editor. If possible i want to track old and new value in case of update.
UPDATE I changed my postgresql.conf as below
BUT I am unable to see logs in pg_log folder.
ALSO I tried to create extension CREATE EXTENSION pg_stat_statements;
and tried
SELECT * FROM pg_stat_statements;
and it says
pg_stat_statements must be loaded via shared_preload_libraries
#------------------------------------------------------------------------------
# ERROR REPORTING AND LOGGING
#------------------------------------------------------------------------------
# - Where to Log -
log_destination = 'stderr' # Valid values are combinations of
# stderr, csvlog, syslog, and eventlog,
# depending on platform. csvlog
# requires logging_collector to be on.
# This is used when logging to stderr:
logging_collector = on # Enable capturing of stderr and csvlog
# into log files. Required to be on for
# csvlogs.
# (change requires restart)
# These are only used if logging_collector is on:
log_directory = 'pg_log' # directory where log files are written,
# can be absolute or relative to PGDATA
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
# can include strftime() escapes
log_file_mode = 0600 # creation mode for log files,
# begin with 0 to use octal notation
#log_truncate_on_rotation = off # If on, an existing log file with the
# same name as the new log file will be
# truncated rather than appended to.
# But such truncation only occurs on
# time-driven rotation, not on restarts
# or size-driven rotation. Default is
# off, meaning append to existing files
# in all cases.
#log_rotation_age = 1d # Automatic rotation of logfiles will
# happen after that time. 0 disables.
#log_rotation_size = 10MB # Automatic rotation of logfiles will
# happen after that much log output.
# 0 disables.
# These are relevant when logging to syslog:
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'
# This is only relevant when logging to eventlog (win32):
#event_source = 'PostgreSQL'
# - When to Log -
#client_min_messages = notice # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# log
# notice
# warning
# error
#log_min_messages = warning # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic
#log_min_error_statement = error # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic (effectively off)
#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
# and their durations, > 0 logs only
# statements running at least this number
# of milliseconds
# - What to Log -
#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = on
#log_checkpoints = off
#log_connections = off
#log_disconnections = off
#log_duration = off
#log_error_verbosity = default # terse, default, or verbose messages
#log_hostname = off
log_line_prefix = '%t ' # special values:
# %a = application name
# %u = user name
# %d = database name
# %r = remote host and port
# %h = remote host
# %p = process ID
# %t = timestamp without milliseconds
# %m = timestamp with milliseconds
# %i = command tag
# %e = SQL state
# %c = session ID
# %l = session line number
# %s = session start timestamp
# %v = virtual transaction ID
# %x = transaction ID (0 if none)
# %q = stop here in non-session
# processes
# %% = '%'
# e.g. '<%u%%%d> '
#log_lock_waits = off # log lock waits >= deadlock_timeout
log_statement = 'all' # none, ddl, mod, all
#log_temp_files = -1 # log temporary files equal or larger
# than the specified size in kilobytes;
# -1 disables, 0 logs all temp files
UPDATE
# - What to Log -
#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = on
#log_checkpoints = off
#log_connections = off
#log_disconnections = off
#log_duration = off
#log_error_verbosity = default # terse, default, or verbose messages
#log_hostname = off
log_line_prefix = '%t ' # special values:
# %a = application name
# %u = user name
# %d = database name
# %r = remote host and port
# %h = remote host
# %p = process ID
# %t = timestamp without milliseconds
# %m = timestamp with milliseconds
# %i = command tag
# %e = SQL state
# %c = session ID
# %l = session line number
# %s = session start timestamp
# %v = virtual transaction ID
# %x = transaction ID (0 if none)
# %q = stop here in non-session
# processes
# %% = '%'
# e.g. '<%u%%%d> '
#log_lock_waits = off # log lock waits >= deadlock_timeout
#log_statement = 'none' # none, ddl, mod, all
#log_temp_files = -1 # log temporary files equal or larger
# than the specified size in kilobytes;
# -1 disables, 0 logs all temp files
log_timezone = 'Asia/Katmandu'
#------------------------------------------------------------------------------
# RUNTIME STATISTICS
#------------------------------------------------------------------------------
# - Query/Index Statistics Collector -
#track_activities = on
#track_counts = on
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
#update_process_title = on
#stats_temp_directory = 'pg_stat_tmp'
# - Statistics Monitoring -
#log_parser_stats = off
#log_planner_stats = off
#log_executor_stats = off
#log_statement_stats = off
#------------------------------------------------------------------------------
# WRITE AHEAD LOG
#------------------------------------------------------------------------------
# - Settings -
#wal_level = minimal # minimal, archive, or hot_standby
# (change requires restart)
#fsync = on # turns forced synchronization on or off
#synchronous_commit = on # synchronization level;
# off, local, remote_write, or on
#wal_sync_method = fsync # the default is the first option
# supported by the operating system:
# open_datasync
# fdatasync (default on Linux)
# fsync
# fsync_writethrough
# open_sync
#full_page_writes = on # recover from partial page writes
#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
# (change requires restart)
#wal_writer_delay = 200ms # 1-10000 milliseconds
#commit_delay = 0 # range 0-100000, in microseconds
#commit_siblings = 5 # range 1-1000
# - Checkpoints -
#checkpoint_segments = 3 # in logfile segments, min 1, 16MB each
#checkpoint_timeout = 5min # range 30s-1h
#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
#checkpoint_warning = 30s # 0 disables
# - Archiving -
#archive_mode = off # allows archiving to be done
# (change requires restart)
#archive_command = '' # command to use to archive a logfile segment
# placeholders: %p = path of file to archive
# %f = file name only
# e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
#archive_timeout = 0 # force a logfile segment switch after this
# number of seconds; 0 disables

how to authenticate OTRS users via ldap (Active Directory Windows Server 2003)

I have just finish installation of OTRS-3.2.10-02.noarch.rpm and now I am trying to connect it to Windows Server 2003 SP2 based Active Directory (LDAP). Here is the contents of my configuration (from /opt/otrs/Kernel/Config.pm):
# --
# Kernel/Config.pm - Config file for OTRS kernel
# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --
# Note:
#
# -->> Most OTRS configuration should be done via the OTRS web interface
# and the SysConfig. Only for some configuration, such as database
# credentials and customer data source changes, you should edit this
# file. For changes do customer data sources you can copy the definitions
# from Kernel/Config/Defaults.pm and paste them in this file.
# Config.pm will not be overwritten when updating OTRS.
# --
package Kernel::Config;
use strict;
use warnings;
use utf8;
sub Load {
my $Self = shift;
# ---------------------------------------------------- #
# database settings #
# ---------------------------------------------------- #
# The database host
$Self->{'DatabaseHost'} = 'localhost';
# The database name
$Self->{'Database'} = 'otrs';
# The database user
$Self->{'DatabaseUser'} = 'otrsadmin';
# The password of database user. You also can use bin/otrs.CryptPassword.pl
# for crypted passwords
$Self->{'DatabasePw'} = '76ynhi0r';
# The database DSN for MySQL ==> more: "perldoc DBD::mysql"
$Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";
# The database DSN for PostgreSQL ==> more: "perldoc DBD::Pg"
# if you want to use a local socket connection
# $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};";
# if you want to use a TCP/IP connection
# $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};host=$Self->{DatabaseHost};";
# if you have PostgresSQL 8.1 or earlier, activate the legacy driver with this line:
# $Self->{DatabasePostgresqlBefore82} = 1;
# The database DSN for Microsoft SQL Server - only supported if OTRS is
# installed on Windows as well
# $Self->{DatabaseDSN} = "DBI:ODBC:driver={SQL Server};Database=$Self->{Database};Server=$Self->{DatabaseHost},1433";
# The database DSN for Oracle ==> more: "perldoc DBD::oracle"
# $ENV{ORACLE_HOME} = '/u01/app/oracle/product/10.2.0/client_1';
# $ENV{NLS_DATE_FORMAT} = 'YYYY-MM-DD HH24:MI:SS';
# $ENV{NLS_LANG} = "american_america.utf8";
# $Self->{DatabaseDSN} = "DBI:Oracle:sid=OTRS;host=$Self->{DatabaseHost};port=1522;";
# ---------------------------------------------------- #
# fs root directory
# ---------------------------------------------------- #
$Self->{Home} = '/opt/otrs';
# ---------------------------------------------------- #
# insert your own config settings "here" #
# config settings taken from Kernel/Config/Defaults.pm #
# ---------------------------------------------------- #
# $Self->{SessionUseCookie} = 0;
# $Self->{CheckMXRecord} = 0;
# ---------------------------------------------------- #
# ---------------------------------------------------- #
# data inserted by installer #
# ---------------------------------------------------- #
$DIBI$
# This is an example configuration for an LDAP auth. backend.
# (take care that Net::LDAP is installed!)
$Self->{AuthModule1} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host1'} = '192.168.10.10';
$Self->{'AuthModule::LDAP::BaseDN1'} = 'dc=mydomain,dc=com, dc=pk';
$Self->{'AuthModule::LDAP::UID1'} = 'sAMAccountName';
# The following is valid but would only be necessary if the
# anonymous user do NOT have permission to read from the LDAP tree
$Self->{'AuthModule::LDAP::SearchUserDN1'} = 'CN=otrs search,OU=Users,OU=MACPAK,DC=mydomain,DC=com,DC=pk';
$Self->{'AuthModule::LDAP::SearchUserPw1'} = '76Ynhi0r';
# In case you need to use OTRS in iso-charset, you can define this
# by using this option (converts utf-8 data from LDAP to iso).
# $Self->{'AuthModule::LDAP::Charset'} = 'iso-8859-1';
# Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
$Self->{'AuthModule::LDAP::Params'} = {
port => 389,
timeout => 120,
async => 0,
version => 3,
};
# --------------------------------------------------- #
# authentication sync settings #
# (enable agent data sync. after succsessful #
# authentication) #
# --------------------------------------------------- #
# This is an example configuration for an LDAP auth sync. backend.
# (take care that Net::LDAP is installed!)
$Self->{AuthSyncModule1} = 'Kernel::System::Auth::Sync::LDAP';
$Self->{'AuthSyncModule::LDAP::Host1'} = '192.168.10.10';
$Self->{'AuthSyncModule::LDAP::BaseDN1'} = 'dc=mydomain,dc=com,dc=pk';
$Self->{'AuthSyncModule::LDAP::UID1'} = 'sAMAccountName';
# The following is valid but would only be necessary if the
# anonymous user do NOT have permission to read from the LDAP tree
$Self->{'AuthSyncModule::LDAP::SearchUserDN1'} = 'CN=otrs search,OU=Users,OU=MACPAK,DC=mydomain,DC=com,DC=pk';
$Self->{'AuthSyncModule::LDAP::SearchUserPw1'} = '76Ynhi0r';
# AuthSyncModule::LDAP::UserSyncMap
# (map if agent should create/synced from LDAP to DB after successful login)
$Self->{'AuthSyncModule::LDAP::UserSyncMap1'} = {
# DB -> LDAP
UserFirstname => 'givenName',
UserLastname => 'sn',
UserEmail => 'mail',
};
# In case you need to use OTRS in iso-charset, you can define this
# by using this option (converts utf-8 data from LDAP to iso).
# $Self->{'AuthSyncModule::LDAP::Charset'} = 'iso-8859-1';
# Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
# $Self->{'AuthSyncModule::LDAP::Params'} = {
# port => 389,
# timeout => 120,
# async => 0,
# version => 3,
# };
#Enable LDAP authentication for Customers / Users
$Self->{'Customer::AuthModule2'} = 'Kernel::System::CustomerAuth::LDAP';
$Self->{'Customer::AuthModule::LDAP::Host2'} = '192.168.10.10';
$Self->{'Customer::AuthModule::LDAP::BaseDN2'} = 'dc=mydomain,dc=com,dc=pk';
$Self->{'Customer::AuthModule::LDAP::UID2'} = 'sAMAccountName';
#The following is valid but would only be necessary if the
#anonymous user do NOT have permission to read from the LDAP tree
$Self->{'Customer::AuthModule::LDAP::SearchUserDN2'} = 'CN=otrs search,OU=Users,OU=MACPAK,DC=mydomain,DC=com,DC=pk';
$Self->{'Customer::AuthModule::LDAP::SearchUserPw2'} = '76Ynhi0r';
#CustomerUser
#(customer user database backend and settings)
$Self->{CustomerUser} = {
Module => 'Kernel::System::CustomerUser::LDAP',
Params => {
Host => '192.168.10.10',
BaseDN => 'dc=mydomain,dc=com,dc=pk,
SSCOPE => 'sub',
UserDN =>'CN=otrs search,OU=Users,OU=MACPAK,DC=mydomain,DC=com,DC=pk',
UserPw => '76Ynhi0r',
},
# customer unique id
CustomerKey => 'sAMAccountName',
# customer #
CustomerID => 'mail',
CustomerUserListFields => ['sAMAccountName', 'cn', 'mail'],
CustomerUserSearchFields => ['sAMAccountName', 'cn', 'mail'],
CustomerUserSearchPrefix => '',
CustomerUserSearchSuffix => '*',
CustomerUserSearchListLimit => 250,
CustomerUserPostMasterSearchFields => ['mail'],
CustomerUserNameFields => ['givenname', 'sn'],
Map => [
# note: Login, Email and CustomerID needed!
# var, frontend, storage, shown, required, storage-type
#[ 'UserSalutation', 'Title', 'title', 1, 0, 'var' ],
[ 'UserFirstname', 'Firstname', 'givenname', 1, 1, 'var' ],
[ 'UserLastname', 'Lastname', 'sn', 1, 1, 'var' ],
[ 'UserLogin', 'Login', 'sAMAccountName', 1, 1, 'var' ],
[ 'UserEmail', 'Email', 'mail', 1, 1, 'var' ],
[ 'UserCustomerID', 'CustomerID', 'mail', 0, 1, 'var' ],
[ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var' ],
#[ 'UserAddress', 'Address', 'postaladdress', 1, 0, 'var' ],
#[ 'UserComment', 'Comment', 'description', 1, 0, 'var' ],
],
};
#Add the following lines when only users are allowed to login if they reside in the spicified security group
#Remove these lines if you want to provide login to all users specified in the User Base DN
#example: $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'ou=BaseOU, dc=example, dc=com';
$Self->{'Customer::AuthModule::LDAP::GroupDN'} = 'CN=otrs search,OU=Users,OU=MACPAK,DC=mydomain,DC=com,DC=pk';
$Self->{'Customer::AuthModule::LDAP::AccessAttr'} = 'memberUid';
$Self->{'Customer::AuthModule::LDAP::UserAttr'} = 'UID'
# Die if backend can't work, e. g. can't connect to server.
# $Self->{'AuthSyncModule::LDAP::Die'} = 1;
# Die if backend can't work, e. g. can't connect to server.
# $Self->{'AuthModule::LDAP::Die'} = 1;
# ---------------------------------------------------- #
# ---------------------------------------------------- #
# #
# end of your own config options!!! #
# #
# ---------------------------------------------------- #
# ---------------------------------------------------- #
}
# ---------------------------------------------------- #
# needed system stuff (don't edit this) #
# ---------------------------------------------------- #
use strict;
use warnings;
use vars qw(#ISA);
use Kernel::Config::Defaults;
push (#ISA, 'Kernel::Config::Defaults');
# -----------------------------------------------------#;
1;
After this, I am no more able to connect my orts with http://192.168.10.15/otrs/index.pl and when use
cat /var/log/httpd/error_log | tail
its output is ;
[root#macpk-manage ~]# cat /var/log/httpd/error_log | tail
[Fri Aug 30 21:55:36 2013] Config.pm: (Missing operator before $;?)
[Fri Aug 30 21:55:36 2013] Config.pm: Scalar found where operator expected at /opt/otrs//Kernel/Config.pm line 89, near "$;
[Fri Aug 30 21:55:36 2013] Config.pm:
[Fri Aug 30 21:55:36 2013] Config.pm: # This is an example configuration for an LDAP auth. backend.
[Fri Aug 30 21:55:36 2013] Config.pm: # (take care that Net::LDAP is installed!)
[Fri Aug 30 21:55:36 2013] Config.pm:
[Fri Aug 30 21:55:36 2013] Config.pm: $Self"
[Fri Aug 30 21:55:36 2013] Config.pm: (Missing operator before $Self?)
[Fri Aug 30 21:55:36 2013] [error] Illegal declaration of subroutine Kernel::Config:: at /opt/otrs//Kernel/Config.pm line 176.\nCompilation failed in require at /opt/otrs/scripts/apache2-perl-startup.pl line 68.\nBEGIN failed--compilation aborted at /opt/otrs/scripts/apache2-perl-startup.pl line 68.\nCompilation failed in require at (eval 2) line 1.\n
[Fri Aug 30 21:55:36 2013] [error] Can't load Perl file: /opt/otrs/scripts/apache2-perl-startup.pl for server macpk-manage.macrosoftinc.com.pk:80, exiting...
I also tried to restart httpd service but it fails and when even I restart CentOS 6.4, it shows httpd Failed to run, Aanyhelp will be highly appreciated and thanks in advance;
There's a missing quote after BaseDN, see this:
- BaseDN => 'dc=mydomain,dc=com,dc=pk,
+ BaseDN => 'dc=mydomain,dc=com,dc=pk',
https://gist.github.com/mbeijen/72a15954b601eaaae797/revisions
If you want to make sure you balanced your quotes and such correctly, you can type on the command line perl -cw Kernel/Config.pm
You need to comment out the following line:
$DIBI$
and also add this:
$Self->{'DefaultCharset'} = 'utf-8';
I think you need to check this two line with your domin.local
UserDN =>'CN=otrs search,OU=Users,OU=MACPAK,DC=mydomain,DC=com,DC=pk',
UserPw => '76Ynhi0r',