Categories
Uncategorized

Install RT 4 on Ubuntu 16.04

These steps are for setting up a new Request Tracker instance on Ubuntu 16.04, the data is being migrated from another server. Don’t drop the database if you are not migrating data.

First install LAMP, then follow these steps.

  • sudo apt-get install mysql-server libdbd-mysql-perl libapache-dbi-perl
  • sudo apt-get install rt4-apache2 rt4-db-mysql
  • sudo apt-get install request-tracker4 rt4-clients
  • sudo cp /etc/request-tracker4/RT_SiteConfig.pm /etc/request-tracker4/RT_SiteConfig.pm.original
  • sudo nano /etc/request-tracker3.8/RT_SiteConfig.pm
  • if you check /etc/mysql/my.cnf it points to two other files
    • !includedir /etc/mysql/conf.d/
    • !includedir /etc/mysql/mysql.conf.d/  <–Edit the content of this this file
    • sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
      • change max_allowed_packet = 16M to max_allowed_packet=256M
  • Drop existing db, mysql -u root -p
    • DROP DATABASE rtdb;
    • CREATE DATABASE rtdb
  • import rdtbbackup.sql into empty rtdb database
    • #mysql -u root -p rdtb < rtdbbackup.sql

Setup permissions for user rtuser

  • mysql -u root -p
    • find out the hashed password, SELECT PASSWORD(‘mypass’) copy  the hashed password and paste
    • GRANT USAGE ON *.* TO ‘rtuser’@’localhost’ IDENTIFIED BY PASSWORD ‘*longhashpassword’;
    • GRANT ALL PRIVILEGES ON `rtdb`.* TO ‘rtuser’@’localhost’;

Configure Apache:

  • sudo a2enmod rewrite
  • sudo ln -s /etc/request-tracker4/apache2-modperl2.conf /etc/apache2/sites-available/requesttracker.conf
  • a2ensite requesttracker.conf
  • service apache2 restart

Troubleshooting:

1.- Config file /etc/request-tracker/RT_SiteConfig.pm is locked

  • if you haven’t done so, restart mysql.  systemctl restart mysql
  • Also check apache logs, tail /var/log/apache2/error.log
  • Also check the RT_SiteConfig.pm file

2.- Not able to access db with rtuser

  • reset the rtuser password
    • UPDATE mysql.user
      SET authentication_string = PASSWORD(‘mynewpassword’), password_expired = ‘N’
      WHERE User = ‘rtuser’ AND Host = ‘localhost’;
      FLUSH PRIVILEGES;

3.- Able to create new tickets but unable to see any tickets

  • run:sudo /usr/sbin/rt-setup-database –dba root –prompt-for-dba-password –action upgrade
  • restart Apache, then restart mysql
Categories
Uncategorized

LAMP on Ubuntu 16.04 LTS

Install Apache:

  • sudo apt-get update
  • sudo apt-get install apache2
  • sudo nano /etc/apache2/apache2.conf
    • At end of file, add:  ServerName IPAddress
  • sudo apache2ctl configtest
  • sudo systemctl restart apache2

Install Mysql:

  • sudo apt-get install mysql-server mysql-client
  • sudo systemctl status mysql

Install PHP:

  • sudo apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7 php7.0-gd php libapache2-mod-php php-mcrypt php-mysql
  • sudo nano /etc/apache2/mods-enabled/dir.conf and move index.php at the befinning of the text, i.e DirectoryIndex index.php index.html …
  • sudo systemctl restart apache2

Install phpMyAdmin

  • sudo apt-get install phpmyadmin
  • edit, sudo nano /etc/apache2/apache2.conf
    • at the end of the file, add: Include /etc/phpmyadmin/apache.conf
  • sudo systemctl restart apache2

 

 

 

 

Categories
Uncategorized

Grunt, Sass and Nodejs on Linux

Install Nodejs v6. This will install npm, which will allow to install grunt-cli globally (-g)
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash –
sudo apt-get install -y build-essential
sudo npm install -g grunt-cli

Install Sass. First install Ruby. This will install gem
sudo apt-get install rubygems build-essential
sudo gem install sass

Install Sas-contrib locally on project, i.e /apps/wp
:/apps/wp/npm install grunt-contrib-sas –save-dev

If you get a warning:  grunt-contrib-sass requires a peer of grunt
run, npm install grunt –save-dev

To start grunt: go to project folder
grunt

To stop grunt, go back to project folder
Ctrl + c

Categories
Uncategorized

docker

List images:
docker images

check running containers
docker ps 

check last running container
docker ps -l

change from table to vertical display, first copy/paste the following in the command line
export FORMAT=”ID\t{{.ID}}\nNAME\t{{.Names}}\nIMAGE\t{{.Image}}\nCOMMAND\t{{.Command}}\nCREATED\t{{.CreatedAt}}\nSTATUS\t{{.Status}}\nPORTS\t{{.Ports}}\n”

 Now you can use
docker ps -l –format=”$FORMAT”

Docker commit command: make images out of a container,
First, run a container, docker run -ti ubuntu bash
exit
check latest container, docker ps -l –format=”$FORMAT”
ID 597ff54633b9
NAME agitated_elion
IMAGE ubuntu
COMMAND “bash”
CREATED 2017-06-08 09:48:29 -0400 EDT
STATUS Exited (0) 2 minutes ago
PORTS

docker commit nameofImage neimagename
docker commit agigated_elion copyofUbuntu

run container and delete it when it exits
docker run –rm –ti ubuntu sleep 10

Run a few more things
docker run -rm –ti ubuntu bash -c “sleep 5; echo  returning done sleeping” 

Leaving a running container i.e detached
docker run -d -ti ubuntu bash
docker ps -l –format=”$FORMAT”
ID 4b2feb75ca6b
NAME thirsty_liskov
IMAGE ubuntu
COMMAND “bash”
CREATED 2017-06-08 09:59:39 -0400 EDT
STATUS Up 8 seconds
PORTS

Attach running container,
docker attach thirsty_liskov
If you want to exit and keep it running
Press Ctrl + P and Ctrl+q, this detaches it but leaves it running

execute a new process in a running container,
docker exec thirsty_liskov bash

Kill and remove containers
docker  kill containerName
docker rm containerName

NETWORKING