Archive for the ‘Open source’ Category


Subversion (SVN) is an open source version control system. It helps you keep track of a collection of files and folders.

Step 1: Install Apache/PHP Packages

We need to install apache web server to access svn server using http urls.

# yum install httpd php php-devel php-cli php-pear

Start Apache web server and setup to auto start on system boot

# service httpd restart
# chkconfig httpd on

Step 2: Install Subversion Using Yum

Use following command to install subversion and mod_dav_svn packages.

# yum install mod_dav_svn subversion

Step 3: Configure Subversion with Apache

Subversion creates an apache configuration file, we just need to make necessary changes to it.

# vim /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

<Location /svn>
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName “Subversion User Authentication ”
AuthUserFile /etc/svn-users
Require valid-user
</Location>
Step 4: Create First SVN Repository

Use following command to create your fist svn repository.

# cd /var/www/svn
# svnadmin create myrepo
# chown -R apache.apache myrepo
Step 5: Add SVN Users

# htpasswd -cm /etc/svn-users user1

Step 6: Access Your Repository in Browser

Use http urls to access your repository in browser. It will prompt for authentication. Use login credentials created in Step 5.

 

[root@localhost]# elinks http://your_ip_address/svn/myrepo or use in your fav browser.

CHEERS 🙂

Advertisements

Jenkins on CentOS

Posted: December 5, 2014 in Open source

In a nutshell Jenkins CI is the leading open-source continuous integration server. Built with Java, it provides 1009 plugins to support building and testing virtually any project.

First we need to set up the repository as follows:
$ sudo wget -O /etc/yum.repos.d/jenkins.repo \
http://jenkins-ci.org/redhat/jenkins.repo
$ sudo rpm –import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
Next we need to check java is installed or not.
Next, we can install the package as shown here:
$ sudo yum install jenkins
This will install the latest version of Jenkins into the /usr/lib/jenkins directory. The default Jenkins home directory will be in /var/lib/jenkins.

Now we can start Jenkins using the service command:
$ sudo service jenkins start
By deafult jenkins listen 8080 port. But here we want to change to some other port.
Initially the jenkins will not start, when Installing Jenkins on CentOS:

[root@fenige_www_dev ~]# service jenkins status
jenkins dead but pid file exists
Edit
/etc/sysconfig/jenkins
Change
JENKINS_PORT from JENKINS_PORT=”8080″ to JENKINS_PORT=”8070″
Change it from JENKINS_AJP_PORT=”8009″ OR whatever value to JENKINS_AJP_PORT=”-1″
It will work for sure.
Login as:
http://your_ip_address:8070/
Created logins:
Username: test
Password: secret
Standard Security Setup:
The most common set up — let Jenkins maintain its own user database
Initial steps
1. Go to the Configure Global Security screen and choose “enable security”.
2. Select “Jenkins’s own user database” as the security realm.
3. Place a check mark next to “Allow users to sign up”
4. Select “Matrix-based security” as the authorization
5. Give anonymous user the read access
6. In the text box below the table, type in your user name (you’d be creating this later) and click “add”
7. Give yourself a full access by checking the entire row for your user name
8. Scroll all the way to the bottom, click “save”
At this point, you’ll be taken back to the top page, and Jenkins is successfully secured.
Restart Jenkins (service jenkins restart)
Now you need to create an user account for yourself.

a. Click “login” link at the top right portion of the page
b. Choose “create an account”
c. Use the user name you’ve used in the above step, and fill in the rest.

Tomcat in centos

Posted: December 5, 2014 in Open source

Step 1: Verify JAVA
JAVA is the first requirement of Tomcat installation. Use following command to check if you have java installed already on your system.
[server@localhost ~]$ java -version
java version “1.8.0_25”
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
Tomcat 8.0 is designed to run on Java SE 7 and later.

Step 2: Download and Extract Tomcat Archive
# cd /opt
# wget http://www.us.apache.org/dist/tomcat/tomcat-8/v8.0.15/bin/apache-tomcat-8.0.15.tar.gz
# tar apache-tomcat-8.0.15.tar.gz

Step 3: Setup Environment Variable
Before starting Tomcat, Configure environment variables using following commands.
# echo “export CATALINA_HOME=\”/opt/apache-tomcat-8.0.15\”” >> ~/.bashrc
# source ~/.bashrc

