Categories
DevOps Docker Linux nginx portainer

NGINX Reverse Proxy for Docker Containers and for Portainer

Another day in Paradise. So on this beautiful day, I was wondering how I can set up a reverse proxy for Atoma’s test and release tool. Every module of the product runs on different ports and for our clients, it is really a pain in the ass to open up ports on their firewalls. Banking is really secure domain so I was thinking, how I can use a reverse proxy instead of browsing the different modules on nonstandard ports. I use NGINX as a reverse proxy. It is a fast and trusted open-source solution. Here is how I did it.

Categories
Linux Moodle

Moodle Analytics – Part 3. – Setting up TensorBoard in cPanel to view the Model Results

After evaluating a model you will get the following message in Moodle:

Launch TensorBoard from command line by typing: tensorboard --logdir='/path_to_your_moodledata/models/4/1566208427/evaluation/coreanalyticstime_splittingquarters/logs/1566583192278/tensor'

Installing moodlemlbackend is a prerequisite to view the model results. Read this quick guide on how to setup the prerequisites.

The moodlemlbackend package comes with an older version of TensorFlow package which contains a TensorBoard application where I had problems to view the result. Therefore a new Python virtual environment was installed for running Tensorboard only. With cPanel the Python environment can be set up quickly.

Here is a quick guide on how to launch TensorBoard in cPanel and view the results of the Moodle Analytics models evaluation.

Categories
Linux

How to Set Proxy in an Ubuntu Terminal?

Yes, because companies like to use proxy but I needed to access the Internet from my Ubuntu running on a VirtualBox.

Just a few steps and access can be established:

  1. Edit the /etc/environment file with your favorite editor
  2. Add the following lines
http_proxy="http://myproxy.server.com:8080/"
https_proxy="http://myproxy.server.com:8080/"
ftp_proxy="http://myproxy.server.com:8080/"
no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
HTTP_PROXY="http://myproxy.server.com:8080/"
HTTPS_PROXY="http://myproxy.server.com:8080/"
FTP_PROXY="http://myproxy.server.com:8080/"
NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"

Logout and login again.

Apt does not obey the environment variables so we need to set up the proxy setting:

  1. Edit the /etc/apt/apt.conf file with your favorite editor
  2. Add the following line:
Acquire::http::proxy "http://myproxy.server.com:8080/";

HTTP proxy is enough most of the times to download packages and updates.

That’s all.

Cheers.

Categories
Linux

Moodle BigBlueButton activity, String could not be parsed as XML, Error code: generalexceptionmessage, Firewall issue

I have recently used the BigBlueButton plugin without problem, but I had to move my Moodle to another virtual machine. And when I tried to add a new BigBlueButton activity I got a String could not be parsed as XML error.

First I checked the setting. Remember to have the Server URL with /bigbluebutton/ at the end like:

http://example.org/bigbluebutton/

If you do not have this setting you will always get this error.

But in my case the error still occured. Then I figured out that it could be a problem of my private LAN. My Servers are behind the firewall and I do not have a DNS inside the private LAN. So the packages tried to go through the firewall and the connection was broken. But the log said only this:

[Thu Feb 27 18:29:41 2014] [error] [client 192.168.1.2] Default exception handler: Exception - String could not be parsed as XML Debug: \nError code: generalexceptionmessage\n* line 282 of /mod/bigbluebuttonbn/locallib.php: Exception thrown\n* line 282 of /mod/bigbluebuttonbn/locallib.php: call to SimpleXMLElement->__construct()\n* line 258 of /mod/bigbluebuttonbn/locallib.php: call to bigbluebuttonbn_wrap_simplexml_load_file()\n* line 31 of /mod/bigbluebuttonbn/mod_form.php: call to bigbluebuttonbn_getServerVersion()\n* line 191 of /lib/formslib.php: call to mod_bigbluebuttonbn_mod_form->definition()\n* line 86 of /course/moodleform_mod.php: call to moodleform->moodleform()\n* line 256 of /course/modedit.php: call to moodleform_mod->moodleform_mod()\n, referer: http://example.org/course/view.php?id=9

So I edited the /etc/hosts files on both servers and put their names and local IPs into is.

Moodle  /etc/hosts file:

192.168.1.x    bigbluebutton.example.org

BigBlueButton  /etc/hosts file:

192.168.1.y    moodle.example.org

Then it worked again!

 

Categories
Debian Uncategorized

Install Debian Wheezy on Citrix XenServer 6.0.2

As Citrix XenServer 6.0.2 does not offer template for Debian Wheezy we have to install it in two steps.

First install Debian Squeeze as usual.

Second step is to upgrade Squeeze to Wheezy. Here are the sub-steps:

As it is a new install you do not have to update your system but for sure you can type the following commands:

apt-get update
apt-get upgrade
apt-get dist-upgrade

Also check that there are no packages are on hold or in any half installed state:

dpkg --audit 
dpkg --get-selections | grep hold

Now update /etc/apt/sources.list to the following:

# deb http://ftp.hu.debian.org/debian/ wheezy main

deb http://ftp.hu.debian.org/debian/ wheezy main
deb-src http://ftp.hu.debian.org/debian/ wheezy main

deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

# wheezy-updates, previously known as 'volatile'
deb http://ftp.hu.debian.org/debian/ wheezy-updates main
deb-src http://ftp.hu.debian.org/debian/ wheezy-updates main

After this type:

apt-get update

Then perform the upgrade. It is recommended to use a two stage upgrade approach.

apt-get upgrade
apt-get dist-upgrade

When it is ready reboot twice. After the first reboot I have found that all filesystems are read only due to an unknown error. After rebooting again everything was ok.

Enjoy your Debian Wheezy.

Links:

Debian: http://www.debian.org/
Debian Wheezy Release Notes: http://www.debian.org/releases/wheezy/amd64/release-notes/

Categories
Linux

CentOS – Starting Apache on a different port using semanage

# For some reason I had to start Apache on port 8082, but when I tried to start Apache as root I get:

Permission denied: make_sock: could not bind to address [::]:8082

CentOS use SElinux security, therefore there are pre-defined port that Apache can use. The ports are: 80, 443, 488, 8008, 8009, 8443. So if we want to use another port we should add it. In all sites I’ve found solutions to use the semanage command but when I enter it I got:

-bash: semanage: command not found

A standard installation does not contain semanage so install it by typing:

# yum -y install policycoreutils-python

After that we need to add port 8082.

# semanage port -a -t http_port_t -p tcp 8082

And now we can start Apache with

# /etc/init.d/httpd start