Create hudson directory structure
-
cd /usr/share/
-
mkdir hudson
-
chown tomcat6:tomcat6 /usr/share/hudson
-
ls -l 'hudson'
Deploy WAR file
Create hudson directory structure
Deploy WAR file
Download here.
Installed Ubuntu Server 11.04
Performance tool (server then desktop)
Apply Patches
Ability to Search for packages
Application Setup
High availability Ubuntu servers
FTP
SSH should work for most needs (Filezilla), but if FTP is needed
CRONTAB
Helpful info: http://www.codecoffee.com/tipsforlinux/articles/22.html
http://www.makeuseof.com/tag/how-to-analyze-your-disk-usage-pattern-in-linux/
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());
}
}
Two options:
davidq root tomcat6
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
Good QBW PDF — here.
Cheat sheet — here.
Linux for DOS users — here.
# http://www.freeos.com/guides/lsst/
# http://af-design.com/blog/2009/07/07/loading-data-into-bash-variables/
Make it executable:
sudo chmod +x filename
The Command Terminal allows you to control your computer by typing a series of commands in the box.
$ wget \
–recursive \
–no-clobber \
–page-requisites \
–html-extension \
–convert-links \
–restrict-file-names=windows \
–domains website.org \
–no-parent \
www.website.org/tutorials/html/
Info found at: http://www.linuxjournal.com/content/downloading-entire-web-site-wget
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
Install the required packages, running the following command:
apt-get install libapache2-svn subversion subversion-tools
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!
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,
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)
Testing the repository
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).
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
Backups can be restored with the svnadmin‘s load command. To restore a backup:
Open an SSH session to your account.
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.
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>
http://svnbook.red-bean.com/
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.
Setup as HTTP:
http://dongchimi.unfix.net/resources/openBooks/MavenTheDefinitiveGuide/repository.html
To install Apache Maven on Ubuntu OS, you can use the “apt-get” command.
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
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
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:~$
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