Step 4: Start Tomcat Service
# cd apache-tomcat-8.0.15
# ./bin/startup.sh
[redmoon@fenige_www_dev apache-tomcat-8.0.15]$ sudo ./bin/startup.sh
Using CATALINA_BASE: /opt/apache-tomcat-8.0.15
Using CATALINA_HOME: /opt/apache-tomcat-8.0.15
Using CATALINA_TMPDIR: /opt/apache-tomcat-8.0.15/temp
Using JRE_HOME: /usr
Using CLASSPATH: /opt/apache-tomcat-8.0.15/bin/bootstrap.jar:/opt/apache-tomcat-8.0.15/bin/tomcat-juli.jar
Tomcat started.

Step 5: Access Tomcat in Browser
http://your_ip_address:8080/

Step 6: Setup User Accounts
Finally we need to create user accounts to secure and access admin/manager pages. Edit conf/tomcat-users.xml file in your editor and paste inside <tomcat-users> </tomcat-users> tags.

[root@localhost]# cat tomcat-users.xml
<?xml version=’1.0′ encoding=’utf-8′?>
<tomcat-users>
<role rolename=”tomcat”/>

<role rolename=”manager-gui”/>

<role rolename=”admin-gui”/>

<user username=”test1″ password=”secret” roles=”manager-gui,admin-gui”/>
<user username= “test2″ password=”secret” roles=”manager-gui,admin-gui”/>
<user username=”test3″ password=”secret” roles=”admin-gui,manager-gui”/>
</tomcat-users>
————————————-

And its ready to use these users, you can restart the tomcat and access http://your_ip_address:8080/, click the manger app or host manger etc.

How to start tomcat at the system startup:
Create tomcat8 file in /etc/init.d/ like this:
#vi /etc/init.d/tomcat8
and paste following code:

#!/bin/bash
export CATALINA_HOME=/your/path/here ( for eg: the path where my tomcat  is installed /opt/apache-tomcat-8.0.15 )
PATH=/sbin:/bin:/usr/sbin:/usr/bin
start() {
sh $CATALINA_HOME/bin/startup.sh
}
stop() {
sh $CATALINA_HOME/bin/shutdown.sh
}
case $1 in
start|stop) $1;;
restart) stop; start;;
*) echo “Run as $0 “; exit 1;;
esac
And later modify /etc/init.d/tomcat8 file permissions:
#chmod 755 /etc/init.d/tomcat8
And we can start or stop the tomcat… 🙂

Java in centos

Posted: December 5, 2014 in Open source

Step 1: Download JAVA Archive
For 64Bit

# cd /opt/
# wget –no-cookies –no-check-certificate –header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie” “http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jdk-8u25-linux-x64.tar.gz&#8221;
# tar xzf jdk-8u25-linux-x64.tar.gz
Step 2: Install JAVA using Alternatives
# cd /opt/jdk1.8.0_25/
# alternatives –install /usr/bin/java java /opt/jdk1.8.0_25/bin/java 2
# alternatives –config java
There is 1 program that provides ‘java’.
Selection Command
———————————————–
*+ 1 /opt/jdk1.8.0_25/bin/java
Enter to keep the current selection[+], or type selection number: 1
At this point JAVA 8 has been successfully installed on your system. We also recommend to setup javac and jar commands path using alternatives
# alternatives –install /usr/bin/jar jar /opt/jdk1.8.0_25/bin/jar 2
# alternatives –install /usr/bin/javac javac /opt/jdk1.8.0_25/bin/javac 2
# alternatives –set jar /opt/jdk1.8.0_25/bin/jar
# alternatives –set javac /opt/jdk1.8.0_25/bin/javac
Step 3: Check Version of JAVA
Check the installed version of java using following command.
[server@localhost ~]$ java -version
java version “1.8.0_25”
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

Step 4: Setup Environment Variables
Most of java based application’s uses environment variables to work. Set the java environment variables using following commands
Setup JAVA_HOME Variable
# export JAVA_HOME=/opt/jdk1.8.0_25
Setup JRE_HOME Variable
# export JRE_HOME=/opt/jdk1.8.0_25/jre
Setup PATH Variable
# export PATH=$PATH:/opt/jdk1.8.0_25/bin:/opt/jdk1.8.0_25/jre/bin

 

Alfresco Software

Posted: December 5, 2014 in Open source

