Tag Archives: CentOS

configure apache

Apache Active Directory Authentication

Overview

This tutorial provides an example of Apache Active Directory Authentication using the Authz LDAP module.
Apache and SSL settings are not in the scope of this tutorial.
Continue reading

Apache Kafka logo

Kafka CentOS Installation Instructions

Kafka CentOS Installation Instructions

If you’re here, you’re probably knows what `Kafka` is and what it should be used for.

If not, visit Apache Kafka page to learn more

Prerequisities

  • wget (yum install wget)
  • tar (yum install tar)

Installation

First thing, lets go over to Kafka Download page to download kafka into our machine:

# choose a directory to download kafka into. it could be really anywhere:
# /home, /var, /usr, /opt or even /tmp if you just wanna play with it.
cd /opt
wget http://apache.mivzakim.net/kafka/0.8.2.0/kafka_2.10-0.8.2.0.tgz
tar -zxvf kafka_2.10-0.8.2.0.tgz
rm kafka_2.10-0.8.2.0.tgz -y
cd kafka_2.10-0.8.2.0

Well.. and that’s preety it. you have Kafka CentOS installation on your machine. Now, lets play with it a little:

Start quick-and-dirty server

from Kafka QuickStart:

Kafka uses ZooKeeper so you need to first start a ZooKeeper server if you don’t already have one. You can use the convenience script packaged with kafka to get a quick-and-dirty single-node ZooKeeper instance.

so just run now at your console:

bin/zookeeper-server-start.sh config/zookeeper.properties

after, you’ll see the BEAUTIFUL output telling you everything is fine and zookeeper is running on 0.0.0.0:2181:

Kafka CentOS

Kafka CentOS

Now, we’re gonna be more dirtier and just for now, we’ll move the zookeeper server into background so we could start the kafka server. This can be done by pressing: CTRL+Z which outputs:

[1]+ Stopped bin/zookeeper-server-start.sh config/zookeeper.properties

Then run the command:

bg
> [1]+ bin/zookeeper-server-start.sh config/zookeeper.properties &

# you can check that zookeeper is running at background by use the jobs command:
jobs
> [1]+ Running bin/zookeeper-server-start.sh config/zookeeper.properties &

Now start the Kafka server:

bin/kafka-server-start.sh config/server.properties

And look as the PRETTY lines are printing and loading your Kafka server instance.

Kafka_loaded

 

FATAL Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)

If you get this error, you need to add your hostname to /etc/hosts: 127.0.0.1 localhost myhostname

 

What’s now?

That’s it, you have Kafka CentOS installation! Go from STEP 3 in the quickstart to learn the basics of Kafka..

 

Good Luck!

Development Specialist, Artist and Activist
Personal Website
VMWare Workstation start on boot CentOS

EPEL CentOS 7 – Add Fedora EPEL repository

EPEL CentOS 7

EPEL CentOS 7 – In the next tutorial I will show you how to add the fedora EPEL repository to your CentOS 7 installation

.

Applicable to

  • Centos 7.x, but also to CentOS 6.x (and probably earlier)

 

Requirements

In order to install CentOS EPEL Repository you need:

  • root access
  • wget:
yum install wget -y

 

Installation

check here for latest version of epel-release-x-x.noarch.rpm

wget http://mirror.nonstop.co.il/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -Uvh epel-release-7-5.noarch.rpm
rm epel-release-7-5.noarch.rpm -f

or in short:

rpm -Uvh http://mirror.nonstop.co.il/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

Verify

use:

yum repolist

to check that the repo installed correctly.

centos-epel-repolist

That’s it! You’ve added CentOS EPEL repository to your centos installation.

 

How to use?

yum --enablerepo=epel install [package]

for example:

yum --enablerepo=epel install zabbix

Note: The epel configuration file is located under /etc/yum.repos.d/epel.repo.

 

That’s it

Development Specialist, Artist and Activist
Personal Website
VMWare Workstation start on boot CentOS

CentOS Automatic Updates

CentOS Automatic Updates

CentOS Automatic Updates tutorial.

This tutorial apply to Centos 5.x, 6.x and 7.x.

 

CentOS 5.x

The yum package supplied with CentOS 5.0 includes scripts to perform full system updates every day. To activate automatic daily updates, enter this command:

