How do I install botqueue on custom webserver?

304 views
Skip to first unread message

Hyon Lim

unread,
Jan 19, 2014, 9:59:54 PM1/19/14
to botq...@googlegroups.com
Hi.
I have installed botqueue on my amazon webserver about an year ago.
Since that time, I didn't have much time to work on this project, so I'm bit far away from the project now.
I believe that this project is becoming much more advanced, and stable.

I would like to start working on this project again, but before doing so, I'd like to know that has anyone documented (or note) 
installation of botqueue on another webserver?

-Hyon

Justin Nesselrotte

unread,
Jan 20, 2014, 2:10:00 PM1/20/14
to botq...@googlegroups.com
Sure. I'm working on a blog post about it, but the current suggested method was posted here: https://groups.google.com/d/msg/botqueue/NUZJCL7IiL0/wsJy5KsN9PEJ

Note, that that involves installing my 0.5X-dev branch. Also, if you do install my version (which has quite a few bug fixes), make sure to check out this post about upgrading it if you pull and there's changes.

Wouter

unread,
Oct 20, 2014, 9:33:57 AM10/20/14
to botq...@googlegroups.com, graph...@gmail.com
Probably it is me, but I'm unable to load/view my local botqueue website.

First time install of current master branch on a brandnew Ubuntu 14.04 VM. All steps from the first_install script are completed (including the LocalFile options), but I do not see a botqueue homepage. I'm a bit in the dark here, can someone point me in the right direction? Which file should automatically be opened in my browser when I go to botqueue.local.lan? 

Justin Nesselrotte

unread,
Oct 20, 2014, 10:21:21 AM10/20/14
to botq...@googlegroups.com
The first_install script isn't currently set up to with with apache 2.4. There are two main differences. The first is that the site configuration should end with a .conf extension. Also, if you're getting a 403, you might need to edit apache.conf to change a line from "Require all denied" to "Require all granted". I wish I could tell you the line that was on but I currently can't.

I haven't confirmed this, but I think you have to install oauth using pecl now. "pecl install oauth"

What does the apache log say? What error are you getting? Blank page? Is the default apache site the one that loads?

Wouter

unread,
Oct 20, 2014, 10:38:06 AM10/20/14
to botq...@googlegroups.com

I’ve discovered the missing .conf extension and manually changed this, thanks for that.

Apache serves the index of the botqueue\web directory instead of a nice frontpage. When I browse to the ip address of the server I get the apache default page, but when I go to
http://botqueue I see the file listing of /var/www/Botqueue/web/. I do not see any errors in the apache error or combined access logs.

Thanks,


Wouter
> --
> You received this message because you are subscribed to a topic in the Google Groups "BotQueue" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/botqueue/Zy5KzvROsU0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to botqueue+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Justin Nesselrotte

unread,
Oct 20, 2014, 11:20:07 AM10/20/14
to botq...@googlegroups.com

Yeah, BotQueue is linked to the hostname for security issues. So if the config.php file has the hostname as something besides what you connected it as, it will redirect.

Hmm. The apache config doesn't have a line that it should. There should be an AllowOverride line in apache.conf. Change it to "AllowOverride All".

The default file is technically .htaccess which redirects to the needed file.

Wouter

unread,
Oct 20, 2014, 11:56:10 AM10/20/14
to botq...@googlegroups.com
Getting a bit further after adding AllowOverride to apache.conf. 