Alfresco is a free/libre enterprise content management system for Microsoft Windows and Unix-like operating systems. Alfresco comes in three flavors: Alfresco Community Edition is free software, LGPL licensed open source and open standards.

Installation:
First download the alfresco from the following url:
http://wiki.alfresco.com/wiki/Community_file_list_4.2.c
And download the alfresco-community-4.2.c-installer-linux-x64.bin
Check the permission
#chmod a+x alfresco-community-4.2.c-installer-linux-x64.bin
#./alfresco-community-4.2.c-installer-linux-x64.bin

Language Selection
Please select the installation language
[1] English – English
[2] French – Français
[3] Spanish – Español
[4] Italian – Italiano
[5] German – Deutsch
[6] Japanese – 日本語
[7] Dutch – Nederlands
[8] Russian – Русский
[9] Simplified Chinese – 简体中文
Please choose an option [1] : 1
—————————————————————————-
Welcome to the Alfresco Community Setup Wizard.
—————————————————————————-
Installation Type
[1] Easy – Installs servers with the default configuration
[2] Advanced – Configures server ports and service properties.: Also choose optional components to install.
Please choose an option [1] : 1
—————————————————————————-
Installation folder
Please choose a folder to install Alfresco Community
Select a folder [/opt/alfresco-4.2.c]:
—————————————————————————-
Admin Password
Please give a password to use for the Alfresco administrator account:
Admin Password: : admin
Repeat Password: : admin
—————————————————————————-
Install as a service
You can optionally register Alfresco Community as a service. This way it will
automatically be started every time the machine is started.

Install Alfresco Community as a service? [Y/n]: n

—————————————————————————-
Setup is now ready to begin installing Alfresco Community on your computer.
Do you want to continue? [Y/n]: y
———————————————————————-
Please wait while Setup installs Alfresco Community on your computer.
Installing
0% ______________ 50% ______________ 100%
########################################
—————————————————————————-
Setup has finished installing Alfresco Community on your computer.
View Readme File [Y/n]: y
Launch Alfresco Community Share [Y/n]: y
waiting for server to start….README
Alfresco Community 4.2
======================
For Enterprise subscribers, refer to http://support.alfresco.com for release
notes and detailed information on this release.
For Community members, refer to the Alfresco wiki for more information on this
release.
Press [Enter] to continue : done
server started
/opt/alfresco-4.2.c/postgresql/scripts/ctl.sh : postgresql started at port 5432
Using CATALINA_BASE: /opt/alfresco-4.2.c/tomcat
Using CATALINA_HOME: /opt/alfresco-4.2.c/tomcat
Using CATALINA_TMPDIR: /opt/alfresco-4.2.c/tomcat/temp
Using JRE_HOME: /opt/alfresco-4.2.c/java
Using CLASSPATH: /opt/alfresco-4.2.c/tomcat/bin/bootstrap.jar:/opt/alfresco-4.2.c/tomcat/bin/tomcat-juli.jar
Using CATALINA_PID: /opt/alfresco-4.2.c/tomcat/temp/catalina.pid
/opt/alfresco-4.2.c/tomcat/scripts/ctl.sh : tomcat started

Now in the browser:
http://al.domain.com.pl:8080/share/page/
Username: admin
Password: secret

Translate to polish language:

This is very interesting part, please note that alfresco latest model ie 5.0. version will not allow to translate foreign language which is not present in language selection.

Get the language pack from the following url:
http://alf-trans.ossportal.org/

Download two jars using links above;
Copy these files to tomcat/shared/lib folder under your Alfresco installation directory;
Restart Alfresco
Change the web-browser language. If you are using google chrome, change the language translation to polish.

Bingo! 🙂


OpenVAS (Open Vulnerability Assessment System, the name of the fork originally known as GNessUs) is a framework of several services and tools offering a vulnerability scanning and vulnerability management solution. All OpenVAS products are Free Software.

Installation:

