Ubuntu Hudson

Create hudson directory structure

  • cd /usr/share/
  • mkdir hudson
  • chown tomcat6:tomcat6 /usr/share/hudson
  • ls -l 'hudson'

Deploy WAR file

— Ubuntu Server Setup —

Download here.

Installed Ubuntu Server 11.04

  • openSSH, if not from Install click here.
  • NSF NetWork File Share, (Linux/UNIX only, click here).
  • Samba File Share, (If windows needs access, click here).

Performance tool (server then desktop)

  • $ sudo apt-get install nmon –> here.
  • $ sudo apt-get install htop –> here.
  • Xosview –> here.

Apply Patches

Ability to Search for packages

  • sudo apt-get install aptitude
  • sudo aptitude search <package part>

Application Setup

High availability Ubuntu servers

FTP

SSH should work for most needs (Filezilla), but if FTP is needed

CRONTAB

  • here.
  • Setup backups
  • Clean scripts
  • etc….

Disk Usage

Helpful info: http://www.codecoffee.com/tipsforlinux/articles/22.html

http://www.makeuseof.com/tag/how-to-analyze-your-disk-usage-pattern-in-linux/

http://www.google.com/#sclient=psy&hl=en&source=hp&q=linux+disk+usage&aq=1&aqi=g5&aql=&oq=linux+disk+&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=ae988db1847db761&biw=1280&bih=872

Command line

If you are geeky enough, the easiest and fastest way is to use the ‘df’ command in your terminal. Simply type

$ df -h

in the terminal and it will show the disk usage percentage of your hard disk.

$ du -a -m /app 2>/dev/null | egrep '.*[123456789]{3}\.[123456789]{2}.*/.*' | less
output
118.69 /app/Apache22/0/logs
162.93 /app/Apache22/0
162.93 /app/Apache22
114.83 /app/Tomcat55/0/reference
367.62 /app/Tomcat55/0
367.62 /app/Tomcat55
114.82 /app/vpc/activemq-4.1.1/activemq-data
136.45 /app/vpc/activemq-4.1.1
4894.78 /app/vpc/event-normalizer-service/nohup.out
739.71 /app/vpc/sxg-event-normalizer-service-delete-me/lib
739.71 /app/vpc/sxg-event-normalizer-service-delete-me
6612.81 /app

Java 7 provicdes a solution:

http://stackoverflow.com/questions/1051295/how-to-find-how-much-disk-space-is-left-using-java

NumberFormat nf = NumberFormat.getNumberInstance();
for (Path root : FileSystems.getDefault().getRootDirectories())
{
System.out.print(root + ": ");

try
{
FileStore store = Files.getFileStore(root);
System.out.println("available=" + nf.format(store.getUsableSpace()) + ", total=" + nf.format(store.getTotalSpace()));
}
catch (FileSystemException e)
{
System.out.println("error querying space: " + e.toString());
}
}

Active Users

Two options:

  • users

davidq root tomcat6

  • w

12:51:40 up 3 days, 20:49, 3 users, load average: 0.00, 0.05, 0.08
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 10.129.42.213 12:51 0.00s 0.02s 0.00s w
davidq pts/1 172.29.255.151 11:43 48:14 1:13 0.03s bash
tomcat6 pts/2 172.29.255.151 11:50 39:28 0.07s 0.06s bash

Change Hostname

The Command Terminal allows you to control your computer by typing a series of commands in the box.

  • into the command terminal
    • $ sudo pico /etc/hostname
  • Enter your administrative password
  • A window will open titled hostname (/etc) – pico. Replace your system's current name with the new one.
  • Select Save from the tool panel at the top of the window.
    • $ sudo pico /etc/hostname
  • change host name for 127.0.0.1
  • Select Save from the tool panel at the top of the window.
  • Close the Command Terminal.
  • Restart your system. -> here

Subversion

Subversion

Patch the system:

pico /etc/apt/sources.list
deb http://ro.archive.ubuntu.com/ubuntu hoary universedeb-src http://ro.archive.ubuntu.com/ubuntu hoary universe
Installing

Install the required packages, running the following command:

apt-get install libapache2-svn subversion subversion-tools

Creating your repository

Run as root:

cd /home
mkdir /home/svn
chown www-data:tomcat6 /home/svn
su www-data -c "svnadmin create /home/svn/src"

Your repository will live in /home/svn/src.

Note that if you let your users run things as www-data (eg. they can install CGI applications) they will be able to write to your repository!

Configure Apache

Become root again and add the following lines to our apache configuration (ssl), inside of the VirtualHost declaration.


$pico /etc/apache2/mods-enabled/dav_svn.conf

<Location /svn/src>
DAV svn
SVNPath /home/svn/src
AuthType Basic
AuthName "QBW Subversion Repository"
AuthUserFile /home/svn/.dav_svn.passwd
Require valid-user
</Location>

If you don't want to use passwords for read-only access, use this instead of the Require valid-user line:

  <LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
  </LimitExcept>

