Saturday, March 15, 2014

Installing Dradis on Ubuntu

This is my way to install dradis-framework
The bold red is additional from other website.
Combination manual from http://guides.dradisframework.org/install_on_ubuntu.html

1 Running on Ubuntu

We are going to assume that either Ubuntu is your base OS or you are preparing an Ubuntu-base virtual machine.
If the latter going for 10 GB of disk and 2 GB of RAM should do the trick. You can download Ubuntu from:
A tutorial on how to install the base OS falls out of the scope of this guide, we will leave you a few minutes to get your new OS up and running.

2 Prerequisites: curl and git

Before we begin, there are a couple of packages that we will need:
etd@host:~$ sudo apt-get install curl git

Ubuntu / Debian 

http://nokogiri.org/tutorials/installing_nokogiri.html

Ubuntu doesn’t come with the Ruby development packages that are required for building gems with C extensions. Here are the commands to install everything you might need:
# ruby developer packages
sudo apt-get install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8
sudo apt-get install libreadline-ruby1.8 libruby1.8 libopenssl-ruby

# nokogiri requirements
sudo apt-get install libxslt-dev libxml2-dev
sudo gem install nokogiri

3 Installing Ruby 1.9.3

We are going to install Ruby 1.9.3 using RVM. This has the benefit of keeping everything under your `~/.rvm/` folder:
etd@host:~$ source ~/.profile
etd@host:~$ rvm -v
Once RVM is up and running we need to get a couple of libraries that will be required by the Ruby installation:
etd@host:~$ for package in zlib openssl libxslt libxml2; do rvm pkg install $package; done
And finally the Ruby 1.9.3 runtime:
etd@host:~$ rvm install 1.9.3
etd@host:~$ rvm 1.9.3 --default
etd@host:~$ ruby -v
There is an additional step that it’s not required but that will shorten the time required to install ruby gems:
etd@host:~$ echo "gem: --no-rdoc --no-ri" > ~/.gemrc
This tells RubyGems to not generate documentation for every library it installs.
Finally, we just need to install the Bundler gem, all other Ruby gems will be installed using Bundler:
etd@host:~$ gem install bundler
etd@host:~$ bundle -v

4 Download Dradis

We are going to work with the Git version of Dradis which is stable but contains the latest and greatest features:
etd@host:~$ mkdir dradis-git
etd@host:~$ cd dradis-git/
etd@host:~/dradis-git$ git clone https://github.com/dradis/dradisframework.git server
etd@host:~/dradis-git$ for file in verify reset start; do curl -O https://raw.github.com/dradis/meta/master/$file.sh; done
etd@host:~/dradis-git$ chmod +x *.sh
To make sure it everything is as it should, double check the contents of the directory:
etd@host:~/dradis-git$ ls -l
total 32
-rwxr-xr-x   1 etd  staff   847 Feb 19 14:26 reset.sh*
drwxr-xr-x  26 etd  staff   884 Feb 19 14:02 server/
-rwxr-xr-x   1 etd  staff   407 Feb 19 14:26 start.sh*
-rwxr-xr-x   1 etd  staff  6775 Feb 19 14:26 verify.sh*
We are going to create a gemset to store all the Ruby gems that Dradis requires in a self-contained package. This means that the libraries won’t affect any other apps you have installed. Also if you decide to remove Dradis, you can delete this gemset and cleanup the system.
To activate the gemset just enter the `server/` directory and answer yes when RVM asks:
etd@host:~/dradis-git$ cd server/
Do you wish to trust this .rvmrc file? (/home/etd/dradis-git/server/.rvmrc)
y[es], n[o], v[iew], c[ancel]> y
Using /home/etd/.rvm/gems/ruby-1.9.3-p125 with gemset dradis
etd@host:~/dradis-git/server$ cd ..
Once you have your copy of the repo, we need to install a few Ruby dependencies:

5 Preparing Dradis