step 1: Configure OBS Repository
(as user root, only once)
echo “deb http://download.opensuse.org/repositories/security:/OpenVAS:/UNSTABLE:/v6/Debian_7.0/ ./” >> /etc/apt/sources.list
wget http://download.opensuse.org/repositories/security:/OpenVAS:/UNSTABLE:/v6/Debian_7.0/Release.key
apt-key add ./Release.key
sudo apt-get update
Step 2: Quick-Install OpenVAS
(as user root, only once)
apt-get -y install greenbone-security-assistant openvas-cli openvas-manager openvas-scanner openvas-administrator sqlite3 xsltproc rsync
To install support packages for report generation (downloads around 30 MB of additional packages):
apt-get -y install texlive-latex-base texlive-latex-extra texlive-latex-recommended htmldoc
To install support for autogenerated LSC credential packages:
apt-get -y install alien rpm nsis fakeroot
Step 3: Quick-Start OpenVAS
(copy and paste whole block as user root, during first time you will be asked to set a password for user “admin”)
test -e /var/lib/openvas/CA/cacert.pem || openvas-mkcert -q
openvas-nvt-sync
test -e /var/lib/openvas/users/om || openvas-mkcert-client -n om -i
/etc/init.d/openvas-manager stop
/etc/init.d/openvas-scanner stop
openvassd
openvasmd –rebuild
openvas-scapdata-sync
openvas-certdata-sync
test -e /var/lib/openvas/users/admin || openvasad -c add_user -n admin -r Admin
killall openvassd
sleep 15
/etc/init.d/openvas-scanner start
/etc/init.d/openvas-manager start
/etc/init.d/openvas-administrator restart
/etc/init.d/greenbone-security-assistant restart
Step 4: Log into OpenVAS as “admin”
Open https://localhost:9392/.
Username: admin
Password: secret


OTRS, short for Open-source Ticket Request System, is an open-source (site) and free issue tracking system software package which a company, organization, or institution can use to assign tickets to incoming queries, thereby greatly facilitating the handling of support requests and other customer traffic. It is Perl based (not PHP), has no limitations and can be greatly extended, such as:
– SIRIOS, an incident and advisory system for CERT’s (Computer Emergency Response Teams),
– ITSM, an ITIL compliant IT Service Management Solution.

 

New Installation for UBUNTU:

We need to install it in a subdomain

1. mkdir -p /var/www/html/zglos.yawal.com
2. Download otrs
wget http://ftp.otrs.org/pub/otrs/otrs-3.3.10.tar.gz
3. tar xf otrs-3.3.10.tar.gz
4. mv otrs-3.0 otrs
5. useradd -r -d /var/www/html/zglos.yawal.com/otrs -c ‘OTRS user’ otrs
6. usermod -G nogroup otrs
7. cd otrs/Kernel/
8. cp Config.pm.dist Config.pm
9. cd Config
10. cp GenericAgent.pm.dist GenericAgent.pm
11. cd /var/www/html/zglos.yawal.com/otrs/bin
12. ./otrs.SetPermissions.pl –otrs-user=otrs –web-user=www-data –otrs-group=nogroup –web-group=www-data /var/www/html/zglos.yawal.com/otrs
13. Reload the apache and mysql
14. Installation of Perl modules

OTRS needs some additional Perl modules. If you install OTRS from source, you will have to install these modules manually. This can be done either with the package manager of your Linux distribution (yast, apt-get) or, as described in this section, through the Perl shell and CPAN. If you’re using ActiveState Perl, for instance on Windows, you could use PPM, the built-in Perl Package Manager. We recommend using your package manager if possible.
you can check to see which Perl modules have failed by running the following:
cd /otrs/bin
sudo ./otrs.CheckModules.pl
The following command should fix the failed Perl modules.
sudo aptitude install liblwp-useragent-determined-perl libapache2-reload-perl libnet-smtp-ssl-perl libnet-smtp-tls-butmaintained-perl
You can/should verify that, at the very least, all required modules are listed as “ok”
There are a number of optional moduels that should prove to be useful (i.e. PDF functionality, LDAP connectivity, etc.) The following command will install Perl modules that will enable many useful features in OTRS.
sudo aptitude install libgd-gd2-perl libgd-graph-perl libgd-text-perl libjson-xs-perl libnet-dns-perl libyaml-libyaml-perl libpdf-api2-simple-perl libtext-csv-xs-perl libxml-parser-perl libmail-imapclient-perl libnet-ldap-perl
*Please note that this does not install ALL optional modules.