Once you've applied these changes,

  • Restart apache2 /etc/init.d/apache2 restart
  • Create some users

    Add an user with the following command:

    su www-data -c "htpasswd -c -m /home/svn/.dav_svn.passwd user"
    

    The -c is only required the first time you run this command, in order to create the passwords' file. Subsequent runs won't require it:

    su www-data -c "htpasswd -m /home/svn/.dav_svn.passwd user"
    

    Note that the passwd file does not need to be created as www-data. It can be created as root, for example. However, it must be visible by www-data.

    In the meantime htpasswd had changed – htpasswd will do it (apache2 – Version: 2.2.4-1 on Debian apache2-utils_2.2.4-1_i386.deb)

    Using your browser. Load https://hostname/svn/src/ in your browser. Replace hostname with your host name or ip. You will get something like:

    Revision 0: /Powered by Subversion version 1.1.3 (r12730).
    

    Import your initial data:

    svn --username user import src https://localhost/svn/src -m "initial import"Authentication realm: <https://localhost:443> My Subversion RepositoryPassword for 'user':Adding         src/checkersAdding         src/checkers/trunkAdding         src/checkers/trunk/gendelta.plAdding         src/checkers/siteAdding         src/checkers/branchesAdding         src/checkers/tags
    
    Committed revision 1.
    

    Now load your URL in your browser again and make sure you can browse what you imported:

    - checkers/Powered by Subversion version 1.1.3 (r12730).
    

    backup/restore repository

    sudo su
    

    backup repo

    $ svnadmin dump /media/shares/svn > /media/backup/svn.dump
    
    WIN CMD: svnadmin dump d:\QBW_Subversion\repository > d:\QBW_Subversion\svn.dump
    

    create a new repo

    mkdir src2
    
    chown www-data:tomcat6 src2
    
    svnadmin create /home/svn/src2
    

    restore to a new repo

    svnadmin load --force-uuid /home/svn/src2 < /var/svn.dump
    
    mv /home/svn/src /home/svn/src_old
    
    mv /home/svn/src2 /home/svn/src
    

    Restoring from Backups (svn.qbytesworld.info) webfactions

    Backups can be restored with the svnadmin‘s load command. To restore a backup:

    1. Open an SSH session to your account.

    2. Switch to the directory of a new Subversion application. Entercd ~/webapps/svn, where svn is the name of the Subversion application as it appears in the control panel, and press Enter.

    3. Enter svnadmin load . < dump_file where dump_file is the path to the backup, and press Enter.

    Note

    To prevent your restoration from being stopped for excessive processor utilization (particularly for repositories with many commits or a large total file size), prefix the svnadmin command with the nice command for deference to other processes:

    nice -n 19 svnadmin load . < dump_file

    MVN setup???


    Alias /maven/ "/home/davidq/"
    
    <Location /home/davidq>
    
      AuthType Basic
    
      AuthName "QBW Maven Repository"
    
      AuthUserFile /home/svn/.dav_svn.passwd
    
      Require valid-user
    
      SSLRequireSSL
    
    </Location>
    

    SVN BOOK

    http://svnbook.red-bean.com/
    

    Setup OpenSSH Server on Ubuntu Linux

    This is only needed if you did not install as part of setup.

    Run this command from a terminal window:

    $ sudo apt-get install ssh

    To test that it’s working, you can try to ssh into your own machine:

    > ssh localhost

    The authenticity of host ‘localhost (127.0.0.1)’ can’t be established.
    RSA key fingerprint is 98:8a:b8:b2:9e:8a:84:e0:d4:08:27:fb:74:f0:de:d4.
    Are you sure you want to continue connecting (yes/no)?

    Looks like it’s working! Naturally our ssh client doesn’t have the key for the server, since we just installed it. You can type yes to continue or just hit Ctrl-C to stop.

    How to install Maven on Ubuntu

    Setup as HTTP:

    http://dongchimi.unfix.net/resources/openBooks/MavenTheDefinitiveGuide/repository.html

    http://www.google.com/#sclient=psy&hl=en&source=hp&q=setup+inhouse+maven+repository&aq=f&aqi=&aql=&oq=&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=f0ab8257b6a47f59&biw=1536&bih=804

    To install Apache Maven on Ubuntu OS, you can use the “apt-get” command.

    1. Search Maven package – apt-cache search

    Search the Maven package in Ubuntu with apt command – apt-cache search maven

    ~$ apt-cache search maven....maven-ant-helper - helper scripts for building Maven components with antmaven2 - Java software project management and comprehension tool
    
    
    

    2. Install it – apt-get install

    Install Maven with command – sudo apt-get install maven2. Apt will configured Maven for you automatically.
    
    ~$ sudo apt-get install maven22 upgraded, 87 newly installed, 0 to remove and 263 not upgraded.Need to get 97.2MB of archives.After this operation, 271MB of additional disk space will be used.Do you want to continue [Y/n]? y....download many packages, patient
    

    3. Verification

    Type “mvn -version” to verify your installation.
    
    mkyong@mkyong-desktop:~$ mvn -versionMaven version: 2.0.9Java version: 1.6.0_0OS name: "linux" version: "2.6.28-11-generic" arch: "i386" Family: "unix"mkyong@mkyong-desktop:~$
    

    4. Done

    If you see the above message, the Apache Maven is installed successfully.
    
     Where Maven installed?
    The Apt-get installation will install all the Maven required files in the following folder structure
    

    /usr/bin/mvn/usr/share/maven2//etc/maven2

    P.S The Maven configuration is store in /etc/maven2


    Tag Cloud