I am trying to connect with ejabberd server using strophe.js, but I got the following error:
POST http://localhost/http-bind/ 404 (Not Found)
Strophe.Bosh._processRequest.sendFunc # strophe.js:4614
Strophe.Bosh._processRequest # strophe.js:4626
Strophe.Bosh._throttledRequestHandler # strophe.js:4778
Strophe.Bosh._connect # strophe.js:4177Strophe.Connection.connect # strophe.js:2335
$scope.login # app.js:162
fn # VM165:4
Ic.(anonymous function).compile.d.on.f # angular.js:23411
$get.n.$eval # angular.js:15916
$get.n.$apply # angular.js:16016
(anonymous function) # angular.js:23416
n.event.dispatch # jquery-2.1.3.min.js:3
n.event.add.r.handle # jquery-2.1.3.min.js:3
strophe.js:2784 7
I have found that Skype some time use port 80, that was assigned to Apache server.This think may prevent the http-binding.After quit Skype, It works fine.
Related
I am trying to install net-snmp from scratch to make snmpv3 to work on my computer.
I did install net-snmp and create the user, but when I want to make snmpget it reject me with snmpget: Unknown user name
To install net-snmp I followed the official guide
I did install the packages libperl-dev, snmp-mibs-downloader and snmp too using sudo apt-get install
Here is my /usr/local/share/snmp configuration where you can find the particular line rouser neutg
###############################################################################
#
# EXAMPLE.conf:
# An example configuration file for configuring the Net-SNMP agent ('snmpd')
# See the 'snmpd.conf(5)' man page for details
#
# Some entries are deliberately commented out, and will need to be explicitly activated
#
###############################################################################
#
# AGENT BEHAVIOUR
#
# Listen for connections from the local system only
# agentAddress udp:127.0.0.1:161
# Listen for connections on all interfaces (both IPv4 *and* IPv6)
agentAddress udp:161,udp6:[::1]:161
###############################################################################
#
# SNMPv3 AUTHENTICATION
#
# Note that these particular settings don't actually belong here.
# They should be copied to the file /var/lib/snmp/snmpd.conf
# and the passwords changed, before being uncommented in that file *only*.
# Then restart the agent
# createUser authOnlyUser MD5 "remember to change this password"
# createUser authPrivUser SHA "remember to change this one too" DES
# createUser internalUser MD5 "this is only ever used internally, but still change the password"
# If you also change the usernames (which might be sensible),
# then remember to update the other occurances in this example config file to match.
###############################################################################
#
# ACCESS CONTROL
#
# system + hrSystem groups only
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
# Full access from the local host
#rocommunity public localhost
# Default access to basic system info
rocommunity public default -V systemonly
# rocommunity6 is for IPv6
rocommunity6 public default -V systemonly
# Full access from an example network
# Adjust this network address to match your local
# settings, change the community string,
# and check the 'agentAddress' setting above
#rocommunity secret 10.0.0.0/16
# Full read-only access for SNMPv3
rouser authOnlyUser
# Full write access for encrypted requests
# Remember to activate the 'createUser' lines above
#rwuser authPrivUser priv
# It's no longer typically necessary to use the full 'com2sec/group/access' configuration
# r[ow]user and r[ow]community, together with suitable views, should cover most requirements
###############################################################################
#
# SYSTEM INFORMATION
#
# Note that setting these values here, results in the corresponding MIB objects being 'read-only'
# See snmpd.conf(5) for more details
sysLocation Sitting on the Dock of the Bay
sysContact Me <me#example.org>
# Application + End-to-End layers
sysServices 72
#
# Process Monitoring
#
# At least one 'mountd' process
proc mountd
# No more than 4 'ntalkd' processes - 0 is OK
proc ntalkd 4
# At least one 'sendmail' process, but no more than 10
proc sendmail 10 1
# Walk the UCD-SNMP-MIB::prTable to see the resulting output
# Note that this table will be empty if there are no "proc" entries in the snmpd.conf file
#
# Disk Monitoring
#
# 10MBs required on root disk, 5% free on /var, 10% free on all other disks
disk / 10000
disk /var 5%
includeAllDisks 10%
# Walk the UCD-SNMP-MIB::dskTable to see the resulting output
# Note that this table will be empty if there are no "disk" entries in the snmpd.conf file
#
# System Load
#
# Unacceptable 1-, 5-, and 15-minute load averages
load 12 10 5
# Walk the UCD-SNMP-MIB::laTable to see the resulting output
# Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file
###############################################################################
#
# ACTIVE MONITORING
#
# send SNMPv1 traps
trapsink localhost public
# send SNMPv2c traps
#trap2sink localhost public
# send SNMPv2c INFORMs
#informsink localhost public
# Note that you typically only want *one* of these three lines
# Uncommenting two (or all three) will result in multiple copies of each notification.
#
# Event MIB - automatically generate alerts
#
# Remember to activate the 'createUser' lines above
iquerySecName internalUser
rouser internalUser
# generate traps on UCD error conditions
defaultMonitors yes
# generate traps on linkUp/Down
linkUpDownNotifications yes
###############################################################################
#
# EXTENDING THE AGENT
#
#
# Arbitrary extension commands
#
extend test1 /bin/echo Hello, world!
extend-sh test2 echo Hello, world! ; echo Hi there ; exit 35
#extend-sh test3 /bin/sh /tmp/shtest
# Note that this last entry requires the script '/tmp/shtest' to be created first,
# containing the same three shell commands, before the line is uncommented
# Walk the NET-SNMP-EXTEND-MIB tables (nsExtendConfigTable, nsExtendOutput1Table
# and nsExtendOutput2Table) to see the resulting output
# Note that the "extend" directive supercedes the previous "exec" and "sh" directives
# However, walking the UCD-SNMP-MIB::extTable should still returns the same output,
# as well as the fuller results in the above tables.
#
# "Pass-through" MIB extension command
#
#pass .1.3.6.1.4.1.8072.2.255 /bin/sh PREFIX/local/passtest
#pass .1.3.6.1.4.1.8072.2.255 /usr/bin/perl PREFIX/local/passtest.pl
# Note that this requires one of the two 'passtest' scripts to be installed first,
# before the appropriate line is uncommented.
# These scripts can be found in the 'local' directory of the source distribution,
# and are not installed automatically.
# Walk the NET-SNMP-PASS-MIB::netSnmpPassExamples subtree to see the resulting output
#
# AgentX Sub-agents
#
# Run as an AgentX master agent
master agentx
# Listen for network connections (from localhost)
# rather than the default named socket /var/agentx/master
#agentXSocket tcp:localhost:705
rouser neutg
Here is my persistant configuration file /var/net-snmp/snmpd.conf
createUser neutg SHA "password" AES passphrase
The command I run is :
snmpget -u neutg -A password -a SHA -X 'passphrase'
-x AES -l authPriv localhost -v 3 1.3.6.1.2.1.1
I don't understand why it do not take in count my user. (I did restart the snmpd after entering the user - multiple times!)
The version of net-snmp I use :
Thanks in advance :)
After many research I've found what the problem is.
snmpd was not taking in count my configuration files. I saw it using the command :
snmpd -Dread_config -H 2>&1 | grep "Reading" | sort -u
Which tells you which configurations files are loaded by snmpd.
You can see it as well looking at the configuration file /var/lib/snmp/snmpd.conf. When snmpd handle your users it creates special lines in the file. It looks like :
usmUser 1 3 0x80001f888074336938f74f7c5a00000000 "neutg" "neutg" NULL .1.3.6.1.6.3.10.1.1.3 0xf965e4ab0f35eebb3f0e3b30\
6bc0797c025821c5 .1.3.6.1.6.3.10.1.2.4 0xe277044beccd9991d70144c4c8f4b672 0x
usmUser 1 3 0x80001f888074336938f74f7c5a00000000 "myuser" "myuser" NULL .1.3.6.1.6.3.10.1.1.2 0x2223c2d00758353b7c3076\
236be02152 .1.3.6.1.6.3.10.1.2.2 0x2223c2d00758353b7c3076236be02152 0x
setserialno 1424757026
So if you do not see any usmUser it's probably that your badly added your users.
The soluce
sudo /usr/local/sbin/snmpd -c /var/net-snmp/snmpd.conf -c /usr/local/share/snmp/snmpd.conf
mngmt-users.properties file. The users are added in the file but when I try to run the localhost it says it's running then if I try to view the admin console it is redirecting to http://localhost:9990/error/index_win.html. That tells the server is running but I could not open admin console.
#
# Properties declaration of users for the realm 'ManagementRealm' which is the default realm
# for new installations. Further authentication mechanism can be configured
# as part of the <management /> in standalone.xml.
#
# Users can be added to this properties file at any time, updates after the server has started
# will be automatically detected.
#
# By default the properties realm expects the entries to be in the format: -
# username=HEX( MD5( username ':' realm ':' password))
#
# A utility script is provided which can be executed from the bin folder to add the users: -
# - Linux
# bin/add-user.sh
#
# - Windows
# bin\add-user.bat
#
#$REALM_NAME=ManagementRealm$ This line is used by the add-user utility to identify the realm name already used in this file.
#
# On start-up the server will also automatically add a user $local - this user is specifically
# for local tools running against this AS installation.
#
# The following illustrates how an admin user could be defined, this
# is for illustration only and does not correspond to a usable password.
#
#admin=2a0923285184943425d1f53ddd58ec7a
tejaswini=25ab658c2861b2e64783aaa9ba95c2e5
aswini#19=388ced81791ddb1760b83dc4ec8b7a61
saisana=ff39d778414ab12d84fc4fa7fdacb634
alekya=d72e9c90345ce4d9290c3a2728b3cd60
prasad=c6c7c67cf343f6862d3b77bae9f61d17
teju=28b9e55b314fd60855a7843b4455dbed
Screen shot of added user
May be u have tried to create specifically application user or management user when u ran the addUser utility,
please refer the below link for steps to register user
https://bgasparotto.com/add-user-wildfly
I have been running a SAP UI5 application for a year with out any problems. But today it changed and gave me Access-Control-Allow-Origin.
This the code. I have only tried to change the version but it does not help.
<script
id="sap-ui-bootstrap"
src="https://sapui5.netweaver.ondemand.com/1.38.12/resources/sap-ui-core.js"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-libs="sap.ui.commons,sap.ui.layout, sap.ui.table,sap.m,sap.ui"
data-sap-ui-xx-bindingSyntax="complex"
data-sap-ui-resourceroots='{"VendorApprovalComponent.DO_OrgTransord" : "./" }' >
</script>
The errors that I'm getting is the following.
XMLHttpRequest cannot load sapui5.netweaver.ondemand.com/1.38.12/resources/sap/ui/layout/library-preload.json.
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'CUSTOMERURL' is therefore not allowed access.
The response had HTTP status code 404.send # sap-ui-core.js:126ajax # sap-ui-core.js:126q.sap.preloadModules # sap-ui-core.js:174(anonymous function) # sap-ui-core.js:174each # sap-ui-core.js:115q.sap.registerPreloadedModules # sap-ui-core.js:174success # sap-ui-core.js:174p # sap-ui-core.js:126fireWith # sap-ui-core.js:126h3 # sap-ui-core.js:126(anonymous function) # sap-ui-core.js:126send # sap-ui-core.js:126ajax # sap-ui-core.js:126q.sap.preloadModules # sap-ui-core.js:174(anonymous function) # sap-ui-core.js:833each # sap-ui-core.js:115constructor # sap-ui-core.js:833(anonymous function) # sap-ui-core.js:949applyAMDFactoryFn # sap-ui-core.js:174(anonymous function) # sap-ui-core.js:174t1 # sap-ui-core.js:174sap.ui.define # sap-ui-core.js:174s1 # sap-ui-core.js:174r1 # sap-ui-core.js:174q.sap.require # sap-ui-core.js:174(anonymous function) # sap-ui-core.js:1761
sap-ui-core.js:160 2016-11-03 11:32:52.176935 failed to preload 'sap.ui.layout.library-preload': NetworkError: Failed to execute 'send' on
My webserver is a SAP NW JAVA server running behind a ICM firewall.
I've built nginx from sources with lua support and I'm able to run server-side scripts like this:
http {
lua_package_path '/usr/local/share/lua/5.1/?.lua;;';
server {
listen 80;
location /hi {
content_by_lua '
ngx.header["Content-Type"] = "text/plain;charset=utf-8"
ngx.say("Hello world!")
--local s = require("socket")
ngx.say(_VERSION);
';
}
}
}
So when I access http://localhost/hi, I get this output:
Hello world!
Lua 5.1
If I uncomment line local s = require("socket") then I get following error in my browser:
Unable to load page
Problem occurred while loading the URL http://localhost/hi
Connection terminated unexpectedly
soucket.lua presents in this folder:
root#debian:/usr/local/share/lua/5.1# ls
ltn12.lua mime.lua socket socket.lua
UPDATE: adding cpath doesn't help:
lua_package_cpath '/usr/local/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/socket/?.so;;';
# ls /usr/local/lib/lua/5.1/socket/*.so
/usr/local/lib/lua/5.1/socket/core.so /usr/local/lib/lua/5.1/socket/serial.so /usr/local/lib/lua/5.1/socket/unix.so
# ls /usr/local/share/lua/5.1/
ltn12.lua mime.lua socket socket.lua
How can I fix/diagnose this problem?
Thanx
If the socket.lua is the diegonehab/luasocket,
then it requires socket/core.so
You need to specify the lua_package_cpath
cpath is for compiled shared library modules (.so), path is for text modules (.lua)
/usr/local/lib/lua/5.1/?.so - most common value for cpath
Do not try to use LuaSocket inside nginx. LuaSocket is a blocking library and nginx is non-blocking so you will have problems. Check out ngx.socket.tcp instead. Its API is compatible with socket.tcp but it is non-blocking.
I'm having a hard time setting up the replication between PouchDB and Sync Gateway.
I tried to follow Couchbase's blog post, but I wasn't successfull, either.
I'm building an Ionic application with angular-pouchdb and ng-pouchdb.
Here's what I got figured out so far:
every time I call pouchCollection it either creates a new database with the given name, or gives you a reference of the already created database;
the Sync Gateway is responsible for authorization of each document. I'm running it now with the GUEST user enabled, with "admin_channels": ["*"], so everyone should be able to access everything, right?
CORS should be enable, since both the app and the server are running on the same machine (localhost)
to get replication in both ways, I should use db.sync(URL) (angular-pouchdb), where URL is something like http://localhost:4984/prospect/ (and prospect could be the DB name)
Here's my Sync Gateway config.json file:
{
"log": ["CRUD", "REST+", "Access"],
"facebook": {"register": true},
"CORS": {
"Origin": ["http://localhost:8100"],
"LoginOrigin": ["http://localhost:8100"],
"Headers": ["Content-Type"],
"MaxAge": 17280000
},
"databases": {
"prospect": {
"server": "walrus:",
"users": {
"GUEST": {"disabled": false, "admin_channels": ["*"]}
},
"sync":
`
function(doc, oldDoc) {
channel("everything");
}
`
}
}
}
Here's my Ionic code:
app.controller('MyCtrl', function($scope, pouchCollection) {
$scope.students = pouchCollection('students');
var URL = 'http://localhost:4984/prospect/';
$scope.students.$db.replicate.sync(URL);
// ...list the array in the view
}
Whenever I try to make the replication work, I get the following in the console when running for the first time:
GET http://localhost:4984/prospect/_local/jeOaLtKGemQWDpNAPzorJQ%3D%3D?_nonce=1442271117949 404 (Not Found)xhRequest # pouchdb.js:641625.module.exports # pouchdb.js:6435ajax # pouchdb.js:604824.module.exports # pouchdb.js:6211ajax # pouchdb.js:989(anonymous function) # pouchdb.js:994ajaxPromise # pouchdb.js:993(anonymous function) # pouchdb.js:1241(anonymous function) # pouchdb.js:1069979 # pouchdb.js:10760(anonymous function) # pouchdb.js:7659(anonymous function) # pouchdb.js:764679 # pouchdb.js:1076068.Checkpointer.getCheckpoint # pouchdb.js:9407(anonymous function) # pouchdb.js:10076
pouchdb.js:6416 GET http://localhost:4984/prospect/_local/2_QcxPjLD.zmtOXa7VM8Gw%3D%3D?_nonce=1442271117953 404 (Not Found)xhRequest # pouchdb.js:641625.module.exports # pouchdb.js:6435ajax # pouchdb.js:604824.module.exports # pouchdb.js:6211ajax # pouchdb.js:989(anonymous function) # pouchdb.js:994ajaxPromise # pouchdb.js:993(anonymous function) # pouchdb.js:1241(anonymous function) # pouchdb.js:1069979 # pouchdb.js:10760(anonymous function) # pouchdb.js:7659(anonymous function) # pouchdb.js:764679 # pouchdb.js:10760(anonymous function) # pouchdb.js:9408
pouchdb.js:6416 GET http://localhost:4984/prospect/_local/jeOaLtKGemQWDpNAPzorJQ%3D%3D?_nonce=1442271118095 404 (Not Found)xhRequest # pouchdb.js:641625.module.exports # pouchdb.js:6435ajax # pouchdb.js:604824.module.exports # pouchdb.js:6211ajax # pouchdb.js:989(anonymous function) # pouchdb.js:994ajaxPromise # pouchdb.js:993(anonymous function) # pouchdb.js:1241(anonymous function) # pouchdb.js:1069979 # pouchdb.js:10760(anonymous function) # pouchdb.js:7659(anonymous function) # pouchdb.js:764679 # pouchdb.js:10760updateCheckpoint # pouchdb.js:930368.Checkpointer.updateTarget # pouchdb.js:936868.Checkpointer.writeCheckpoint # pouchdb.js:9362finishBatch # pouchdb.js:9829
(index):28 The above 404 is totally normal. PouchDB is just checking if a remote checkpoint exists.
Since the last line says it is normal, I assume everything is fine.
When I run the app in the browser and in the emulator, Sync Gateway says things like:
2015-09-14T19:54:04.913-03:00 HTTP: #001: GET /prospect/?_nonce=1442271244612
2015-09-14T19:54:18.730-03:00 HTTP: #002: GET /prospect/?_nonce=1442271258729
...
2015-09-14T19:56:13.362-03:00 HTTP: #049: GET /prospect/_local/2_QcxPjLD.zmtOXa7VM8Gw==?_nonce=1442271373356
2015-09-14T19:56:13.376-03:00 HTTP: #050: PUT /prospect/_local/2_QcxPjLD.zmtOXa7VM8Gw==
To me, it looks like everything is working. But I can't get it to sync with the iOS emulator or in a different browser.
What am I missing?
For your Questions..
[2]: The * Star channel is the channel where every document is automatically added to that channel. Example, a guest user will be granted the * star channel where that gives you the open ended access so any user that gets * (star) will be able to see everything in the system.
[3]: You do not need to enable CORS as sync gateway is running on the same domain as your webapp. Enabling CORS allows web apps to access resources on other domains rather than the origin domain.
The LoginOrigin list protects access to the _session and _facebook endpoints.
[4]: To replicate your data, within the app.js file you would define a URL variable for sync, like:
var SYNC_GATEWAY_URL = 'http://127.0.0.1:4984/prospect/';