su -c '/sbin/chkconfig --level 345 yum on; /sbin/service yum start'

At the prompt, enter the password for the root account.

There is no separate yum service that runs on your system. The command given above enables the control script /etc/rc.d/init.d/yum. This control script activates the script /etc/cron.daily/yum.cron, which causes the cron service to perform the system update automatically at 4am each day.

CentOS 6.x

To get started, install yum-cron:

yum -y install yum-cron

By default, it’s configured to download all of the available updates and apply them immediately after downloading. Reports will be emailed to the root user on the system. To change these settings, just open /etc/sysconfig/yum-cron in your favorite text editor and adjust wherever setting you need to change:

The important settings to mention are:

# Don't install, just check (valid: yes|no)
CHECK_ONLY=no

# Don't install, just check and download (valid: yes|no)
# Implies CHECK_ONLY=yes (gotta check first to see what to download)
DOWNLOAD_ONLY=no

# if MAILTO is set and the mail command is available, the mail command is used to deliver yum output
# by default MAILTO is unset, so crond mails the output by itself
# example: MAILTO=root
MAILTO=

# you may set DAYS_OF_WEEK to the days of the week you want to run
# default is every day
#DAYS_OF_WEEK="0123456"

If you want to exclude some packages only from the automatic update you can edit the file /etc/sysconfig/yum-cron and set the option YUM_PARAMETER with -x packagename, you have to repeat the -x for every package that you want to exclude, such as:

YUM_PARAMETER="-x kernel* -x php*"

The cron jobs from the yum-cron package are active immediately after installing the package and there’s no extra configuration necessary. The job will be run when your normal daily cron jobs are set to run.

chkconig yum-cron on
service yum-cron start

CentOS 7.x

Although CentOS 6.x Instructions will work for CentOS 7.0, you could upgrade the installation process to be completely CentOS 7.0 compatible:

yum install yum-cron
systemctl enable yum-cron.service
systemctl start yum-cron.service

.conf file (Configuration) located at: /etc/yum/yum-cron.conf AND /etc/yum/yum-cron-hourly.conf.

Note that in contrast to CentOS 6.x, by default yum-cron only download updates once a day and doesn’t apply them. change to:

apply_updates = yes

In /etc/yum/yum-cron.conf if you wish to. make note that you can now define hourly updates in the /etc/yum/yum-cron-hourly.conf file.

That’s it.

Development Specialist, Artist and Activist
Personal Website
VMWare Workstation start on boot CentOS

CentOS 7 VirtualBox Guest Additions Installation

CentOS 7 VirtualBox Guest Additions Installation Tutorial

In the following tutorial, I’ll demonstrate how to install Guest Additions on your VirtualBox hosted CentOS 7 Minimal machine.

Although this tutorial is intended for CentOS 7 minimal, it’s will probably also work on other CentOS releases.

Update your VirtualBox

VirtualBox 4.3.12 or later is required for support in CentOS 7.x, So if you’re using older version of VirtualBox – it’s time for you to upgrade.

Update and Reboot system

After successful installation of your new and shining CentOS box, CentOS-7-installation-VirtualBox

Important Before anything!, I’d advice you to update your CentOS & reboot:

yum update
reboot

After, also try to update your kernel and reboot:

yum update kernel
reboot

You will need to be the root user for the following routine or “su -”

Prerequisities

In order to compile the guest additions you have to install make, gcc, kernel-devel in order to Install VirtualBox Guest Additions installation script.

yum install gcc make kernel-devel

OR, I’ll recommend installing the entire “Developer tools” group which will help you to avoid a lot of trouble later:

yum groupinstall "Development tools"
yum install kernel-devel

Install VirtualBox Guest Additions

Mount your guest additions:

VirtuallBox-MountGuestAdditions

Type at command::

cd /mnt
mkdir cdrom && mount /dev/cdrom /mnt/cdrom
cd cdrom && ./VBoxLinuxAdditions.run

centos-7-guest-additions

If everything “OK” – You have Guest Additions properly installed on your Centos (Minimal) machine. now Reboot:

reboot

 

That’s it!

 

Development Specialist, Artist and Activist
Personal Website
grails-logo

CentOS Grails installation tutorial for newbs – CentOS 6.x

centos grails

centos grails installation tutorial for newbs. for CentOS 6.x (And probably for older/later)

 