When go to the website I now get:
. */ define("START_TIME", microtime(true)); try { include("../extensions/global.php"); include(EXTENSIONS_DIR . "session.php"); //are we in the right place? if ($_SERVER['HTTP_HOST'] != SITE_HOSTNAME) header("Location: http://" . SITE_HOSTNAME . $_SERVER['REQUEST_URI']); // If page requires SSL, and we're not in SSL mode, // redirect to the SSL version of the page if (FORCE_SSL && $_SERVER['SERVER_PORT'] != 443) { header("HTTP/1.1 301 Moved Permanently"); header("Location: https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); exit(); } //get our stuff. $mode = $_GET['mode']; $controller = $_GET['controller']; $view = $_GET['view']; //figure out what mode we're looking at. if (!$mode) { // //do we have a cookie based mode? // if ($_COOKIE['viewmode']) // { // switch ($_COOKIE['viewmode']) // { // case 'iphone': // $mode = 'iphone'; // break; // // case 'html': // default: // $mode = 'html'; // break; // } // } // else // { // //figure out if we're iphone or not. // if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') !== false) // $mode = 'iphone'; // else // $mode = 'html'; // // //save it for later! // setcookie('viewmode', $mode, time()+60*60*24*30, '/'); // } $mode = 'html'; } //what controller to show? //If the user hasn't supplied a controller (e.g. item), then use either the iphone or main controllers (which display the home page) if (!$controller) { // if ($mode == 'iphone') // $controller = 'iphone'; // else $controller = 'main'; } if (!$view) $view = 'home'; //load the content. //Create a new object of a subclass of the controller class //$main is an object derived from the Controller class, e.g. iphoneController, mainController, itemController, etc. $main = Controller::byName($controller); //call the renderView function (within the Controller class), passing it only the name of the view (e.g. newest) //The renderView function does the following: // - Sets the the property, $main->data['items'], equal to an array containing one page worth of object (e.g item) data read in from MySQL // - Includes the appropriate view file {controller}.{view}.php file, e.g. item.newest.php // - Returns the output of the Controller->renderview (note: this is not displayed to the screen, rather it's stored in the $content variable) $content = $main->renderView($view); //now draw it in our template. //Does the following: // - Create a new instance of a controller, e.g. htmltemplatecontroller.php (see controllers/htmltemplate.php) // - Call the renderView function on that new controller object, telling it to render the 'main' view with the arguments: content, title and sidebar // - Echo all of that to the screen //Note that $mode often is not defined echo Controller::byName("{$mode}Template")->renderView('main', array( 'content' => $content, 'title' => $main->get('title'), 'area' => $main->get('area'), 'sidebar' => $main->get('sidebar') )); } catch (Exception $ex) { echo "Something bad happened: " . $ex->getMessage(); }

Justin Nesselrotte

unread,
Oct 20, 2014, 12:10:26 PM10/20/14
to botq...@googlegroups.com
Under /etc/php5/ there are four php.ini files: apache2/php.ini  cgi/php.ini  cli/php.ini  fpm/php.ini

There is a line that says: short_open_tag = Off

Change it to: short_open_tag = On

you only need to change apache2/php.ini and cli/php.ini, but I'd change them all just to be more on the safe side. Apache 2.4 made that by default not to work but we still use it a lot.

Wouter

unread,
Oct 20, 2014, 3:31:47 PM10/20/14
to botq...@googlegroups.com
That solved my botqueue server issues. 

Used phpmyadmin to make myself an admin in the user table.


Currently I’m having troubles connecting bumblebee 0.5 to my private botqueue server. Using the default config files bumblebee registers itself on the botqueue website but I’ve been unable to register it to my own one.

I’ve been manually using all steps as indicated in raspi/install.sh and modified config.json before I started bumblebee with "sudo python -m bumblebee”.
Noticed a couple of things:
- When I connect to my local server using https, the info.log shows:
[2014-10-20 21:24:51,195] ERROR: requesttoken call failed: internet connection is down: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

This makes some sense, since I’m using a self signed certificate. I've tried overrule this by adding this certificate to ca-certificates on the RPi but without succes. Am I missing something?

- Switching to http instead of https results in:
There was a problem authorizing the app: Error getting token: Invalid consumer key
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/pi/Bumblebee/bumblebee/__main__.py", line 3, in <module>
    main()
  File "bumblebee/app.py", line 374, in main
    bee = BumbleBee()
  File "bumblebee/app.py", line 63, in __init__
    self.api = botqueueapi.BotQueueAPI()
  File "bumblebee/botqueueapi.py", line 49, in __init__
    self.authorize()
  File "bumblebee/botqueueapi.py", line 228, in authorize
    raise RuntimeError("There was a problem authorizing the app: %s" % (ex))

Many thanks

Justin Nesselrotte

unread,
Oct 20, 2014, 4:13:01 PM10/20/14
to botq...@googlegroups.com

There is no default app on servers. You have to go to the apps page and create one. Then run "python config-setup.py", provide it your url (with https), and the key and secret that the app page shows you.

--

Wouter

unread,
Oct 21, 2014, 4:16:46 AM10/21/14
to botq...@googlegroups.com
Note to myself (and probably others):
When running "python config-setup.py", remove the last fwd slash of the url.
server should be http://botqueue.local.lan instead of http://botqueue.local.lan/ as shown in the table after you have manually created an app.

Currently running my first print through botqueue :)

Justin Nesselrotte

unread,
Oct 21, 2014, 11:11:49 AM10/21/14
to botq...@googlegroups.com

Hmm, interesting. I could have sworn I fixed that. I hope the print turned out well.

I'm curious about your decision to use a private server. I'm trying to find more and more about my target users to see how I can help them improve.

Congratulations on getting the server set up!

--

Wouter

unread,
Oct 21, 2014, 1:20:21 PM10/21/14
to botq...@googlegroups.com
Out of the 6 jobs that have been running today 1 was stalled mid print, all others were finished fine. See how it goes, probably I did something wrong as it first print through  botqueue. 

I prefer to have my own server running so I do not have rely on my internet connection and other dependencies that are out of my control. The required internal infrastructure (webserver, dns, etc) is already there as I happen to have one Vmware esxi server running with several virtual machines. A new virtual machine dedicated for botqueue wasn't the hard part of getting it up and running.  :)
Besides this, I also do not have to worry about possible security issues. 

At the moment I'm using BQ for 1 printer as the other ones (2) are not able to start their print completely automatic. I need to redesign the hot end cooling solution to make this possible. 

nguyen van huong

unread,
Jan 13, 2016, 11:21:59 AM1/13/16
to BotQueue
hi guy, you can documented (or note) installation of botqueue on local apache webserver?

