Support

Forums

Contact Me

Posts Tagged 'install'

Installation art

Installation art describes an artistic genre of three-dimensional works that are often site-specific and designed to transform the perception of a space. [http://en.wikipedia.org/wiki/Installation_art]

Install Atlassian Confluence in 15 minutes

confluence.logo

In this small post, you will learn how to install Atlassian Confluence in no more than 15 minutes. It do not replace the online installations manual (The Confluence Installation Guide is for people who are installing Confluence for the first time. Check the requirements and supported platforms, then download and install Confluence), but mainly complement it, with some of the best Linux practices (ADDED points).

 

 


 

 

How to install Atlassian Confluence in 15 minutes

Create user and user group

ADDED: Better run these web applications with their own user group and user for more security…This is not required, but follow Linux best practices, thus highly recommended.

The groupadd command creates a new group account using the values specified on the command line and the default values from the system.

# groupadd confluence

The useradd command allow a super user or root to create a new user or updates default new user information.

# useradd -g confluence -c 'confluence user for confluence' -m confluence

Be that user, for all next operations

# su – confluence

You are now in the new home of user confluence.

/home/confluence /#

Install Confuence

Get the latest standalone version

# wget http://www.atlassian.com/software/confluence/downloads/binary/confluence-3.1.1-std.tar.gz

Unpack it

# tar –xvf confluence-3.1.1-std.tar.gz

ADDED: To avoid having version number and make software updates easier, create a symbolic link (symlink). This will avoid to have in all your scripts a reference to the version number, thus keeping them more or less generic.

# ln –s /home/confluence/confluence-3.1.1-std /home/confluence/confluence

Customization of profile

ADDED: I do not like to type too much, that why all server where I went are full of aliases. This help also other developers to locate quickly interesting functions on the system.

# cd

Open the Bashrc and put at the end

# vi .bashrc

At least these 4 alias, you are free to define more. Think also that they may be seen as documentation.

alias rel='cd /home/confluence/confluence/'
alias logs='tail -F /home/confluence/confluence/logs/*'
alias cstart='/home/confluence/confluence/bin/startup.sh'
alias cstop='/home/confluence/confluence/bin/shutdown.sh'

To make you life easier, you’ll be able now to start and stop Confluence by issuing a cstart or cstop, watch logs by typing logs

Prepare database configuration

Go to confluence home

# cd

If you are using MySQL (most of the time you are), you’ll have to get the driver from internet due to licensing issues

# wget http://mirror.switch.ch/ftp/mirror/mysql/Downloads/Connector-J/mysql-connector-java-5.1.10.zip

Install unzip if not available on your system

# apt-get install unzip

Unpack drivers in current directory

# unzip mysql-connector-java-5.1.10.zip

Search the driver file. I do this to avoid searching or typing for it

# find /home/confluence/ -name mysql*.jar

This should return something like mysql-connector-java-5.1.10/mysql-connector-java-5.1.10-bin.jar.

Copy this drivers into tomcat shared lib, aka into /home/confluence/confluence/lib

# cp mysql-connector-java-5.1.10/mysql-connector-java-5.1.10-bin.jar /home/confluence/confluence/lib

Create new database schema and user

# mysql –u root –p
mysql> create database confluence character set utf8;
mysql> CREATE USER 'confluence'@'localhost'
        IDENTIFIED BY 'xxxxxxxxxx';

mysql> GRANT ALL PRIVILEGES ON confluence
        TO 'confluence'@'localhost' WITH GRANT OPTION;
mysql>  FLUSH PRIVILEGES;

Configure Confluence to connect to this new database

Open /home/confluence/confluence/conf/server.xml and add in yellow the configuration for your database.






username="confluence"
password="xxxxxxxxxx"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/confluence?autoReconnect=true&useUnicode=true&characterEncoding=UTF8"
maxActive="20"
maxIdle="7"
validationQuery="select 1" />


Start Confluence

Issue a

# cstart; logs

and check logs to see if there is no fatal error occurring before visiting your browser http://yourserverIP:8081/confluence to continue installation.

Scripts (optional)

Create a new init.d script for Confluence

ADDED: Are for starting and stopping easily Confluence, in a standard way. This is something missing currently in the manuals. Here I present you maybe the most basic script ever made, but its purpose is just to be called later on by a rc.d as you will see later.

# vi /etc/init.d/confluence

And place inside the following

 
#!/bin/bash 

RETVAL=0 
NORMAL_PORT=8009 

start() { 
su -l confluence -c '/home/confluence/confluence/bin/startup.sh' 
} 

stop() { 
su -l confluence -c '/home/confluence/confluence/bin/shutdown.sh' 
} 

status() { 
echo "not implemented" 
} 

findShutdownPort() { 
SHUTDOWN_PORT=`netstat -vatn|grep LISTEN|grep $NORMAL_PORT|wc –l` 
} 

case "$1" in 
start) 
start 
;; 
stop) 
stop 
;; 
restart) 
stop 
start 
;; 
redebug) 
stop 
debug 
;; 
status) 
status 
;; 
*) 
echo "Usage: $0 {start|stop|restart|redebug|status}" 
exit 1 
esac 
exit $RETVAL