Prerequisities

You have to install Groovy (which require JDK). If you don’t have Groovy (And JDK) installed follow those instructions.

  • Java SDK 1.4+ for Grails 1.0.x and 1.1.x
  • Java SDK 1.5+ for Grails 1.2 or greater (For this tutorial make sure you have JDK 1.5+ installed)

 

Install Grails

Option 1: Using GVM (Recommended)

If you’ve installed groovy using GVM, you can use the GVM to install grails too. use:

gvm install grails
centos grails

centos grails

Option 2: Manual Installation

We’d go by the official Grails manual:

The folder we’ll install Grails is: /usr/grails, but you can choose any other as you like.

Init Folder

cd /usr
mkdir grails
cd grails

Here we’ll put the grails files by version.

Visit the download page to get the latest version. as for now it’s 2.3.7

wget http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-2.3.7.zip
unzip grails-2.3.7.zip
rm grails-2.3.7.zip

Install wget & unzip if you don’t yet have them install by: yum install wget unzip

add the following to your ~/.bash_profile or ~/.bash_rc (or wherever you init your user environment):

# grails
export GRAILS_HOME=/usr/grails/grails-2.3.7
export PATH=$PATH:$GRAILS_HOME/bin

That’s it

Option 3: Using GIT

If you want to be updated with latest patches (and bugs) you can clone the git repo.

Prerequisities: you should have JDK installed, your JAVA_HOME set and GIT installed (yum install git).

For the 2.0.x and the ‘master’ branch:

cd /usr
git clone https://github.com/grails/grails-core
cd grails-core && ./gradlew install

and set your GRAILS_HOME in the ~/.bash_profile (or ~.bash_rc):

# grails
export GRAILS_HOME=/usr/grails-core
export PATH=$PATH:$GRAILS_HOME/bin

If you want to install older branch read here.

 

Testing grails

Type at command:

grails --version

You should get something like this output (depend on version)

grails-version

 

That’s It! you have centos grails installed.

Cheers!

Development Specialist, Artist and Activist
Personal Website
groovy-logo

CentOS Groovy installation tutorial for newbs – CentOS 6.x

CentOS Groovy

CentOS Groovy installation instruction for newbs.

 

Prerequisities

JDK

To install Groovy you have to install the JDK. If you don’t have JDK installed yet follow those instructions by RaveMaker.

 

Groovy Installation

There are several mothods (as always) to install groovy into your CentOS box.

 

Option 1: GVM

The simplest is using the GVM, tool for managing parallel Versions of multiple Software Development Kits on most Unix based systems. It provides a convenient command line interface for installing, switching, removing and listing Candidates.

GVM is a powerful tool to install Candidates and switch between them (on current terminal, or by default). reading the full intro to GVM is recommended.

to install GVM use the command:

curl -s get.gvmtool.net | bash

This will quickly install GVM into your system

gvm-install

Run the following command as required or log again to the system, as GVM is adding this line to your ~/.bash_profile file:

source "/root/.gvm/bin/gvm-init.sh"

which should return nothing. now you are ready to install groovy by:

gvm install groovy
centos groovy install

centos groovy install

Notes:

  • This will installed groovy version 2.2.2. you can use GVM to install specific groovy version, or multiple versions (read the manual).
  • GVM will create the ~/.gvm directory with all the assets inside (~/.gvm/groovy/2.2.2).

that’s it.

 

Option 2: Manual Installation

It’s always recommended to manually install every peace of code to fully understand what going on there. Following the official installation guide,

Download binary

Download binary for groovy from the download page (check if there is newer version, or specific version you need other then 2.3.0-beta-2 shown here):

cd /usr
mkdir groovy
cd groovy
wget http://dl.bintray.com/groovy/maven/groovy-binary-2.3.0-beta-2.zip
unzip groovy-binary-2.3.0-beta-2.zip
rm groovy-binary-2.3.0-beta-2.zip

This will create a /usr/groovy/groovy-2.3.0-beta-2 folder with the files packed inside.

* If you don’t have wget installed use then ‘yum install wget’ command to install it.
* If you don’t have unzip installed use then ‘yum install unzip’ command to install it. 

TIP

Create a symlink to that folder named ‘latest’ which you can change later when you’ll update your groovy installation without the need to update the environment variables.

