centos grails
centos grails installation tutorial for newbs. for CentOS 6.x (And probably for older/later)
Development Specialist, Artist and Activist
Personal Website
centos grails installation tutorial for newbs. for CentOS 6.x (And probably for older/later)
Development Specialist, Artist and Activist
Personal Website
CentOS Groovy installation instruction for newbs.
Development Specialist, Artist and Activist
Personal Website
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
Development Specialist, Artist and Activist
Personal Website
drbd not defined in your config (for this host) FIX.
the fix to your problem is in the .res file in /dev/drbd.d/ . check against ‘uname‘ command that the hostnames are correct.
that’s it.
Development Specialist, Artist and Activist
Personal Website
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
We can install PostgreSQL in (at-least) two ways:
yum install postgresql-server
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…
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
so,
to init on centos postgresql service use:
service postgresql initdb
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’,
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.
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
and then, to start on centos postgresql service use:
service postgresql start
to make centos postgresql load on boot use the chkconfig command as follows:
chkconfig postgresql on
and That’s it!
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
Read this great tutorial.
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
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.
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
“Access Control List (ACL) provides an additional, more flexible permission mechanism for file systems.
It is designed to assist with UNIX file permissions.
ACL allows you to give permissions for any user or group to any disc resource.” (Wikipedia)
Continue reading
DevOps/IT Specialist, Musician.
IT Manager – Faculty of Exact Sciences, Bar-Ilan University
Personal Website
“The nc (or netcat) utility is used for just about anything under the sun involving TCP, UDP, or UNIX-domain sockets.
It can open TCP connections, send UDP packets, listen on arbitrary TCP and UDP ports, do port scanning, and deal with both IPv4 and IPv6. Unlike telnet nc scripts nicely, and separates error messages onto standard error instead of sending them to standard output, as telnet does with some.” (NetCat Manual)
DevOps/IT Specialist, Musician.
IT Manager – Faculty of Exact Sciences, Bar-Ilan University
Personal Website
Linux chmod has a few options that can make your life a lot easier when managing a shared storage.
The most needed are chmod suid sgid sticky bit.
Also the impact of each one is different between files and folders.
Continue reading
DevOps/IT Specialist, Musician.
IT Manager – Faculty of Exact Sciences, Bar-Ilan University
Personal Website
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.
Continue reading
DevOps/IT Specialist, Musician.
IT Manager – Faculty of Exact Sciences, Bar-Ilan University
Personal Website
CentOS Tomcat
centos tomcat
“Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed under the Java Community Process.” from Tomcat homepage.
before we’ll continue the installation of Tomcat, the JDK (Java Development Kit) should be installed on your CentOS machine. to check for Java support use the command:
java -version
if bash returns ‘command not found‘ then continue to the next step and install the JDK, else skip the step and continue to Tomcat server installation.
To install the jdk we have 2 options:
I’ll explore both:
For beginners and testing purposes you should go with this option.
Why should I use the Oracle JDK over the OpenJDK, or vice-versa? [closed]
The command to install JDK using YUM is very simple:
yum install java
Check you have installed it right:
Download your required JDK here.
Note: I can’t give you an WGET command to download, because you need to Accept License Agreement before downloading any file.
You can download and install using the RPM or the tar.gz (both with x86 or x64) on your CentOS machine:
In case of our CentOS we can download and install the .rpm file or the .tar.gz file.
RPM can be installed ONLY by the root.
TAR.GZ can be installed be any user on the computer.
make sure to uninstall older installations (if any):
rpm –e <package name>
To install the jdk using the downloaded rpm use the rpm command:
rpm –ivh jdk-7u45-linux-x64.rpm
If you just want to upgrade a package you’ve already installed use the -Uvh parameter.
rpm –Uvh jdk-7u45-linux-x64.rpm
Delete the .rpm file if you want to save disk space.
Read more about installation of Oracle Java on Centos here on ItekBlog
Use alternatives :
alternatives –install /usr/bin/java java /usr/java/latest/jre/bin/java 20000
alternatives –install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000
and config your default jdk (if you have more then one) using:
using:
alternatives –config java
Just as in the first step: type java -version to see if your have jdk installed.
The advantage of tar.gz installation of the JDK is that we can able to install multiple version of java if required.
The archive can be installed by anyone (not only root users), in any location that you can write to. However, only the root user can install the JDK into the system location.
You need to unpack the .tar.gz file (using tar -xzf) into the the location where you would like the JDK to be installed.
Unpack the tarball and install the jdk:
tar zxvf jdk-7u<version>-linux-i586.tar.gz
Delete the .tar.gz file if you want to save disk space.
Use alternatives :
alternatives –install /usr/bin/java java /path/to/jdk1.7.0_45/bin/java 2
alternatives –config java
read more about installation of jdk in the oracle documentation.
for extended installation tutorial read this post by adam in this blog.
read more on What is the difference between jdk 1.6 and 1.7 ?
1 | JAVA_HOME |
is a
1 | environment |
variable (in Unix terminologies), or a PATH variable (in Windows terminology) you need to create to point to where Java is installed. ($JAVA_HOME/bin/java should execute the Java runtime).
To set it for your current session type at bash:
export JAVA_HOME=/usr/java/jdk1.7.0_05
export PATH=$PATH:$JAVA_HOME/bin
To set the JAVA_HOME permanently we need to add the commands to the ~/.bash_profile file of the user.
We can also add it /etc/profile and then source it to give to all users.
use the echo command to check you’ve configured the variables:
echo $JAVA_HOME
echo $PATH
After we have java installed and tested we can continue to the installation of the Tomcat server.
Since Apache Tomcat is distributed as binaries, all you have to do is to download it and start it.
Download apache-tomcat-x.x.xx.tar.gz (latest version or any) from Apache Tomcat Homepage
I’ll go with the tomcat 8 – tar.gz package.
and using command:
cd /usr/share
wget http://apache.spd.co.il/tomcat/tomcat-8/v8.0.0-RC10/bin/apache-tomcat-8.0.0-RC10.tar.gz
verify and extract the download using::
md5sum apache-tomcat-8.0.0-RC10.tar.gz
tar xvzf apache-tomcat-8.0.0-RC10.tar.gz
and I have a /usr/share/apache-tomcat-8.0.0-RC10 folder now.
Tomcat by default start on port 8080 you can start the server now by typing at bash:
cd apache-tomcat-8.0.0-RC10
./bin/startup.sh
Now Access the tomcat by connecting your server with a web browser on port 8080.
http://localhost:8080
If you cannot access the above Tomcat page, make sure to stop iptables (since CentOS has iptables on by default set to block the Tomcat’s default listening port 8080).
service iptables stop
to permanently disable iptables (NOT RECOMMENDED AT ALL) use:
chkconfig iptables off
Locate server.xml in {Tomcat installation folder}/conf/ which is at /usr/share/apache-tomcat-8.0.0-RC10/conf in our case
Find the following:
<!-- Define a non-SSL HTTP/1.1 Connector on port 8180 --> <Connector port="8080" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" />
and change the 8080 port to your required port.
To start the tomcat service on system boot create the file /etc/init.d/tomcat8 (I am using vi /etc/init.d/tomcat8) and fill it with:
#!/bin/bash # description: Tomcat Start Stop Restart # processname: tomcat # chkconfig: 234 20 80 JAVA_HOME=/usr/java/jdk1.7.0_05 export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH export PATH CATALINA_HOME=/usr/share/apache-tomcat-8.0.0-RC10 case $1 in start) sh $CATALINA_HOME/bin/startup.sh ;; stop) sh $CATALINA_HOME/bin/shutdown.sh ;; restart) sh $CATALINA_HOME/bin/shutdown.sh sh $CATALINA_HOME/bin/startup.sh ;; esac exit 0
Now set the permissions on the file and the catalina.sh file:
chmod a+x /etc/init.d/tomcat8 chmod a+x /usr/share/apache-tomcat-8.0.0-RC10/bin/catalina.sh
to start/stop/restart the service use:
service tomcat8 start service tomcat8 restart service tomcat8 stop
to start the service on boot use:
chkconfig --add tomcat8 chkconfig tomcat8 on
to disable it later you can use off instead of on:
chkconfig tomcat8 off
That’s it! you have your CentOS Tomcat server working and runing…
Development Specialist, Artist and Activist
Personal Website
dd-wrt set date manually – In this tutorial I’ll explain how to set the date and time in dd-wrt based routers.
My dd-wrt system is dd-wrt v24-sp2 (11/02/09) std
(SVN revision 13064M VINT Eko).
It may not work on your system but I’ll explain the basics so you should be able to find your own way.
in dd-wrt set date manually using command-line. you can do this by:
Becuase ssh is not opened by default on all dd-wrt machines I’ll explain how to set the date and time using the second method – using the web interface. but the same command and rules apply also to SSH connection.
go to your dd-wrt admin managment panel on your browser and view the Administration / Commands page. it may be different in your system version but you should able to find quickly where the Commands page is.
You can use the Date command inside your dd-wrt box to read and set your system time and date.
to view your current date as configured in your dd-wrt machine use the ‘date‘ command.
Just fill the commands input box with ‘date’ and click on the ‘Run Commands‘ button.
date
Here it may be tricky. I’ve found several online blogs and manuals but nothing worked. to set the dd-wrt date manually I’ve succeded with the following command:
date 022720012014
Month | Day | Hours | Minutes | Year |
02 | 27 | 20 | 01 | 2014 |
that’s it. I hope It helped you to configure your dd-wrt set date manually.
Development Specialist, Artist and Activist
Personal Website