# chown u+x /etc/init.d/confluence

Rc.d scripts

ADDED: This will start automatically Confluence in runlevel 5 if machine if ever restarted

# cd /etc/rc5.d

Create a symbolic link to the Init.d script for starting

# ln -s ../init.d/confluence S20confluence

And stopping

# ln -s ../init.d/confluence k20confluence

Ubuntu 12.04 update nginx to the latest version

Official version of nginx for Ubuntu Precise is 1.1.19 but the latest available stable version is 1.2.2 (Changes), In this post I will present you how to update to the latest available version.

vi /etc/apt/sources.list

and add depending on your Ubuntu version either

For Ubuntu 10.04 Lucid:

deb http://nginx.org/packages/ubuntu/ lucid nginx
deb-src http://nginx.org/packages/ubuntu/ lucid nginx

For Ubuntu 12.04 Precise:

deb http://nginx.org/packages/ubuntu/ precise nginx
deb-src http://nginx.org/packages/ubuntu/ precise nginx

Now you can run

apt-get update

When using the public nginx repository for Ubuntu, you’ll get this error

W: GPG error: http://nginx.org lucid Release: The following signatures 
couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62

First of all this is only warning and you can ignore it, if you know what are you doing and in case you prefer to add public key, used for signing packages and repository, just run:

gpg -a --export 7BD9BF62 |  sudo apt-key add -

or

wget http://nginx.org/packages/keys/nginx_signing.key
cat nginx_signing.key | sudo apt-key add -

apt-get update should now run fine, however after running an

apt-get install nginx

you may still get this kind of error:

dpkg: error processing /var/cache/apt/archives/nginx_1.2.2-1~precise_amd64.deb (--unpack):
 trying to overwrite '/etc/logrotate.d/nginx', which is also in package nginx-common 1.1.19-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/nginx_1.2.2-1~precise_amd64.deb

just remove nginx-common and retry

apt-get remove nginx-common 

More at http://wiki.nginx.org/Install

Install PHPUnit and PHPDocumentor in XAMPP

phpunit-logoselenium-logoxampp.logo

Open XAMPP Shell (start c:\xampp\xampp-control.exe and click on the button XAMPP-Shell), and run:

pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
pear install --alldeps phpunit/PHPUnit
pear install phpunit/DbUnit phpunit/PHPUnit_Selenium
pear install phpunit/PHPUnit_SkeletonGenerator
pear install phpunit/PHPUnit_Story phpunit/PHP_CodeCoverage
pear install PhpDocumentor

Read more: Install PHPUnit and PHPDocumentor in XAMPP

The Alternative PHP Cache install

The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. It was conceived of to provide a free, open, and robust framework for caching and optimizing PHP intermediate code. from http://nl2.php.net/apc

Links:

Read more: The Alternative PHP Cache install

Install Munin Monitoring in Ubuntu 11.10 Oneiric with nginx

Munin is a networked resource monitoring tool that can help analyze resource trends and "what just happened to kill our performance?" problems. It is designed to be very plug and play. A default installation provides a lot of graphs with almost no work.

In Norse mythology Hugin and Munin are the ravens of the god king Odin. They flew all over Midgard for him, seeing and remembering, and later telling him. "Munin" means "memory".

Read more: Install Munin Monitoring in Ubuntu 11.10 Oneiric with nginx

Install subversion on windows

joomla_cms

In order to better develop for Joomla by having your own subversion local repositories.

My second objective is to version different version of Joomla!/my components so I can
run a continuous build strategy with XINC...but more on that later when I will have enough regression tests :-)

Download the Subversion distribution for you operating system at: http://subversion.tigris.org/getting.html

Subversion Binary Packages
AIX
aix
Debian
debian
Debian Project
apt-get install subversion
HP-UX
hp
Fedora
fedora
Fedora Project
yum install subversion
Mac OS X
mac
Fink package (Requires Fink)
MacPorts (Requires MacPorts)
openCollabNet (Universal)
FreeBSD
freebsd
FreeBSD Project
cd /usr/ports/devel/subversion;
make install
Red Hat
redhat
CollabNet (Certified binaries)
SummerSoft (Red Hat 8,9 +)
NetBSD
netbsd
pkgsrc
cd /usr/pkgsrc/devel/subversion;
make install clean
Solaris
solaris
CollabNet (Certified binaries, SPARC)
Sunfreeware (SPARC & i386)
OpenBSD
openbsd
OpenBSD Project
cd /usr/ports/devel/subversion;
make install
Windows
windows
CollabNet (Certified binaries)
Tigris.org: Apache 2.0 or Apache 2.2
VisualSVN (VisualSVN Server)
Ubuntu
ubuntu
Ubuntu Packages
apt-get install subversion

 

 

 

 