Crypt::Eksblowfish::Bcrypt…….Not installed! (optional – For strong password hashing.)
o Crypt::SSLeay………………..Not installed! (optional – Required for Generic Interface SOAP SSL connections.)
o Date::Format…………………ok (v2.24)
o DBI…………………………ok (v1.630)
o DBD::mysql…………………..ok (v4.025)
o DBD::ODBC……………………Not installed! (optional – Required to connect to a MS-SQL database.)
o DBD::Oracle………………….Not installed! (optional – Required to connect to a Oracle database.)
o DBD::Pg……………………..Not installed! (optional – Required to connect to a PostgreSQL database.)
o Encode::HanExtra……………..Not installed! (optional – Required to handle mails with several Chinese character sets.)
o GD………………………….ok (v2.46)
o GD::Text…………………..ok (v0.86)
o GD::Graph………………….ok (v1.44)
o IO::Socket::SSL………………ok (v1.965)
o JSON::XS…………………….ok (v2.34)
o List::Util::XS……………….ok (v1.27)
o LWP::UserAgent……………….ok (v6.05)
o Mail::IMAPClient……………..ok (v3.35)
o IO::Socket::SSL…………….ok (v1.965)
o ModPerl::Util………………..ok (v2.000008)
o Net::DNS…………………….ok (v0.68)
o Net::LDAP……………………ok (v0.58)
o PDF::API2……………………ok (v2.020)
o Compress::Zlib……………..ok (v2.060)
o Text::CSV_XS…………………ok (v1.02)
o Time::HiRes………………….ok (v1.9725)
o Time::Piece………………….ok (v1.20_01)
o XML::Parser………………….ok (v2.41)
o YAML::XS…………………….ok (v0.41

 

15. Execute also the two commands perl -cw bin/cgi-bin/index.pl and perl -cw bin/otrs.PostMaster.pl after changing into the directory /opt/otrs. If the output of both commands is “syntax OK”, your Perl is properly set up
root@web1:/var/www/html/zglos.yawal.com/otrs/bin# cd ..
root@web1:/var/www/html/zglos.yawal.com/otrs# perl -cw bin/cgi-bin/index.pl
bin/cgi-bin/index.pl syntax OK
root@web1:/var/www/html/zglos.yawal.comotrs/otrs# perl -cw bin/otrs.PostMaster.pl
bin/otrs.PostMaster.pl syntax OK
root@web1:/var/www/html/zglos.yawal.com/otrs#

16.root@web1:~# cp -va /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/sites-available/otrs.conf
‘/opt/otrs/scripts/apache2-httpd.include.conf’ -> ‘/etc/apache2/sites-available/otrs.conf’

17.root@web1:/var/www/html/zglos.yawal.com/otrs/bin# ./otrs.SetPermissions.pl –otrs-user=otrs –web-user=www-data –otrs-group=www-data –web-group=www-data /var/www/html/zglos.yawal.com/otrs
bin/otrs.SetPermissions.pl – set OTRS file permissions
Copyright (C) 2001-2014 OTRS AG, http://otrs.com/
Setting permissions on /var/www/html/zglos.yawal.com/otrs
Setting permissions on /var/www/html/zglos.yawal.com/otrs/var
Setting permissions on /var/www/html/zglos.yawal.com/otrs/bin/*
Setting permissions on /var/www/html/zglos.yawal.com/otrs/scripts/
Setting permissions on /var/www/html/zglos.yawal.com/otrs/Kernel/Config.pm
18. Configuring the database:
============================
If you use MySQL as the database back-end, you can use the OTRS web installer: http://zglos.yawal.com/installer.pl
When the web installer starts, please follow the next steps to setup your system:
1. Check out the information about the OTRS offices and click on next to continue
2. Read the GNU Affero General Public License and accept it, by clicking the corresponding button at the bottom of the page.
3. Provide the username and password of the administrator, the DNS name of the computer which hosts OTRS and the type of database system to be used.
4. You will be notified if the check was successful. Press OK to continue
5. Create a new database user, choose a name for the database and click on ‘Next’
6. If the database and its user were successfully created, you will get a setup notification. Click ‘Next’ to go to the next screen.
7. Provide all the required system settings and click on ‘Next’
8. If you want, you can provide the needed data to configure your inbound and outbound mail, or skip this step by pressing the right button at the bottom of the screen
9. Restart the OTRS service now to use the new configuration settings
10. Congratulations! Now the installation of OTRS is finished and you should be able to work with the system
11. To log into the web interface of OTRS, use the address http://zglos.yawal.com/otrs/index.pl from your web browser. Log in as OTRS administrator, using the username ‘root@something’ and the password ‘secret’. After that you can configure the system for your needs.

Bingo! OTRS is Ready 🙂