ln -s groovy-2.3.0-beta-2 ./latest

Set-up environment

Last thing you need is to:

  • set your GROOVY_HOME environment variable to the directory you unpacked the distribution
  • add GROOVY_HOME/bin to your PATH environment variable

Edit your ~/.bash_profile file and append the following lines:

# Groovy
export GROOVY_HOME=/usr/groovy/latest
export PATH=$PATH:$GROOVY_HOME/bin

or, if you didn’t created the latest symlink, use:

# Groovy
export GROOVY_HOME=/usr/groovy/groovy-2.3.0-beta-2
export PATH=$PATH:$GROOVY_HOME/bin

 

Test Groovy

groovy -e ‘println(“Hello, World!”)’

centos groovy

centos groovy

 

And that’s it! You have Groovy Installed.

Cheers!,

 

grails-logo    Do you need Grails framework for Groove? Read my walkthrough tutorial.

 

Development Specialist, Artist and Activist
Personal Website
Golang

CentOS golang Installation Instructions – for CentOS 6.x

CentOS golang

CentOS golang Installation Instructions – for CentOS 6.x.
In the following tutorial I’ll show how to install and run “Hello, world!” script with golang on CentOS 6.x

 

CentOS golang Installation Instructions – for CentOS 6.x

Install EPEL

If you haven’t install EPEL repository yet, you’ll need it now. follow those instructions.
If you want newer versions of golang you might want to try the hop5.in repository but I haven’t tried.

 

Install golang

Simple as:

yum install golang

you may want to install hg also, you’ll probably will need it later for the ‘go get’ command:

yum install hg

 

Hello, World!

create a file named ‘hello.go’ and fill it with:

package main
import "fmt"
func main() {
     fmt.Println("Hello, World!")
}

run the script using:

go run hello.go
centos-golang

centos-golang

You can first build to a binary executible with:

<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;width:555px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="text codecolorer">go build hello.go</div></td></tr></tbody></table></div>

and then run with:

<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;width:555px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="text codecolorer">./hello</div></td></tr></tbody></table></div>

 

$GOPATH

The ‘Hello, World!’ is a very basic example, but in real-world you may need to install packages and libraries for more complex applications.

The $GOPATH environment variable specifies the location of your workspace. It is likely the only environment variable you’ll need to set when developing Go code.

If your project for example is located at $HOME/go, you should create a variable like:

export GOPATH=$HOME/go

For convenience, add the workspace’s bin subdirectory to your path:

export PATH=$PATH:$GOPATH/bin

Now, your project environment variables are set and you can download packages with the simple command: (for example – the Google OAuth 2.0 library)

go get code.google.com/p/goauth2/oauth

 

What’s next

Web Applications using Go

  • Writing Web Applications tutorial.
  • Bones – A project template for Go webapps.
  • Gorilla web toolkit.
  • Revel – A high-productivity web framework for the Go language. Deploy Revel.
  • Martini – Classy web framework for Go.
  • sawsij – lightweight, open-source web framework for building high-performance, data-driven web applications.

Template Engines for Go

Web Applications in Production

 

 

That’s it!, Cheers!

Development Specialist, Artist and Activist
Personal Website
clojure-logo

CentOS Clojure / Leiningen / Luminus / http-kit Installation and sample tutorial

CentOS Clojure

CentOS Clojure installation and sample tutorial.
In the following post I’ll show how to install and configure Clojure on you CentOS box with sample web server example.

Also,, weI’ll use leiningen for manage the Clojure app and http-kit for deployment.

 

CentOS Clojure Installation

First, Clojure requires only Java 1.5 or greater, if you don’t have the JDK installed yet on your CentOS box please follow this instructions by ItekBlog writer – Adam to install Oracle Java on your CentOS box.

Download Clojure

Before you continue, check the Downloads page to install the latest version.

To download Clojure use:

# if you don't have wget installed - use: yum install wget
# if you don't have unzip installed - use: yum install unzip
cd /opt
wget http://repo1.maven.org/maven2/org/clojure/clojure/1.5.1/clojure-1.5.1.zip
unzip clojure-1.5.1.zip
rm clojure-1.5.1.zip

to bring up a simple read-eval-print loop (REPL) use:

cd clojure-1.5.1
java -cp clojure-1.5.1.jar clojure.main

