0
Not a bug

Binding Ajenti to a Network Interface

Steve Wilson fa 11 anys updated by Eugene Pankov (Project coordinator) fa 11 anys 6

I have Ajenti running on a system with two network interfaces and I would like to bind Ajenti to one of the two interfaces. 


In /etc/ajenti/config.json I've set the following:


 "bind": {
  "host": "192.168.1.201",
  "port": 8000
  }


Where 192.168.1.201 is the address I would like to bind to. After restarting the Ajenti service, I point my browser to https://192.168.1.201:8000 I get a

Internal Server Error
Any help would be greatly appreciated.

Please stop ajenti service and run ajenti-panel command in foreground to see what error happens.

Running ajenti-panel returns:


20.09.2013 18:19 INFO  Ajenti starting in foreground
20.09.2013 18:19 INFO  registered crypt handler 'sha512_crypt': <class 'passlib.handlers.sha2_crypt.sha512_crypt'>
20.09.2013 18:19 INFO  Ajenti 1.0.3 running on platform: debian
20.09.2013 18:19 WARN  *** [mysql] skipping due to BinaryDependency (mysql)
20.09.2013 18:19 WARN  *** [bind9] skipping due to BinaryDependency (named)
20.09.2013 18:19 WARN  *** [exports] skipping due to BinaryDependency (nfsstat)
20.09.2013 18:19 WARN  *** [supervisor] skipping due to BinaryDependency (supervisord)
20.09.2013 18:19 WARN  *** [squid] skipping due to BinaryDependency (squid3)
20.09.2013 18:19 WARN  *** [nginx] skipping due to BinaryDependency (nginx)
20.09.2013 18:19 WARN  *** [lm-sensors] skipping due to BinaryDependency (sensors)
20.09.2013 18:19 WARN  *** [ctdb] skipping due to BinaryDependency (ctdb)
20.09.2013 18:19 WARN  *** [memcache] skipping due to BinaryDependency (memcached)
20.09.2013 18:19 WARN  *** [raid] skipping due to BinaryDependency (mdadm)
20.09.2013 18:19 WARN  *** [hddtemp] skipping due to BinaryDependency (hddtemp)
20.09.2013 18:19 WARN  *** [vh] Plugin error: format error
20.09.2013 18:19 WARN  *** [apache] skipping due to BinaryDependency (apache2)
20.09.2013 18:19 WARN  *** [netatalk] skipping due to BinaryDependency (afpd)
20.09.2013 18:19 WARN  *** [nsd] skipping due to BinaryDependency (nsd)
20.09.2013 18:19 WARN  *** [megaraid] skipping due to FileDependency (/opt/MegaRAID/MegaCli/MegaCli)
20.09.2013 18:19 WARN  *** [dhcpd] skipping due to BinaryDependency (dhcpd)
20.09.2013 18:19 WARN  *** [psql] skipping due to BinaryDependency (psql)
20.09.2013 18:19 WARN  *** [smartctl] skipping due to BinaryDependency (smartctl)
20.09.2013 18:19 WARN  *** [elements] Plugin error: format error
20.09.2013 18:19 WARN  *** [munin] skipping due to BinaryDependency (munin-cron)
20.09.2013 18:19 INFO  Starting SSL tunnel for port 54301
20.09.2013 18:19 INFO  SSL tunnel running fine
20.09.2013 18:19 INFO  Starting server on (u'127.0.0.1', 54301)
20.09.2013 18:19 INFO  Starting new HTTP connection (1): meta.ajenti.org


The interface I would like to bind to is not the default route if that matters.

Now that you have started Ajenti from command line, try opening a browser and see the output in console when "internal server error" occurs.

Thanks for your help. This is what I see in my console when I try to load Ajenti in my browser:


Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gevent/pywsgi.py", line 438, in handle_one_response
  self.run_application()
  File "/usr/lib/python2.7/dist-packages/gevent/pywsgi.py", line 424, in run_application
  self.result = self.application(self.environ, self.start_response)
  File "/usr/lib/pymodules/python2.7/ajenti/http.py", line 30, in dispatch
  output = middleware.handle(context)
  File "/usr/lib/pymodules/python2.7/ajenti/middleware.py", line 95, in handle
  ignore_bad_cookies=True,
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 1094, in from_request
  header_data, ignore_bad_cookies=ignore_bad_cookies)
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 1031, in parse_request
  cookie = Cookie.from_dict(cookie_dict)
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 737, in from_dict
  cookie = Cookie(name, value)
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 699, in __init__
  self.value = value or ''
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 811, in __setattr__
  repr(self.attribute_validators.get(name)))