The first thing you'll need is a new repository. A repository is where all of your individual projects will be stored.

Create a new directory using the file explorer or with

# mkdir e:\xsubrversion

Initialize it by issuing this command:

# svnadmin create e:\xsubrversion

Inside your new repository (e:\xsubrversion ) there is a directory called /conf. There you'll find a file
svnserve.conf. Open this file in a text editor.

Just uncomment the following lines by removing the #:

[general]
anon-access = read
auth-access = write
password-db = passwd

In the same directory, you'll find another text file called passwd, if it do not exist, just create it and put all
users authorize to access subversion in a [users] section. It is a pure key value pair file in the format
NAME = PASSWORD

[users]
cedric.walter = xxxxxxx
monkey.coder = yyyyyy

Restart the service "Subversion Server"

In Eclipse PDT/PHP Eclipse, you can now connect to Subversion with Subversive client (Subclipse is not part of
Eclipse consortium)

URL: svn://localhost
User: cedric.walter
Password: xxxxxxxxxxxx

suversion.subclipse  and be able to commit and browse you code trunk.subversion.local

chkrootkit

chkrootkit is a tool to locally check for signs of a rootkit. chkrootkit is a common unix-based program intended to help system administrators check their system for known rootkits. It works by using several mechanisms, including comparison of file signatures to known rootkits, checking for suspicious activity (processes listed in the proc filesystem but not in the output of the 'ps' command.

Read more: chkrootkit

installing Google Chromium OS to USB

chromium.os.logo

Chromium OS is an open-source project that aims to build an operating system that provides a fast, simple, and more secure computing experience for people who spend most of their time on the web. In this small post I provide you the URL to a binary build, and a small how to install it on a USB stick.

 


 

After 2 seconds boot time, and the login screen, you should see the following:

chromiumos

Download

http://chromeos.hexxeh.net/index.php

Instructions

Linux Instructions

Extract ChromeOS-Cherry.img and run the following command in the same directory as the file, where X is the device name of your USB drive.
# sudo dd if=ChromeOS-Cherry.img of=/dev/X bs=4M
Once the command finishes, you can then boot from the USB drive

Windows Instructions

Download Image Writer for Windows (http://bit.ly/7gRu0n) and extract the program. Launch the program, and select the image (ChromeOS-Cherry.img) and your USB drive letter from the drop down box. Click "Write". The install image will then be copied to the drive. Once it's done, close the program and you can then boot from the USB drive.

Mac

Firstly, unmount the drive you want to install Chromium OS to. Place the downloaded file onto your desktop. Open System Profiler, click USB on the list at the side and then select the entry that represents your USB disk. Now look for the BSD Name column (http://bit.ly/5mG4WK), ie disk1

open up Terminal and type the following commands.
# cd Desktop
# tar -zxvf ChromeOS-Cherry.tar.gz
Replace X with the name of the disk you found earlier, ie disk1.
# sudo dd if=ChromeOS-Cherry.img of=/dev/X bs=4m
This command will ask you to enter your password (the same one you enter when installing software for example), type it in and press enter.

Mod-Evasive and Ubuntu 10.04 LTS

What is mod_evasive?

mod_evasive is an evasive maneuvers module for Apache to provide evasive action in the event of an HTTP DoS or DDoS attack or brute force attack. It is also designed to be a detection and network management tool, and can be easily configured to talk to ipchains, firewalls, routers, and etcetera. mod_evasive presently reports abuses via email and syslog facilities.

Detection is performed by creating an internal dynamic hash table of IP Addresses and URIs, and denying any single IP address from any of the following:

  • Requesting the same page more than a few times per second
  • Making more than 50 concurrent requests on the same child per second
  • Making any requests while temporarily blacklisted (on a blocking list)

Installation

apt-get install libapache2-mod-evasive
mkdir /var/log/apache2/mod_evasive
chown www-data:www-data /var/log/apache2/mod_evasive

Configuration

Create a new file

vi /etc/apache2/conf.d/01_modevasive.conf

with this content

<ifmodule mod_evasive20.c>
 DOSHashTableSize 3097
 DOSPageCount 2
 DOSSiteCount 50
 DOSPageInterval 1
 DOSSiteInterval 1
 DOSBlockingPeriod 10
 DOSLogDir /var/log/apache2/mod_evasive
 DOSEmailNotify root@localhost
 DOSWhitelist 127.0.0.1
</ifmodule>

Restart Apache to activate the new module

/etc/init.d/apache2 restart

Documentation

  • DOSHashTableSize: Size of the hash table used to store the IPs.
  • DOSPageCount: Number of pages allowed per DOSPageInterval.
  • DOSPageInterval: Time in seconds used by DOSPageCount.
  • DOSSiteCount: Number of objects allowed per DOSSiteInterval.
  • DOSSiteInterval: Time in seconds used by DOSSiteCount.
  • DOSBlockingPeriod: Time in seconds that IPs will be banned. If an IP tries to access the server within this period, the count will be restarted.
  • DOSLogDir: Optional. Directory to store the logs. If not specified, /tmp will be used.
  • DOSEmailNotify: Optional. Mail where notifications will be sent.

DOSSystemCommand: is Optional.  Command to execute if an IP is blocked. For example using iptables:

DOSSystemCommand "/sbin/iptables -I INPUT -p tcp --dport 80 -s %s -j DROP"

ModSecurity WAF and Ubuntu 10.04 LTS

I was unable to Install properly OpenSuSE 11.3 with Plesk 10.1.1. This has forced me to install Ubuntu 10.04 LTS and since then also to (re)learn some basic stuff to secure my Linux server. Here are some of my How-To.

ModSecurity is an open source web application firewall (WAF) engine for Apache that is developed by Trustwave's SpiderLabs. It has a robust event-based programming language which provides protection from a range of attacks against web applications and allows for HTTP traffic monitoring, logging and real-time analysis. With over 10,000 deployments world-wide, ModSecurity is the most widely deployed WAF in existence.

 

Install

Using the package manager

apt-get -y install libapache-mod-security

Configure

These are some directories that are needed by ModSecurity to work properly. Run all these commands before continuing:

chown www-data.www-data /var/asl/data/msa
chown www-data.www-data /var/asl/data/audit
chown www-data.www-data /var/asl/data/suspicious
chmod o-rx -R /var/asl/data/*
chmod ug+rwx -R /var/asl/data/* 
mkdir /var/asl/updates
mkdir /var/asl/rules/
mkdir /var/asl/rules/clamav

Initial setup

Create a new File

vi /etc/apache2/conf.d/00_modsecurity.conf

And put inside

<ifmodule mod_security2.c>
Include /etc/apache2/modsecurity.d/modsecurity_crs_10_config.conf
</ifmodule>

Then create new directory that will contains mod security rules

mkdir /etc/apache2/modsecurity.d/
vi /etc/apache2/modsecurity.d/modsecurity_crs_10_config.conf

Content of file modsecurity_crs_10_config.conf

Some default values to hide the server name and signature

 ServerTokens Prod
 ServerSignature Off
 TraceEnable Off

 SecRuleEngine On
 SecRequestBodyAccess On
 SecResponseBodyAccess On
 SecResponseBodyMimeType (null) text/html text/plain text/xml
 SecResponseBodyLimit 2621440
 SecServerSignature Apache
 SecComponentSignature 200911012341
 SecUploadDir /var/asl/data/suspicious
 SecUploadKeepFiles Off
 SecAuditEngine RelevantOnly
 SecAuditLogRelevantStatus "^(?:5|4(?!04))"
 SecAuditLogType Concurrent
 SecAuditLog logs/audit_log
 SecAuditLogParts ABIFHZ
 SecArgumentSeparator "&"
 SecCookieFormat 0
 SecRequestBodyInMemoryLimit 131072
 SecDataDir /var/asl/data/msa
 SecTmpDir /tmp
 SecAuditLogStorageDir /var/asl/data/audit
 SecResponseBodyLimitAction ProcessPartial

 Include /etc/apache2/modsecurity.d/gotroot/*asl*.conf

Getting Initial set of rules from Gotroot

Run these commands to install the latest free but delayed set of ModSecurity Rules from GotRoot.com

The last command restart apache,

cd /etc/apache2/modsecurity.d/gotroot
wget http://updates.atomicorp.com/channels/rules/delayed/modsec-2.5-free-latest.tar.gz
tar zxvf modsec-2.5-free-latest.tar.gz
mv modsec/* .
/etc/init.d/apache2 restart

Watch your logs to see if you have some warning/error like these. This is confirming that ModSecurity is working as expected

[Mon Feb 28 20:52:45 2011] [error] [client 195.8.45.152] 
ModSecurity: Warning. CC# match "\\d{13,16}" at RESPONSE_BODY.
[offset "15816"] [file "/etc/apache2/modsecurity.d/gotroot/11_asl_data_loss.conf"]
[line "33"] [id "340838"] [rev "2"]
[msg "Atomicorp.com - FREE UNSUPPORTED DELAYED FEED - WAF Rules:
Potential credit card number detected in output (not blocked)"]

You can always get new rules by visiting http://updates.atomicorp.com/channels/rules/delayed/

Donations

Thank You for supporting my work