Vào 09:59:54 UTC+7 Thứ Hai, ngày 20 tháng 1 năm 2014, Hyon Lim đã viết:

Justin Nesselrotte

unread,
Jan 13, 2016, 11:48:32 AM1/13/16
to BotQueue
I can walk you through it, but I'm not going to document the current version because I'm working on completely changing the server and client, so it feels like somewhat a waste of time. I'll see about doing it later this week though (I have to reinstall the current version on a server later this week or next week, so might as well try to document it)

In the interim, you can either look at (or if you're brave, run) this file: https://github.com/Hoektronics/BotQueue/blob/master/install/first_boot.sh

It's the installer I tried making a while ago. It sometimes works and sometimes doesn't. It was made for apache 2.2, so to get it work on 2.4 or above, you'll have to change the configuration file in /etc/apache2/sites-available and add ".conf" to the end. So "BotQueue" would become "BotQueue.conf"

nguyen van huong

unread,
Jan 13, 2016, 1:13:26 PM1/13/16
to BotQueue
Thank you for the answers I will try to run it, and hopefully this weekend or next time I'll get guide on that new version.


Vào 09:59:54 UTC+7 Thứ Hai, ngày 20 tháng 1 năm 2014, Hyon Lim đã viết:
Hi.

Justin Nesselrotte

unread,
Jan 13, 2016, 1:14:57 PM1/13/16
to BotQueue
The new version of the server is taking quite a while to be written, so the guide will be for the current version.

nguyen van huong

unread,
Jan 13, 2016, 3:23:46 PM1/13/16
to BotQueue


I've run firstboot.sh file. then I get results like this.
Vào 09:59:54 UTC+7 Thứ Hai, ngày 20 tháng 1 năm 2014, Hyon Lim đã viết:
Hi.

Justin Nesselrotte

unread,
Jan 13, 2016, 3:30:06 PM1/13/16
to BotQueue
That's not really a BotQueue issue. I would suggest getting apache set up with a fully qualified domain so it's not just assuming it should be 127.0.0.1. After that, I would change either BotQueue's (or personal preference, get rid of phpmyadmin since it's constantly an attempted attack vector against my servers) server name or phpmyadmin's.

Also, I meant to ask earlier, is there a reason that you're creating your own server and not using BotQueue.com?

nguyen van huong

unread,
Jan 13, 2016, 3:44:57 PM1/13/16
to BotQueue

I want to have something of their own, in addition I want to ask how my bot to connect to that server

Vào 03:30:06 UTC+7 Thứ Năm, ngày 14 tháng 1 năm 2016, Justin Nesselrotte đã viết:

Justin Nesselrotte

unread,
Jan 14, 2016, 1:17:18 AM1/14/16
to botq...@googlegroups.com
Do you mean connecting a bot to the existing server instead of setting up a new server? I'm sorry, I didn't quite understand your question.

--
You received this message because you are subscribed to the Google Groups "BotQueue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to botqueue+u...@googlegroups.com.
Message has been deleted
Message has been deleted

Justin Nesselrotte

unread,
Jan 17, 2016, 12:21:06 PM1/17/16
to BotQueue
Hey, don't worry about deleting posts, I promise your questions aren't stupid. As it stands, the instructions are pretty confusing and don't work well.

If you have a custom server, and you have bqclient installed (in a virtualenv if you want it to auto update correctly), then you can run this command to have it switch servers:
bumblebee config --server="<server>"

You'll have to replace <server> with whatever your BotQueue server is. The main one is https://botqueue.com/ for example. If you want to connect to the main server, it's already set up to do that.

On the server side, you'll have to register an app. Click on the app button on the top of the menu bar, then "register one" under the Developers section. Enter a name for it (I think the URL has to be there, but I usually use https://github.com/Hoektronics/bumblebee since it's the main client's GitHub repo) and you'll be presented with a screen with the OAuth information the client is asking you to enter when you ran the above command.

I'm sorry it's really complicated right now. I'm trying to improve it for the new version so that you'd only have to put a custom image on the PI instead of installing things manually.

nguyen van huong

unread,
Jan 17, 2016, 1:25:51 PM1/17/16
to BotQueue
thanks for your help but I get an error when configuring server BotQueue "Server error 500". Please tell me what should I do expect a new version or how to fix it how

Vào 00:21:06 UTC+7 Thứ Hai, ngày 18 tháng 1 năm 2016, Justin Nesselrotte đã viết:

Justin Nesselrotte

unread,
Jan 17, 2016, 1:27:12 PM1/17/16
to botq...@googlegroups.com

The next version will be a while. I think you added my on g+, can you discuss it on Google hangouts?

--

nguyen van huong

unread,
Jan 20, 2016, 12:01:08 AM1/20/16
to BotQueue

what are  "Consumer Key: Consumer Secret:" ?

I can not connect to http://localhost.com, please show me how to do?
Vào 01:27:12 UTC+7 Thứ Hai, ngày 18 tháng 1 năm 2016, Justin Nesselrotte đã viết:
Reply all
Reply to author
Forward
0 new messages