Before you can start the server you need to run ./reset.sh this will prepare the config files for first use and will re-generate the repository database.
etd@host:~/dradis-git$ ./reset.sh
Some Ruby gems are missing, do you want to install them now? [y] y
This will install the libraries that are required to run Dradis. Once that’s is done, we need to run the script again:
etd@host:~/dradis-git$ ./reset.sh
The config file [config/database.yml.template] was found not to be ready to use.
Do you want to initialize it? [y]es | [N]o | initialize [a]ll
a
If you ever want to clear your repository (e.g. a new project begins), re-runing the command above will do the trick.
The final step is to make sure all the assets (i.e. images, JavaScripts, CSS, etc.) that Dradis needs are precompiled to ensure they load at maximum speed:
etd@host:~/dradis-git$ cd server/
etd@host:~/dradis-git/server$ RAILS_ENV=production bundle exec rake assets:precompile
etd@host:~/dradis-git/server$ cd ../

6 Running Dradis

Once everything is ready, you can run the server with:
etd@host:~/dradis-git$ ./start.sh
You are ready to browse: https://127.0.0.1:3004/
The script also accepts the -h flag to help you with additional arguments to customize the binding address and port number.
For instance to bind to port 443 and listen in all interfaces you can run:
etd@host:~/dradis-git$ ./start.sh -b 0.0.0.0 -p 443

Monday, July 1, 2013

Pemasangan Server Glassfish Versi Opensource

So dalam kes aku ni , aku mengalakkan korang install fresh Ubuntu , cuma ada ssh server je , gui atau komponen server lain korang tauk buang (letak tepi) bak kata org utara. Hehehehe ...

So lepas korang install fresh Ubuntu 12.04 LTS kena wat

sudo apt-get update
sudo apt-get upgrade

 Lepas tu install plak JDK , skang ni JAVA 7

sudo apt-get install openjdk-7-jdk
javac -version

 Untuk security kita create user glassfish dan group glassfishadmin

#tambah user baru -> glassfish

sudo adduser --home /home/glassfish --system --shell /bin/bash glassfish

#tambah group baru -> glassfish administration

sudo groupadd glassfishadm

#tambah user skang kepada Glassfish adminstrators

sudo usermod -a -G glassfishadm $myAdminUser <- anda="" p="" username="">
#kalau nak padam group pada masa akan datang (ignore warnings):

#delgroup glassfishadm

Download dan install glassfish

#if you dont't have "unzip" installed run this here first
sudo apt-get install unzip
#now switch user to the glassfish user we created (see step 1)
sudo su glassfish
#change to home dir of glassfish
cd /home/glassfish/
#create new directory if not already available
mkdir downloads
#go to the directory we created
cd /home/glassfish/downloads/


#download Glassfish and unzip *latest g nengok kat https://glassfish.java.net/download.html

