Apace/WebDAV for Subversion on OpenSolaris

Posted November 10, 2009 by seanmcgrath
Categories: Uncategorized

 

I have a Solaris Zone running Subversion and wanted to enable WebDAV for the repository.

I couldn’t find a good set of instructions for doing this anywhere, so this is what I put together.

Install Apache

As root…

pkg install SUNWapch22
svcs apache22
svcadm enable apache22

Load the Apache svn modules

cd /etc/apache2/2.2/conf.d

edit modules-32.load
add
LoadModule dav_svn_module libexec/mod_dav_svn.so
LoadModule authz_svn_module libexec/mod_authz_svn.so

cd ..


Edit httpd.conf
Add , assuming your repository is in /svn/repo1. Adjust as needed.

<Location /svn>
DAV svn
SVNPath /svn/repo1
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/2.2/svn-passwd
Require valid-user
</Location>

htpasswd -c /etc/apache2/2.2/svn-passwd sean

svcadm disable apache22
svcadm enable apache22

 

Browse to http://<zone ip address>/svn/repo1

Create an OpenSolaris Zone to Run Subversion

Posted November 7, 2009 by seanmcgrath
Categories: Uncategorized

 

I’ve taken to start using subversion as a repository/version control for my Audio and Video project files. This is how I set it up, using OpenSolaris zones and zfs. There may be better more efficient ways to set it up but this is what worked for me.

We already have OpenSolaris (snv_126) running, and we’ve already created a ZFS filesystem for zones.

sean@neptune2:~# zfs list | grep zones
rpool/zones                            927M  4.87G    22K  /zones
rpool/zones/neptune_zone1              476M  4.87G    22K  /zones/neptune_zone1

Create a new zone

sean@neptune2:~# zonecfg -z svnzone1
svnzone1: No such zone configured
Use ‘create’ to begin configuring a new zone.
zonecfg:svnzone1> create
zonecfg:svnzone1> set zonepath=/zones/svnzone1
zonecfg:svnzone1> add net
zonecfg:svnzone1:net> set address=10.0.1.206
zonecfg:svnzone1:net> set physical=e1000g0
zonecfg:svnzone1:net> end
zonecfg:svnzone1> verify
zonecfg:svnzone1> commit
zonecfg:svnzone1> exit
sean@neptune2:~# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP   
   0 global           running    /                              native   shared
   4 zone1            running    /zones/zone1                   ipkg     shared
   – svnzone1         configured /zones/svnzone1                ipkg     shared

Next, install the zone