try:

user=> (+ 1 2 3)
6
user=> (javax.swing.JOptionPane/showMessageDialog nil "Hello World")

Try Clojure Online

  • TryClojure provides a brower-based Clojure REPL
  • Himera provides a browser-baed ClojureScript REPL

Community Resources

Community volunteers maintain Getting Started documentation for a number of different tools and approaches.

 

Leiningen

Leiningen is the easiest way to use Clojure. With a focus on project automation and declarative configuration, it gets out of your way and lets you focus on your code.

Installing Lieningen

to install Lieningen you need to download the lein script place it on your $PATH (eg. ~/bin) and set it to be executable:

cd ~/bin
wget https://raw.github.com/technomancy/leiningen/stable/bin/lein
chmod a+x ~/bin/lein

you can read the tutorial by running lein help tutorial.

The tutorial is the best place to start. It does not cover learning the language itself; good Clojure documentation can be found.

Running lein help faq will get you the FAQ. Documentation for each individual task is available via lein help $TASK. You can also see the sample project.clj file containing a reference of most project settings by running lein help sample.

 

Creating a Project

Creating a new project is easy:

cd ~/
lein new app my_first_app
cd my_first_app
find .

In this example we’re using the 

1
app

 template, which is intended for an application project rather than a library. Omitting the app argument will use the default template, which is suitable for libraries.

Directory Layout

The output of the find command is:

leiningen_find

Here you’ve got your project’s README.md file, .gitignore file for you all GIT users, a src/ directory containing the code, a test/ directory, and a project.clj file which describes your project to Leiningen. The src/my_stuff/core.clj file corresponds to the my-stuff.core namespace.

Running Code

let’s start our code running:

lein run

 

centos clojure

centos clojure

 

For extended information and documentation about Leiningen and the REPL Read here.

 

FAQ: Set LEIN_ROOT to disable this warning.

leiningen_error

 

If you want to run LEIN using root, you should add to your ~/.bash_profile :

export LEIN_ROOT="Something"

rem

ember to touch the file:

. ~/.bash_profile

 

Frameworks

Luminus

Luminus is a micro-framework based on a set of lightweight libraries. It aims to provide a robust, scalable, and easy to use platform. With Luminus you can focus on developing your app the way you want without any distractions.

create a new project:

    lein new luminus myapp
    cd myapp
    lein ring server

the app is now available at 

1
localhost:3000

luminus-welcome

 

Clojure Deployment

When you’re ready to deploy your app, you have many web servers such as: nginx, http-kitimmutant, tomcat, JBossPallet, GlassFish, Jetty, Netty, Grizzly, etc.

 

using nginx

You can use nginx-clojure to run your clojure project inside of nginx server.

In Clojure web server benchmarks, this server achieved the highest performance.

20140121-14-30

read this tutorial for more information about nginx/clojure implementation.

 

using Tomcat

To install Tomcat server follow those steps.

You need to package the application as a WAR archive, to do that run:

lein ring uberwar

then simply copy the resulting myapp-0.1.0-SNAPSHOT-standalone.war to the webapps folder on Tomcat, eg:

cp target/myapp-0.1.0-SNAPSHOT-standalone.war ~/tomcat/webapps/myapp.war

Your app will now be avaliable at the context /myapp when Tomcat starts. To deploy the app at root context, simply copy it to webapp as ROOT.war.

 

HTTP Kit – HTTP client/server for Clojure

HTTP Kit is a minimalistefficientRing-compatible HTTP client/server for Clojure. It uses a event-driven architecture to support highly concurrent a/synchronous web applications. Feature a unified API for WebSocket and HTTP long polling/streaming

<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;width:555px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="text codecolorer">          [http-kit "2.1.16"] ; Add to your project.clj.</div></td></tr></tbody></table></div>

Check this great example of a websockets app with Clojure and http-kit.

 

That’s It!

 

Cheers!,

Development Specialist, Artist and Activist
Personal Website
postgresql-logo

CentOS PostgreSQL Installation Tutorial – (Centos 6.x)

CentOS PostgreSQL Installation tutorial

CentOS PostgreSQL

centos postgresql :

PostgreSQL is a powerful, open source object-relational database system.
In the following tutorial I’ll show how to install PostgreSQL on your CentOS box

 