wget http://download.java.net/glassfish/4.0/release/glassfish-4.0.zip
unzip glassfish-4.0.zip
#move the relevant content to home directory
mv /home/glassfish/downloads/glassfish4/* /home/glassfish/

#if something has not been moved, then move it manually, i.e.:
mv /home/glassfish/downloads/glassfish4/.org.opensolaris,pkg /home/glassfish/.org.opensolaris,pkg
#exit from glassfish user
exit
#change group of glassfish home directory to glassfishadm
sudo chgrp -R glassfishadm /home/glassfish
#just to make sure: change owner of glassfish home directory to glassfish
sudo chown -R glassfish /home/glassfish
#make sure the relevant files are executable/modifyable/readable for owner and group
sudo chmod -R ug+rwx /home/glassfish/bin/
sudo chmod -R ug+rwx /home/glassfish/glassfish/bin/
#others are not allowed to execute/modify/read them
sudo chmod -R o-rwx /home/glassfish/bin/
sudo chmod -R o-rwx /home/glassfish/glassfish/bin/

Skang dah boleh try korangnya SERVER


#now switch user to the glassfish user
sudo su glassfish
#start glassfish
/home/glassfish/bin/asadmin start-domain domain1
#check the output...
#stop glassfish
/home/glassfish/bin/asadmin stop-domain domain1
#check the output...
#exit from glassfish user
exit

 Create init script untuk automatik run glassfish bila reboot

#create and edit file
sudo vi /etc/init.d/glassfish
#(paste the lines below into the file and save it...):
#! /bin/sh
#to prevent some possible problems
export AS_JAVA=/usr/lib/jvm/java-6-sun
GLASSFISHPATH=/home/glassfish/bin
case "$1" in
start)
echo "starting glassfish from $GLASSFISHPATH"
sudo -u glassfish $GLASSFISHPATH/asadmin start-domain domain1
;;
restart)
$0 stop
$0 start
;;
stop)
echo "stopping glassfish from $GLASSFISHPATH"
sudo -u glassfish $GLASSFISHPATH/asadmin stop-domain domain1
;;
*)
echo $"usage: $0 {start|stop|restart}"
exit 3
;;
esac
:

Configure autostart

#make the init script file executable
sudo chmod a+x /etc/init.d/glassfish
#configure Glassfish for autostart on ubuntu boot
sudo update-rc.d glassfish defaults
#if apache2 is installed:
#stopping apache2
sudo /etc/init.d/apache2 stop
#removing apache2 from autostart
update-rc.d -f apache2 remove

 Create init script untuk automatik run glassfish bila reboot dan start,stop,restart Glassfish macam selalu dalam Ubuntu

#start
/etc/init.d/glassfish start
#stop
/etc/init.d/glassfish stop
#restart
/etc/init.d/glassfish restart

Last config sebelum akses ke web browser

# the commands here change the file at
# /home/glassfish/glassfish/domains/domain1/config/domain.xml
#first we have to start Glassfish
/home/glassfish/bin/asadmin start-domain domain1
# enable https for remote access to admin console
# requests to http://xxx:4848 are redirected to https://xxx:4848

/home/glassfish/bin/asadmin set server-config.network-config.protocols.protocol.admin-listener.security-enabled=true

/home/glassfish/bin/asadmin enable-secure-admin

Run GLASSfish korang

#starting glassfish

sudo /etc/init.d/glassfish start

Browse GLASSFISH Administration Console

http://localhost:4848

atau

http://ipserver.korang.install:4848






Sunday, June 30, 2013

Youtube Klon Gunakan PhpMotion

Bismillahirahmanirahim, Berjaya juga untuk install youtube klon bagi kegunaan opis aku. Hish susah juga sbb ideanya untuk sediakan satu server bagi simpan semua video tu. Nak simpan kat youtube ada tempat slow sangat. Akhirnya timbul la idea nak wat klon youtube kat dalam intranet opis.

So ini yang aku nak kongsikan bersama

1. Speksifikasi Server

2. Guna Ubuntu 9.04 upgrade to 11.04 sebab server tu dah lama x de apa pn applikasi dalam tu.

3. Install Webmin (web based cpanel percuma - aku suka pakai sebab senang nak install)

cd /tmp
wget http://prdownloads.sourceforge.net/webadmin/webmin-1.610.tar.gz
sudo su
gunzip webmin-1.610.tar.gz
tar xf webmin-1.610.tar
cd webmin-1.610./setup.sh /usr/local/webmin

4. Aku mencari dalam google , akhirnya bertemu dengan phpmotion so aku google lagi nak cari cari yg simple dan mudah untuk install. Oleh itu kredit kepada 2 website ni yang bantu aku cuba

a. http://erwin-heldy.blogspot.com/2011/09/instalasi-phpmotion-di-ubuntu-1104.html

b. http://aacable.wordpress.com/tag/phpmotion-on-ubuntu/

5. Untuk itu dikongsikan langkah2 aku install phpmotion ni.

sudo su
apt-get update
apt-get install apache2 mysql-server php5 ffmpeg flvtool2 mencoder lame libogg0 php5-ffmpeg php5-curl curl libapache2-mod-php5 php5-mysql lynx-cur libapache2-mod-speedycgi
6. Download phpmotion dari website phpmotion http://www.phpmotion.com/content/view/1/180/ kena register dahulu then baru boleh download. Pada masa aku buat ni ada 2 version jadi sesiapa berminat check dulu version php korang dalam server ubuntu kang silap x jalan plak.

Untuk check korang guna

php -v

Atau kalau korang dah register boleh guna command get untuk download
wget http://www.phpmotion.com/registration/download.php?php_version=53

Atau guna webmin untuk upload kat dalam server dan extract terus kedalam /var/www
7. Apabila dah download korang extract

unzip /home/username_kamu/Downloads/phpmotion.zip
cp -R /home/username_kamu/Downloads/phpmotion /var/www
chown -Rf www-data.www-data /var/www/phpmotion
chmod -Rf 744 /var/www/phpmotion
chmod -Rf 755 /var/www/phpmotion/cgi-bin

8. Bagi tujuan korang nak upload file video ,music dan lain-lain kita perlu reconfigure balik file php.ini
Configuration ini akan benarkan Upload saiz file sampai 100MB tetapi awas perlu diingatkan makin besar makin lambat server nak upload dan process kepada format .flv yang akan digunakan oleh phpmotion untuk streaming kat website korang. So keputusan ditangan korang la ye...

nano /etc/php5/apache2/php.ini
atau
vi /etc/php5/apache2/php.ini

atau gunakan webmin cari "/etc/php5/apache2/php.ini" dan edit gunakan configuration dibawah ni.
open_basedir = (no value)
upload_max_filesize = 1000M
post_max_size = 100M
max_execution_time = 1500
session.gc_maxlifetime = 14000
safe_mode = off
enable_dl = On
dan tambahkan selepas itu:
extension=/var/www/phpmotion/phpshield/Linux_x86-32/ixed.5.3.lin

9. Configure virtual host apache untuk membolehkan page phpmotion dipaparkan mengikut setting dan directory cgi yang diperlukan.


nano /etc/apache2/sites-available/default
atau
vi /etc/apache2/sites-available/default

atau gunakan webmin cari "/etc/apache2/sites-available/default" dan edit gunakan configuration dibawah ni.


Bagi yang ada hosting dan url

ServerName media.nama.url.anda
DocumentRoot /var/www/phpmotion

Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

ScriptAlias /cgi-bin/ /var/www/phpmotion/cgi-bin/


Bagi yang tiak ada hosting dan url


DocumentRoot /var/www/phpmotion

Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

ScriptAlias /cgi-bin/ /var/www/phpmotion/cgi-bin/



Sunday, February 19, 2012

How to make logkeys autostart

Autorun at system start

sudo gedit /etc/init.d/logkeys-start

Paste this in there

#!/bin/bash

sudo logkeys --start --us-keymap

and save it

Run this

sudo su

cd

cd /etc/init.d/

update-rc.d logkeys-start defaults

chmod +x /etc/init.d/logkeys-start

reboot That's it

The log file will be the one that is at

sudo nano /var/log/logkeys.log

Friday, February 17, 2012

Installation Logkeys

1st need to install g++ if you haven't install it.
sudo apt-get install g++    # to install g++ on a Debian-based OS
or
sudo apt-get install build-essential # if previous command fails

Proceed with

$ tar xvzf logkeys-0.1.1a.tar.gz     # to extract the logkeys archive

$ cd logkeys
-0.1.1a/build # move to build directory to build there
$
../configure # invoke configure from parent directory
$ make
# make compiles what it needs to compile
( become superuser now ) # you need root to install in system dir
$ sudo su
$ make install
# installs binaries, manuals and scripts
How to

Create log file by default log file is /var/log/logkeys.log and is not readable by others.

You can set it anyway you like with the command --outputt

But before that you need to create the log file

$ touch /home/"you home directory"/Documents/test.log

Then run the logkeys :

$ logkeys --start -u --output /home/"you home directory"/Documents/test.log

The "-u" use for keymap to US-keymap

to test

$ tail /home/"your directory"/Documents/test.log

How to stop

$ logkeys --kill