InvalidCookieAttributeError: did not validate with <function valid_value at 0x1a241b8>: 'value' = u'o:columns=a%3Ao%253Aid%253Ds%25253Aqueue%255Ewidth%253Dn%25253A30%255Esortable%253Db%25253A1%5Eo%253Aid%253Ds%25253Aname%255Ewidth%253Dn%25253A731%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A2%255Ewidth%253Dn%25253A75%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A3%255Ewidth%253Dn%25253A150%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A4%255Ewidth%253Dn%25253A80%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A5%255Ewidth%253Dn%25253A80%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A6%255Ewidth%253Dn%25253A60%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A7%255Ewidth%253Dn%25253A60%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A8%255Ewidth%253Dn%25253A60%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A9%255Ewidth%253Dn%25253A60%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A10%255Ewidth%253Dn%25253A60%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A11%255Ewidth%253Dn%25253A80%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A12%255Ewidth%253Dn%25253A120%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A13%255Ewidth%253Dn%25253A120%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A14%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A15%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A16%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A17%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A18%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1^sort=o%3Afield%3Ds%253Aqueue%5Edirection%3Ds%253AASC'
<SocketIOServer fileno=3 address=127.0.0.1:47669>: Failed to handle request:
  request = GET / HTTP/1.1 from ('127.0.0.1', 44770)
  application = <bound method HttpRoot.dispatch of <ajenti.http.HttpRoot instance at 0x1fafa28>>

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gevent/pywsgi.py", line 438, in handle_one_response
  self.run_application()
  File "/usr/lib/python2.7/dist-packages/gevent/pywsgi.py", line 424, in run_application
  self.result = self.application(self.environ, self.start_response)
  File "/usr/lib/pymodules/python2.7/ajenti/http.py", line 30, in dispatch
  output = middleware.handle(context)
  File "/usr/lib/pymodules/python2.7/ajenti/middleware.py", line 95, in handle
  ignore_bad_cookies=True,
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 1094, in from_request
  header_data, ignore_bad_cookies=ignore_bad_cookies)
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 1031, in parse_request
  cookie = Cookie.from_dict(cookie_dict)
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 737, in from_dict
  cookie = Cookie(name, value)
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 699, in __init__
  self.value = value or ''
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 811, in __setattr__
  repr(self.attribute_validators.get(name)))
InvalidCookieAttributeError: did not validate with <function valid_value at 0x1a241b8>: 'value' = u'o:columns=a%3Ao%253Aid%253Ds%25253Aqueue%255Ewidth%253Dn%25253A30%255Esortable%253Db%25253A1%5Eo%253Aid%253Ds%25253Aname%255Ewidth%253Dn%25253A731%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A2%255Ewidth%253Dn%25253A75%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A3%255Ewidth%253Dn%25253A150%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A4%255Ewidth%253Dn%25253A80%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A5%255Ewidth%253Dn%25253A80%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A6%255Ewidth%253Dn%25253A60%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A7%255Ewidth%253Dn%25253A60%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A8%255Ewidth%253Dn%25253A60%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A9%255Ewidth%253Dn%25253A60%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A10%255Ewidth%253Dn%25253A60%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A11%255Ewidth%253Dn%25253A80%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A12%255Ewidth%253Dn%25253A120%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A13%255Ewidth%253Dn%25253A120%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A14%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A15%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A16%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A17%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A18%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1^sort=o%3Afield%3Ds%253Aqueue%5Edirection%3Ds%253AASC'
<SocketIOServer fileno=3 address=127.0.0.1:47669>: Failed to handle request:
  request = GET /favicon.ico HTTP/1.1 from ('127.0.0.1', 44769)
  application = <bound method HttpRoot.dispatch of <ajenti.http.HttpRoot instance at 0x1fafa28>>

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gevent/pywsgi.py", line 438, in handle_one_response
  self.run_application()
  File "/usr/lib/python2.7/dist-packages/gevent/pywsgi.py", line 424, in run_application
  self.result = self.application(self.environ, self.start_response)
  File "/usr/lib/pymodules/python2.7/ajenti/http.py", line 30, in dispatch
  output = middleware.handle(context)
  File "/usr/lib/pymodules/python2.7/ajenti/middleware.py", line 95, in handle
  ignore_bad_cookies=True,
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 1094, in from_request
  header_data, ignore_bad_cookies=ignore_bad_cookies)
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 1031, in parse_request
  cookie = Cookie.from_dict(cookie_dict)
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 737, in from_dict
  cookie = Cookie(name, value)
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 699, in __init__
  self.value = value or ''
  File "/usr/lib/pymodules/python2.7/ajenti/cookies.py", line 811, in __setattr__
  repr(self.attribute_validators.get(name)))
InvalidCookieAttributeError: did not validate with <function valid_value at 0x1a241b8>: 'value' = u'o:columns=a%3Ao%253Aid%253Ds%25253Aqueue%255Ewidth%253Dn%25253A30%255Esortable%253Db%25253A1%5Eo%253Aid%253Ds%25253Aname%255Ewidth%253Dn%25253A731%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A2%255Ewidth%253Dn%25253A75%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A3%255Ewidth%253Dn%25253A150%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A4%255Ewidth%253Dn%25253A80%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A5%255Ewidth%253Dn%25253A80%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A6%255Ewidth%253Dn%25253A60%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A7%255Ewidth%253Dn%25253A60%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A8%255Ewidth%253Dn%25253A60%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A9%255Ewidth%253Dn%25253A60%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A10%255Ewidth%253Dn%25253A60%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A11%255Ewidth%253Dn%25253A80%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A12%255Ewidth%253Dn%25253A120%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A13%255Ewidth%253Dn%25253A120%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A14%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A15%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A16%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A17%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1%5Eo%253Aid%253Dn%25253A18%255Ewidth%253Dn%25253A75%255Ehidden%253Db%25253A1%255Esortable%253Db%25253A1^sort=o%3Afield%3Ds%253Aqueue%5Edirection%3Ds%253AASC'
<SocketIOServer fileno=3 address=127.0.0.1:47669>: Failed to handle request:
  request = GET /favicon.ico HTTP/1.1 from ('127.0.0.1', 44771)
  application = <bound method HttpRoot.dispatch of <ajenti.http.HttpRoot instance at 0x1fafa28>>

Looks like some invalid cookies left over from other applications running at this URL. Either clean the cookies or collect them and send them to me so I can try to fix this behavior.

Clearing the cookies from my browser completely solved the issue.

Thank you very much for your help.