CentOS PostgreSQL Installation

We can install PostgreSQL in (at-least) two ways:

  • Using YUM
  • Compile from source

 

Install from repository

yum install postgresql-server
this will install the package postgresql-server, also: postgresql and postgresql-libs.
centos postgresql

centos postgresql

Install from source

If you want to install the latest version of PostgreSQL you should compile from source. it’s recommended for advanced users and one may argue it’s recommended too for production.

Anyway, this article from DigitalOcean covers this area well (and more). If you want to compile using source you better move to that article. If you prefer or installed using repository (yum), continue…

 

PostgreSQL Service

if you’ll try to start PostgreSQL using the service command, you will see an error tells you must init the db first and create the db files in: /var/lib//pgsql/data

posgresqlerror

so,

to init on centos postgresql service use:

service postgresql initdb

posgreinit

This created a data folder in /var/lib/pgsql. You can’t run this command again without deleting first this folder (and all your data).

Also, when you called the initdb command above from RedHat’s init script configured permissions on the database. These configuration settings are in the pg_hba.conf file inside the data folder.

By default all permissions are ‘Ident’,

pgsql-ident

means the only user that can get in initially is user “postgres”, so if you’ll try ‘psql’ from root you’ll get error:

psql: FATAL: Ident authentication failed for user “root”

If you want to login and use postgres with other users than `postgres` you can change the permissions method in pg_hba.conf. change from ‘ident’ to ‘md5’ is recommended.

If you want to use phpPgAdmin (described later) you should change from ‘Ident’ to ‘md5’ or else it won’t login to your system.

 

Set port and Listen Addresses

If you need to change the default port (5432 by default) and Listen Addresses (localhost by default), you can set those vars inside the postgresql.conf inside /var/lib/pgsql/data folder.

#listen_addresses = 'localhost'
#port = 5432

 

Start service

and then, to start on centos postgresql service use:

service postgresql start

postgrestart

to make centos postgresql load on boot use the chkconfig command as follows:

chkconfig postgresql on

 

and That’s it!

 

What next?

 

Managing from Command line

login to postgres

As I mentioned, default setup has ident authentication means the only user that can get in initially is user “postgres”, so if you haven’t changed permissions scheme you should su to postgres before.

to start ‘psql’ as postgres:

# change user to postgres
su - postgres
# start psql manager
psql
# CTRL + D twice to exit both psql and su.

# You can also short the two commands into:
# su postgres -c psql

Add (or create) a user with permission to specific database?

Read this great tutorial.

 

PhpPgAdmin

PostgreSQL visual interface similar to phpMyAdmin? – in short, if you know phpMyAdmin and want phpPgAdmin, you need to add the EPEL repositories, Apache (yum install httpd) and then install using:

If your permissions scheme is currently ‘Ident’ you might need to change that to ‘md5’ as PhpPgAdmin requires it.

yum install phpPgAdmin

Then visit in your browser: http://localhost/phpPgAdmin

centos phppgadmin
centos phppgadmin

Remote connection

Edit /etc/httpd/conf.d/phpPgAdmin.conf if you want to allow access remotly and restart httpd (service httpd restart).

do you use pgsql, postgres, root, administrator as login or even user without password?
if you do, set the $conf[‘extra_login_security’] entry to false in your et/phpPgAdmin/config.inc.php.

 

Change default Postgres user password

If you really want to use the “postgres” role, make sure you set it up a password and $conf[‘extra_login_security’] is false.

use the command:

passwd postgres

to change the system user password and

ALTER USER Postgres WITH PASSWORD 'password';

That alters the password for within the database. To change the password inside Postgresql. there is also short code (inside psql):

\password

Which will ask from you a new password to set.

 

 

Cheers!

Development Specialist, Artist and Activist
Personal Website
xrdp-logo

CentOS xrdp HowTo

Overview

xrdp is a free open-source remote desktop server for Linux.
Installing xrdp on CentOS might be a little tricky since CentOS repositories does not contain the xrdp package.
Even the EPEL repository (Extra Packages Enterprise Linux) only contains an old version of xrdp.

CentOS xrdp HowTo

Add EPEL repo

First you need to add the EPEL repository that has an older version of xrdp.