sean@neptune2:~# zoneadm -z svnzone1 install
A ZFS file system has been created for this zone.
   Publisher: Using dev (
http://pkg.opensolaris.org/dev/).
       Image: Preparing at /zones/svnzone1/root.
       Cache: Using /var/pkg/download.
Sanity Check: Looking for ‘entire’ incorporation.
  Installing: Core System (output follows)
No updates necessary for this image.
  Installing: Additional Packages (output follows)
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                35/35   3249/3249    19.5/19.5

PHASE                                        ACTIONS
Install Phase                              4284/4284

Boot the zone and login

sean@neptune2:~# zoneadm -z svnzone1 boot
zone ’svnzone1′: WARNING: e1000g0:2: no matching subnet found in netmasks(4): 10.0.1.206; using default of 255.0.0.0.
sean@neptune2:~# zlogin -C svnzone1

Follow the install screens for zone name configuration, etc.

In the global zone, create a filesystem for your user account in the new zone

zfs create rpool/export/home/sean_svnzone1

Give the zone access to the global zone’s /export/home directory so you can create home directories

# zonecfg -z svnzone1
zonecfg:svnzone1> add fs
zonecfg:svnzone1:fs> set dir=/export/home
zonecfg:svnzone1:fs> set special=/export/home
zonecfg:svnzone1:fs> set type=lofs
zonecfg:svnzone1:fs> set options=nodevices
zonecfg:svnzone1:fs> end
zonecfg:svnzone1> commit
zonecfg:svnzone1> exit

Add the following line to the zone’s /etc/auto_home file:
$HOST:/export/home/&

zlogin -C svnzone1
root@svnzone1:~# cat >> /etc/auto_home

Reboot the zone

Create a user for access to the svn repository

useradd sean

Create storage for subversion repositories. Create a zfs filesystem that we can add to the non-global zone so we can create additional filesystems within the zone

sean@neptune2:~# zfs create tank/svnzone1_ds
sean@neptune2:~# zonecfg -z svnzone1
zonecfg:svnzone1> add dataset
zonecfg:svnzone1:dataset> set name=tank/svnzone1_ds
zonecfg:svnzone1:dataset> end
zonecfg:svnzone1> verify
zonecfg:svnzone1> commit
zonecfg:svnzone1> exit

Reboot the zone
sean@neptune2:~# zoneadm -z svnzone1 reboot

Login to svnzone and create and filesystem for subversion.

root@svnzone1:/tank/svnzone1_ds# zfs create tank/svnzone1_ds/svn
root@svnzone1:/tank/svnzone1_ds# zfs list
NAME                            USED  AVAIL  REFER  MOUNTPOINT
rpool                          11.2G  4.45G  83.5K  /rpool
rpool/zones                    1.33G  4.45G    25K  /zones
rpool/zones/svnzone1            435M  4.45G    24K  /zones/svnzone1
rpool/zones/svnzone1/ROOT       435M  4.45G    21K  legacy
rpool/zones/svnzone1/ROOT/zbe   435M  4.45G   435M  legacy
tank                           4.02G  5.76G    24K  /tank
tank/svnzone1_ds                 42K  5.76G    21K  /tank/svnzone1_ds
tank/svnzone1_ds/svn             21K  5.76G    21K  /tank/svnzone1_ds/svn

Change Mountpoints to something a little more logical

root@svnzone1:~# zfs set mountpoint=/zfs tank/svnzone1_ds
root@svnzone1:~# zfs set mountpoint=/svn tank/svnzone1_ds/svn

Install Subversion

root@svnzone1:/# pkg install SUNWsvn

If your user account is having problems accessing its own home directory you may have to make the user the owner

chown -R sean sean_svnzone1

Now give the user (in this case, sean) permission to the /svn directory so the account can create repositories and add, check-in files, etc

root@svnzone1:~# chmod -R A+user:sean:list_directory/read_data/add_file/write_d
ata/add_subdirectory/append_data/write_xattr/execute/write_attributes/write_acl
/write_owner:allow /svn

Now the user can create repositories in subversion

sean@svnzone1:~$ svnadmin create /svn/repo1                                    
sean@svnzone1:~$ svnadmin create /svn/repo1/project1

Then with your subversion client, you can import projects into the repository

tardis:GarageBand sean$ ls
MIDI Out.band My Song.band  project
tardis:GarageBand sean$ svn import project  svn+ssh://sean@10.0.1.206/svn/repo1/project1/
tardis:GarageBand sean$ svn list svn+ssh://sean@10.0.1.206/svn/repo1/project1
garageband.band/
tardis:GarageBand sean$

Using flat files as iSCSI targets in OpenSolaris 2009.06

Posted October 18, 2009 by seanmcgrath
Categories: Uncategorized

I tried using zvols to create iscsi targets (connecting with the globalSAN iscsi initiator on Mac OS X) on OpenSolaris 2009.06, however the performance was terrible. The culprit it turns out is the ZIL log and a “bug” that was fixed in 2009.06.

For more information on that:

http://caurea.org/2009/06/24/macosx-time-machine-meets-zfs-iscsi/

and here

http://www.abisen.com/blog/?p=76

You can disable the ZIL,but that’s a bad idea.

Then I saw this suggestion to use flat files as the iscsi target.

http://opensolaris.org/jive/thread.jspa?messageID=417269

Obviously it is required that the iscsitgt service is installed and enabled.

Once the iscstgt service is running, enable Fast Writes

iscsitadm modify admin -f enable

Restart the iscsitgt service

svcadm disable system/iscsitgt:default

svcadm enable system/iscsitgt:default

Create a storage area for iscsi backing storage

On my storage server I  have a 1TB storage pool:

pool: saturnpool1

state: ONLINE

scrub: none requested

config:

NAME        STATE     READ WRITE CKSUM

saturnpool1  ONLINE       0     0     0

raidz1    ONLINE       0     0     0

c4t0d0  ONLINE       0     0     0

c7t0d0  ONLINE       0     0     0

errors: No known data errors

Now we’ll create a zfs filesystem for the iscsi backing storage files

zfs create saturnpool1/iscsi-storage

admin@saturn:~# zfs list | grep iscsi

saturnpool1/iscsi-storage       19K  42.8G    19K  /saturnpool1/iscsi-storage

admin@saturn:~#

Now we’ll create a iscsi target and backing storage file. I chose 10GB as a test, but it can be any size.

iscsitadm create target -z 10g -b /saturnpool1/iscsi-storage/iscsi-lun0 iscsi-lun0

We can look at the target we just created

admin@saturn:~# iscsitadm list target -v

Target: iscsi-lun0

iSCSI Name: iqn.1986-03.com.sun:02:35713027-5671-46c4-b702-b4f5888e9250.iscsi-lun0

Connections: 0

ACL list:

TPGT list:

LUN information:

LUN: 0

GUID: 600144f04adb8c8900001b21228c6400

VID: SUN

PID: SOLARIS

Type: disk

Size:   10G

Backing store: /saturnpool1/iscsi-storage/iscsi-lun0

Status: online

admin@saturn:~#

Set the max receive size to to 2MB. This boosts performance by a factor of almost 10.

iscsitadm modify target –maxrecv 2097152 iscsi-lun0

For the globalSAN initiator on Mac OS X you’ll probably have to wait while iscistgt zeroes out the file (On WIndows 7 it seems to be available immediately).

Note: iscsitgt uses mmap which may crash the host on large files.

You can avoid this by enabling thin provisioning

svccfg -siscsitgt setprop iscsitgt/thin-provisioning = boolean: true

I haven’t tried that yet.

[UPDATE] I turned on the thin provisioning. Made a huge difference in how long it takes for the target to be available to OS X. I attached an old SAMSUNG 160GB drive. Created a 100G flat file and made it an iSCSI target. Currently testing it with Time Machine.

YouTube – Wacky Adventures of Ronald McDonald: Grimace Island (1/4)

Posted August 19, 2009 by seanmcgrath
Categories: Uncategorized

Rumored Apple event roulette wheel lands on September 9 – Ars Technica

Posted August 19, 2009 by seanmcgrath
Categories: Mac

Archive files to G-Mail

Posted November 22, 2008 by seanmcgrath
Categories: Uncategorized

Was looking to move a whole bunch of old files that I was tired of carrying around to G-Mail. I tried gdisk, gdrive, didn´t work. Then I found Gspace a firefox extension that looks like an FTP client and allows you to upload bunches of files to g-mail. Add a filter to label and keep out of the Inbox and you got a stew going.

http://www.getgspace.com/

Box.net iPhone App Update

Posted November 21, 2008 by seanmcgrath
Categories: Uncategorized

The Box.net app no longer requires the 2nd Generation iPod Touch. What took them so long to fix it?

Goodbye Mac Mini

Posted May 25, 2008 by seanmcgrath
Categories: Mac

I had one of the original G4 Mac Mini’s, and by original I mean I ordered it the day it was announced. It was my first Mac. Sadly, yesterday it died quite suddenly. I got the dreaded “disk0s31 I/O error” in the console which is a fancy way of saying “hard drive dying”. Fortunately with my syncing strategies and external drives holding the important stuff I didn’t lose anything. I tried running Disk Utility from the Leopard DVD but it kernel panicked (not a good sign). Then I couldn’t eject the DVD even using “eject CD” in Open Firmware–also not a good sign–so I think it’s problem was more than just a bad hard-drive. After over 3 years of non-stop service and pushing it to do things way beyond its capabilities, I’m not going to complain. As a result, it looks like I’m finally going Intel.

Stream iTunes to iPhone/iPod Touch with Personal Web Sharing

Posted February 28, 2008 by seanmcgrath
Categories: Uncategorized

Since it is equipped with WiFi, it occurs to me that it would be great if iTunes could stream to the iPod touch just as it does on the Apple TV. Sometimes I’m in bed and want to listen to an AudioBook or watch a Movie/TV Show I don’t have synced to my iPod Touch. With a little bit of work, you can with Personal Web Sharing since the iPod Touch has the Safari Browser and embedded Quicktime Player.

 

1. Turn on Personal Web Sharing: System Preferences –> Sharing

 

2. If it doesn’t already exist, create the following file /etc/apache2/users/<your username>.conf. If it does already exist, make it look like this:

<Directory “/Users/username/Sites/”>

Options Indexes MultiViews FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

</Directory>

 

Note: You will need to edit in either nano via the Terminal.

sudo nano username.conf

 

Or edit a copy and copy it back

 

sudo cp new_username.conf /etc/apache2/users/username.conf

 

If you create the file or copy over it, you will need to set the permissions:

sudo chown root:wheel /etc/apache2/users/username.conf

 

Restart Person Web Sharing by turning it off and on again.

 

3. Create a symbolic link in your Sites Directory (/Users/yourname/Sites) to your iTunes Music Files (Typically /Users/yourname/Music/iTunes\ Library/iTunes\ Music\ or folder inside iTunes Library (e.g. Movies)

 

The easiest way to do this is in Terminal:

ln -s /Path/to/iTunes /Users/yourname/Sites/itunes

 

Once that’s done you should be able to hit the iTunes Library folder via a web browser

 

http://your-macs-address/~yourname/itunes

 

..and you should see a directory listing. Browse the folders. Select a file and it should start playing.

 

For extra credit, I am going to try installing iTunesFS with MacFuse and point the symlink to the mounted iTunesFS so I can browse Libraries and Playlists as if in iTunes.

 

Cat in Christmas Tree

Posted December 10, 2007 by seanmcgrath
Categories: Uncategorized

Cat in Christmas Tree, originally uploaded by seanjmcg.

I’m sure there’s a great LOL Cats joke that I can’t think of right now.