{"id":177,"date":"2017-02-20T10:30:37","date_gmt":"2017-02-20T10:30:37","guid":{"rendered":"http:\/\/blog.warbel.net\/?p=177"},"modified":"2018-02-11T07:30:59","modified_gmt":"2018-02-10T23:30:59","slug":"how-to-install-and-configure-a-direct-connect-hub-ptokax-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/blog.warbel.net\/index.php\/2017\/02\/20\/how-to-install-and-configure-a-direct-connect-hub-ptokax-on-ubuntu-16-04\/","title":{"rendered":"How to Install and configure a Direct Connect Hub (PtokaX) on Ubuntu 16.04."},"content":{"rendered":"<h1>Background:<\/h1>\n<p>I wrote this documentation as the process\u00a0serves as a good template for downloading, compiling from source, installing, configuring, and finally creating a systemd style script that will start a service at boot.<\/p>\n<h1>Process:<\/h1>\n<p>Download source from their website: <a href=\"http:\/\/www.ptokax.org\/files\/0.5.2.1-nix-src.tgz\">http:\/\/www.ptokax.org\/files\/0.5.2.1-nix-src.tgz<\/a><\/p>\n<pre>wget\u00a0http:\/\/www.ptokax.org\/files\/0.5.2.1-nix-src.tgz<\/pre>\n<p>Install the dependencies:<\/p>\n<pre><strong>sudo apt install make g++ zlib1g-dev libtinyxml-dev liblua5.3-dev -y\r\n<\/strong><\/pre>\n<p>Expand the archive and change into the directory:<\/p>\n<pre><strong>tar -xf 0.5.2.1-nix-src.tgz;cd PtokaX<\/strong><\/pre>\n<p>Compile the program (I&#8217;m compiling without database support):<\/p>\n<pre>make clean\r\nmake\r\nsudo make install<\/pre>\n<p>Create a new system user to run the process:<\/p>\n<pre>sudo adduser --system --group --no-create-home --disabled-login ptokax<\/pre>\n<p>Create the directory in etc for the configuration files:<\/p>\n<pre>sudo mkdir \/etc\/ptokax<\/pre>\n<p>Run the initial config and configure according to your tastes, give the ptokax user access.<\/p>\n<pre>sudo PtokaX -m -c \/etc\/ptokax\r\nsudo chown ptokax:ptokax -R \/etc\/ptokax\/*<\/pre>\n<p>Create a new file in the directory: <strong>\/lib\/systemd\/system\/ <\/strong>called<strong>\u00a0<\/strong>ptokax.service with the following in it:<\/p>\n<pre>[Unit]\r\nDescription=PtokaX Direct Connect Hub\r\nAfter=network.target\r\n#Requires=apache2.service\r\n\r\n[Service]\r\nType=forking\r\nExecStart=\/usr\/local\/bin\/PtokaX -d -c \/etc\/ptokax\r\nUser=ptokax\r\nGroup=ptokax\r\n\r\n[Install]\r\nWantedBy=multi-user.target<\/pre>\n<p>Reload, enable and start the process.<\/p>\n<pre>sudo systemctl daemon-reload\r\nsudo systemctl enable ptokax.service\r\nsudo systemctl start ptokax.service<\/pre>\n<p>&nbsp;<\/p>\n<p>Test the connection:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-184\" src=\"http:\/\/blog.warbel.net\/wp-content\/uploads\/2017\/02\/cmd_test.jpg\" alt=\"\" width=\"974\" height=\"201\" srcset=\"https:\/\/blog.warbel.net\/wp-content\/uploads\/2017\/02\/cmd_test.jpg 974w, https:\/\/blog.warbel.net\/wp-content\/uploads\/2017\/02\/cmd_test-300x62.jpg 300w, https:\/\/blog.warbel.net\/wp-content\/uploads\/2017\/02\/cmd_test-768x158.jpg 768w, https:\/\/blog.warbel.net\/wp-content\/uploads\/2017\/02\/cmd_test-500x103.jpg 500w\" sizes=\"auto, (max-width: 974px) 100vw, 974px\" \/><\/p>\n<h1><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-183\" src=\"http:\/\/blog.warbel.net\/wp-content\/uploads\/2017\/02\/apexdc.jpg\" alt=\"\" width=\"1269\" height=\"337\" srcset=\"https:\/\/blog.warbel.net\/wp-content\/uploads\/2017\/02\/apexdc.jpg 1269w, https:\/\/blog.warbel.net\/wp-content\/uploads\/2017\/02\/apexdc-300x80.jpg 300w, https:\/\/blog.warbel.net\/wp-content\/uploads\/2017\/02\/apexdc-768x204.jpg 768w, https:\/\/blog.warbel.net\/wp-content\/uploads\/2017\/02\/apexdc-1024x272.jpg 1024w, https:\/\/blog.warbel.net\/wp-content\/uploads\/2017\/02\/apexdc-500x133.jpg 500w\" sizes=\"auto, (max-width: 1269px) 100vw, 1269px\" \/><\/h1>\n<h1>Final Notes:<\/h1>\n<p>If you want to make configuration changes, stop the service first, then either run the Ptokax program as sudo with the -m -c \/etc\/ptokax flags to configure it, or manually edit it&#8217;s configuration files.<\/p>\n<h1>Further Reading:<\/h1>\n<p><a href=\"http:\/\/wiki.ptokax.org\/doku.php?id=guides:debian_bugbuntu\">http:\/\/wiki.ptokax.org\/doku.php?id=guides:debian_bugbuntu<\/a><br \/>\n<a href=\"http:\/\/patrakov.blogspot.com.au\/2011\/01\/writing-systemd-service-files.html\">http:\/\/patrakov.blogspot.com.au\/2011\/01\/writing-systemd-service-files.html<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Background: I wrote this documentation as the process\u00a0serves as a good template for downloading, compiling from source, installing, configuring, and finally creating a systemd style script that will start a service at boot. Process: Download source from their website: http:\/\/www.ptokax.org\/files\/0.5.2.1-nix-src.tgz &hellip; <a href=\"https:\/\/blog.warbel.net\/index.php\/2017\/02\/20\/how-to-install-and-configure-a-direct-connect-hub-ptokax-on-ubuntu-16-04\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-177","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.warbel.net\/index.php\/wp-json\/wp\/v2\/posts\/177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.warbel.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.warbel.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.warbel.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.warbel.net\/index.php\/wp-json\/wp\/v2\/comments?post=177"}],"version-history":[{"count":12,"href":"https:\/\/blog.warbel.net\/index.php\/wp-json\/wp\/v2\/posts\/177\/revisions"}],"predecessor-version":[{"id":274,"href":"https:\/\/blog.warbel.net\/index.php\/wp-json\/wp\/v2\/posts\/177\/revisions\/274"}],"wp:attachment":[{"href":"https:\/\/blog.warbel.net\/index.php\/wp-json\/wp\/v2\/media?parent=177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.warbel.net\/index.php\/wp-json\/wp\/v2\/categories?post=177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.warbel.net\/index.php\/wp-json\/wp\/v2\/tags?post=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}