rpm -Uvh http://ftp.uni-bayreuth.de/linux/fedora-epel/6/i386/epel-release-6-8.noarch.rpm

Install xrdp from EPEL repo

yum install xrdp -y

Install dependencies

yum install tiger-vncserver autoconf automake libtool openssl-devel pam-devel libX11-devel libXfixes-devel -y

Download and install xrdp from source

Now that you have the older version of xrdp installed you can easily compile the latest version on top of the old one.

Download xrdp from sourceforge http://sourceforge.net/projects/xrdp/files/ to /opt folder.

extract the content of the file

tar -xvzf xrdp-v0.6.1.tar.gz

compile and install xrdp:

cd xrdp-v0.6.1
./bootstarp
./configure
make
make install

start xrdp and make sure it is set to run at startup:

service xrdp start
chkconfig xrdp on

Customize xrdp settings

The xrdp service config files are located at ‘/etc/xrdp/’:
We will edit these three:

/etc/xrdp/xrdp.ini
/etc/xrdp/sesman.ini
/etc/xrdp/startwm.sh

Remove login options

Edit ‘/etc/xrdp/xrdp/ini’ and delete from xrdp2 block to the end of the file leaving only the xrdp1 option.

Limit access to certain group

Edit ‘/etc/xrdp/sesman.ini’ and change ‘TerminalServerUsers=tsusers’ to the group name you wan to allow access.
If unset or set to an invalid or non-existent group, login for all users is enabled.

Add environment variables

xrdp has a different set of environment variables than regular bash session.
Edit ‘/etc/xrdp/startwm.sh’ and add at the beginning of the file the environment variables you want.
for example add ‘/bin’ and ‘/sbin’ to the PATH variable:

export PATH=$PATH:/bin:/sbin

Set session limits to avoid login failed error

Edit ‘/etc/xrdp/sesman.ini’ and change ‘MaxSessions=10’ to ‘MaxSessions=100’
 
 
 
xCentOS xrdp HowTo

Enjoy.

LuaJIT

CentOS LuaJIT Installation instructions

centos luajit installation instructions

centos luajit

centos luajit installation instructions – In the following tutorial I will show you how to install and use the LuaJIT Compiler on your CentOS box.

Before you continue you should already know what is Lua and JIT Compiler.

 

What is LuaJIT?

LuaJIT is a Just-In-Time Compiler (JIT) for the Lua programming language.

LuaJIT has been successfully used as a scripting middleware in games, appliances, network and graphics apps, numerical simulations, trading platforms and many other specialty applications. It scales from embedded devices, smartphones, desktops up to server farms. It combines high flexibility with high performance and an unmatched low memory footprint.

LuaJIT has been in continuous development since 2005. It’s widely considered to be one of the fastest dynamic language implementations. It has outperformed other dynamic languages on many cross-language benchmarks since its first release — often by a substantial margin.

LuaJIT is Copyright © 2005-2014 Mike Pall, released under the MIT open source license.

from LuaJIT website

 

Prerequisities

you need to install a package for GCC before compiling LuaJIT, you can do that by:

yum install gcc

or better, install the development tools:

yum groupinstall “Development Tools”

 

centos luajit installation instructions

Check the LuaJIT download page to check if newer version available. The next insructions are for the latest stable version currently available – LuaJIT-2.0.2

cd /opt
wget http://luajit.org/download/LuaJIT-2.0.2.tar.gz
tar -zxvf LuaJIT-2.0.2.tar.gz
cd LuaJIT-2.0.2
make && make install
# or sudo make install if you are not 'root'

Option 2: using git

OPTIONALLY, you can install LuaJIT using GIT. choose this method only if you want to be updated with the latests patches and updates and your don’t care about the risk of bugs. (NOT FOR PRODUCTION) 

cd /opt
git clone http://luajit.org/git/luajit-2.0.git
cd luajit-2.0
make && make install 
# or sudo make install if you are not 'root'
centos luajit

centos luajit

Running LuaJIT

That’s it. you have luajit installed.

consider the file ‘test.lua’:

print ("Hello, world!")

You can run (interpret) the file using

luajit test.lua

Save bytecode to test.out

luajit -b test.lua test.out
luajit test.out

more information about running luajit here.

 

 

That’s it! you have centos luajit installed.

Cheers!.

Development Specialist, Artist and Activist
Personal Website