Saturday, May 1, 2010

Configure Windows XP Professional to be a VPN server

SkyHi @ Saturday, May 01, 2010

For the Small Office/Home Office (SOHO), Windows XP Professional VPN features are a real boon.

Traveling users with laptops or handheld computers will inevitably want files on the home network; you just can't bring everything with you. This is where the beauty of the Windows XP Professional computer connected to an always-on connection, such as DSL or cable modem, shines. That always-on link can be used to accept incoming VPN connections and allow your mobile users to access shared folders and files on your private network.


In this article, I’ll explain how to configure a Windows XP Professional computer to accept incoming VPN connections and discuss some tips on improving the remote access experience for the VPN client computer user.


Windows XP’s all-in-one VPN solution

Windows XP Professional is designed as the one-stop solution for the SOHO, taking all the usability features available to Windows Me users and adding the powerful networking features available in Windows 2000. The combination lets you create the ideal remote access solution for the SOHO.


The Windows XP Professional remote access server capabilities are very similar to those available in Windows 2000 Professional. A Windows XP computer can accept a single incoming connection on each interface that can accept a connection. For example, a Windows XP machine can accept incoming connections on each of the following interfaces:



  • Dial-up modem serial interface

  • Infrared interface

  • Parallel port interface

  • VPN interface




  • While it’s unlikely, a Windows XP Professional machine with the above configuration could conceivably accept up to four simultaneous RAS connections. However, the typical configuration consists of a single RAS client connection, either through a dial-up modem interface or a VPN interface.


    Create an incoming connection with the New Connection Wizard

    Like Windows 2000 Professional, Windows XP Professional includes a New Connection Wizard. I’ll show you how to use the New Connection Wizard to create the new VPN server interface. In this example, I’ll assume the Windows XP Professional machine is not a member of a Windows NT 4.0 or Windows 2000 domain. The machine has two network interface cards; one is directly connected to the Internet, and the other is connected to the internal LAN. In addition, the external interface of the machine is configured for Internet Connection Sharing (ICS). While ICS changes the IP address of the LAN interface of the ICS computer to 192.168.0.1 through 16, it's easy to change the IP address to one that fits the existing network environment. The IP address of the LAN interface of the ICS computer was changed to 10.0.0.1 through 24 to fix the preexisting network configuration.


    How to create the VPN server interface, step-by-step


    1. Click Start | Control Panel.

    2. In the Control Panel, open the Network Connections applet.

    3. In the Network Connections window (see Figure A), open the New Connection Wizard.


    Figure A




    The Network Connections window



    4. On the Welcome To The New Connection Wizard page, click Next.

    5. On the Network Connection Type page (see Figure B), select the Set Up An Advanced Connection option.



    Figure B






    On the Advanced Connection Options page (see Figure C), select the Accept Incoming Connections option and click Next.



    Figure C




    Configuring XP to accept incoming connections



    7. On the Devices For Incoming Connections page (see Figure D), you can select optional devices on which you want to accept incoming connections.



    Figure D




    Note that you are not presented with any of the network interfaces on the computer.



    8. On the Incoming Virtual Private Network (VPN) Connection page (see Figure E), select the Allow Virtual Private Connections option and click Next.


    Figure E






    9. On the User Permissions page (see Figure F), select the users that are allowed to make incoming VPN connections. Click Next.


    Figure F




    Any user that isn’t selected won’t be able to initiate an incoming connection.



    10. On the Networking Software page (see Figure G), click on the Internet Protocol (TCP/IP) entry and click the Properties button.



    Figure G




    Configuring TCP/IP properties



    11. In the Incoming TCP/IP Properties dialog box (see Figure H), place a check mark in the Allow Callers To Access My Local Area Network check box. This will allow VPN callers to connect to other computers on the LAN. If this check box isn’t selected, VPN callers will only be able to connect to resources on the Windows XP VPN server itself. Click OK to return to the Networking Software page and then click Next.


    Figure H




    Granting LAN access to callers



    12. On the Completing The New Connection Wizard page, click Finish to create the connection.


    After the Incoming Connection is complete, right-click on the connection in the
    Network Connections window and select the Properties command (see Figure
    I
    ).


    Figure I




    Accessing the properties of the VPN server link


    REFERENCES
    http://www.zdnetasia.com/configure-windows-xp-professional-to-be-a-vpn-server-39050037.htm

    Windows 7 VPN server and client

    SkyHi @ Saturday, May 01, 2010

    Years and years ago before VPN (Virtual Private Network) became a common term for the corporate workforce, Microsoft created PPTP (Point to point Tunneling Protocol). Like VPN, PPTP allows you to securely connect to remote networks such as your home network or your friends/parents PC’s (in the event they need some tech support…).

    Additionally, the nice thing about Microsoft PPTP is you don’t need $10k of dedicated VPN hardware or a Network Admin to set it up. All you need is a PC and 3 minutes to read this groovy How-To Tutorial!

    How To Set Up A Home VPN / PPTP Host Using Windows 7

    1. Click the Windows Start Orb and Type network connections into the search bar. Then Click the Network Connections link.

    open your network connections dialog in windows 7

    2. In the Network Connections window if the File menu isn’t available Hold Alt, then Click New Incoming Connection…

    create a new incoming connection in windows 7

    3. Check which users will be allowed to use the connection, you add a new user if you like. Click Next to continue.

    add a vpn user to your vpn host

    4. Check the box Through the Internet then Click Next.

    image

    5. Select Internet Protocal Version 4 (TCP/IPv4) and then Click Properties. In the Properties window Check the box to Allow callers to access my local area network, and Set Assign IP addresses automatically using DHCP. Now return to the previous window and Click Allow access.

    adjust internet protocal 4 properties and allow callers to access local area network

    6. Voila, the VPN host connection is now created! We’re not done yet though, now we need to make sure that the gateway firewall (router) on your network is routing the internet PPTP traffic to your Windows 7 Box.

    a new vpn connection in windows 7

    7. From your internet browser Type in your Router Network Address. This is usually 192.168.1.1 or 192.168.0.1 by default on most home networks. Once you’ve accessed your router interface, some routers have the option to enable PPTP passthrough as well as other VPN ports. If this option isn’t available for your router, you can adjust this with port forwarding in the next step.

    enable vpn passthrough on your router

    8. If your router doesn’t have a built-in VPN setting, you can manually open your PPTP VPN port. Under Port Range Forwarding Create a New forward. Set the Start to 1723 and the End to 1723. The protocol should be Set to TCP and the IP Address needs to be set to your local network IP address.

    create a port forward for PPTP on port 1723

    Once the firewall rules are setup it will forward all VPN / PPTP traffic to your Windows 7 box. From there your remote computer will be able to access all the network devices on your home network (Other computers, servers, etc…)

    One thing to note – as great as PPTP is, is probably the easier way to access your home network however RDP is limited to remote control only so if your looking to copy files sitting on your home server/PC, using a Home VPN / PPTP is probably the best option.

    REFERENCES

    http://www.howtonetworking.com/VPN/win7vpn1.htm

    http://www.sevenforums.com/tutorials/4517-virtual-private-network-vpn-enable-incoming-vpn-connections.html

    http://www.groovypost.com/howto/microsoft/setup-vpn-pptp-host-on-home-windows-7/


    [How To] Set Up A VPN outgoing Connection in Windows 7

    First of all, please note that this how-to uses the built-in network setup right in Windows 7, so it works the best if VPN server on the other side is also from Windows Server.

    Open up network and sharing center from Control Panel, and choose Set up a new connection or network.

    image

    There are two options in the Connect to a Workplace window. 99% of the time you just need to pick the first option, unless your company only allows you to dial in using a phone line.

    image

    Type in the address in either domain name or IP address, and name the connection in the destination name box. And click Next.

    image

    You can leave all user login info blank if you feel safe that way in the next window. And click Create. You’re all set if you see the next window as below.

    image

    To launch it, simply click the small network icon on the system tray at the bottom right corner, and pick the connection we just created from the popup list, and connect.

    image

    image

    Type in your user name and password, and you are on your way connecting your Windows 7 to your company network.


    REFERENCES

    http://www.windows7hacker.com/index.php/2009/08/how-to-set-up-a-vpn-connection-in-windows-7/



    Configure your Computer to Accept VPN Connections in Windows 7

    Hi friends,


    I know that many people don't know how to Configure there Computer for
    accepting VPN Connections in Windows 7.There are basically two
    connection in Vpn one for Incoming & another for outgoing.

    Following
    are the steps for configuring Incoming VPN Connection in Windows 7


    1. First go to Control Panel and
      open Network and Sharing Center.
    2. Click on Change adapter
      settings.
    3. Press Alt+F and select New Incoming connection
    4. Put
      a check on who you’d like to give access to this computer or you can
      configure a new account by clicking on Add someone,after that click on
      Next.
    5. Put a check mark on Through the Internet. Click on
      Next.
    6. Select the protocols you want to enable for this
      connection. Click on Allow access.
    7. Make a note of the
      Computer name as this will be used by the client to connect to this
      computer and after that Click on Close.


    Following are the steps for configuring Outgoing VPN Connection in
    Windows 7

    1. First go to
      Control Panel and open Network and Sharing Center.
    2. Click on
      Set up a new connection or network.
    3. Select Connect to a
      workplace then click on Next.
    4. Select Use my internet
      connection (VPN).
    5. Type the IP address or computer name where
      you wish to connect and your connection name under the Destination name
      field.
    6. Enter a User name and password that has been granted
      access to the host computer.
    7. For getting connected through
      created VPN connection, you can either right-click on the Network icon
      in the system tray and select Network and Sharing Center or go to
      Control Panel and open Network and Sharing Center, and click on Connect
      to a network.
    8. Now connect VPN Connection windows will
      appears.

    REFERENCES
    http://forums.techarena.in/tips-tweaks/1143104.htm

    Friday, April 30, 2010

    Vim

    SkyHi @ Friday, April 30, 2010
    http://www.tuxfiles.org/linuxhelp/vimcheat.html

    USB drive not being recognized under Linux

    SkyHi @ Friday, April 30, 2010

    In order to access USB drive under Linux you need to load special USB driver and support must be included in running Linux kernel. Try following command one by one to solve your problem:

    Step # 1 : Make sure your external drive detected by system
    Run dmesg command which print or control the kernel ring buffer:

    # dmesg

    OR

    # dmesg | grep รข€“i USB

    Output:

    SLPB PCI0 HUB0 USB0 USB1 USB2 USBE
    usbcore: registered new driver usbfs
    usbcore: registered new driver hub
    USB Universal Host Controller Interface driver v2.3
    uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 1
    hub 1-0:1.0: USB hub found
    uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 2
    hub 2-0:1.0: USB hub found
    uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 3
    usb 1-2: new full speed USB device using uhci_hcd and address 2
    hub 3-0:1.0: USB hub found

    As you see USB support is included in kernel. You can also verify this with following command:

    # lspci -v | grep HCI

    Output:

    0000:00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 02) (prog-if 00 [UHCI])
    0000:00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 02) (prog-if 00 [UHCI])
    0000:00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 02) (prog-if 00 [UHCI])
    0000:00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 02) (prog-if 20 [EHCI])

    Step # 2 : Load USB modules/driver
    If you cannot see your external USB drive in above dmesg output then try to load usb-uhci and usb-ohci modules (driver):

    # modprobe usb-uhci
    # modprobe usb-ohci
    # modprobe usb-storage

    Now again run dmesg:

    # dmesg

    Output:

    usb 4-1: new high speed USB device using ehci_hcd and address 3
    scsi2 : SCSI emulation for USB Mass Storage devices
    usb-storage: device found at 3
    usb-storage: waiting for device to settle before scanning
    Vendor: SAMSUNG Model: SV4002H Rev: 0811
    Type: Direct-Access ANSI SCSI revision: 00
    SCSI device sdb: 78242976 512-byte hdwr sectors (40060 MB)
    sdb: assuming drive cache: write through
    SCSI device sdb: 78242976 512-byte hdwr sectors (40060 MB)
    sdb: assuming drive cache: write through
    sdb: sdb1
    sd 2:0:0:0: Attached scsi disk sdb
    usb-storage: device scan complete

    Step 3 : Use external USB drive
    As you see device sdb assigned to an external USB drive use mount command to mount drive:
    List partitions on /dev/sdb:

    # fdisk -l | grep sdb

    Output:

    Disk /dev/sda doesn't contain a valid partition table
    Disk /dev/sdb: 40.0 GB, 40060403712 bytes
    /dev/sdb1 1 4870 39118243+ c W95 FAT32 (LBA)

    Now mount partition:

    # mount /dev/sdb1 /mnt

    See also:


    REFERENCES
    http://www.cyberciti.biz/faq/usb-drive-not-being-recognized-under-linux/

    Centos Chkconfig The Boot Processes

    SkyHi @ Friday, April 30, 2010

    Unlike other operating systems (Windows) each step of loading a Linux system easily understood.

    Contents

    [hide]

    The Boot Process

    It is also easy to break.

    1. The BIOS loads the Boot Sector (Grub) from Sector 0
    2. The Grub (root line in grub.conf) points to the partition containing the kernel (Linux).
    3. The kernel loads and initializes the devices and runs /sbin/init (process 1)
    4. /sbin/init runs /etc/rc.d/rc.sysinit to initilize devices.
    5. /sbin/init reads /etc/inittab
    6. /etc/rc.d/rc.sysinit run all the scripts int the approach run level directory.


    GRUB

    Grub is the first step in the boot process and has the greatest Oh ---- factor. But it really doesn't have to be a big problem. You may not need to boot from a live CD to fix this. There are three main parts to boot step

    • root
    • kernel
    • initrd

    Try booting and editing each of these lines in GRUB. Purposely make mistakes to learn what errors are produced.

    The TAB key will do auto completions when you are editing a GRUB options.

    Rescure Mode

    Using the first CD to boot into Rescue mode. You can then search for the root file system and mount it to the directory /mnt/sysimage.

      chroot /mnt/sysimage
    grub

    Following this command you need to show grub where to read the grub configuration. If the drive type may have changed, maybe because you changed from IDE to SCSI disks you will need to do a --recheck. Then install grub with the install command.

      grub-install --recheck /dev/hda
    grub-install /dev/hda

    Redhat will ask if you want to mount the root file system. If you say no you will need to mount the root file system your self. Here are the commands to do this with the VMware system.

      mkdir /mnt/root
    mkdir /mnt/root/boot
    mount /dev/md1 /mnt/root
    mount /dev/md0 /mnt/root/boot

    Fixing INITRD Modules

    If the kernel is missing or corrupt you will need to reload it from the install CD.

    If the initrd file is missing you you can also reload it with the kernel.

    Adding missing modules to initrd:

      rm -f /boot/initrd-2.6.20-1.2320.fc5.img
    mkinitrd --preload=xor --preload=raid456 /boot/initrd-2.6.20-1.2320.fc5.img
    2.6.20-1.2320.fc5

    Manually changing initrd:

      mkdir /root/initrd-tmp
    cd /root/initrd-tmp
    cp -a /boot/initrd-2.6.20-1.2320.fc5.img ..
    mv ../initrd-2.6.20-1.2320.fc5.img ../initrd-2.6.20-1.2320.fc5.img.gz
    gunzip ../initrd-2.6.20-1.2320.fc5.img.gz
    cpio -i --make-directories < ../initrd-2.6.20-1.2320.fc5.img
    vi init
    find . -depth | cpio -o > ../initrd-2.6.20-1.2320.fc5.img
    cd ..
    rm -rf initrd-tmp
    gzip -9 initrd-2.6.20-1.2320.fc5.img
    mv initrd-2.6.20-1.2320.fc5.img.gz initrd-2.6.20-1.2320.fc5.img
    mv initrd-2.6.20-1.2320.fc5.img /boot


    SYSINIT


    INITTAB

    The file /etc/inittab controls the runlevel the system boots into.

    You can override this by added the runlevel you want to the end of the kernel line in GRUB.

    id:3:initrdefault:

    Changing the 3 in this line will change the default runlevel to the one you want.


    Runlevels

    Here are the runlevels and what they mean. You should know the by heart too.

    • Run level 1 is single user
    • Run level 2 is Multiuser without NFS
    • Run level 3 is Full Multiuser
    • Run level 4 is unused
    • Run level 5 is X11 windows
    • Run level 6 will reboot the system

    /etc/inittab not only starts rc.sysinit it also starts processes that shouldn't die. One of these is the system console/s. It controls which run level the system automatically boots to. The directory /etc/sysconfig hold config files for process started at this level.

    RC scripts are kept in /etc/rc.d. The program that run the RC scripts is rc.sysinit. These scripts are what is done when you change run level with the init command.

    The fastest to set runlevel services is to use the command 'ntsysv and tell it the runlevels you want to set. For example, this will display and change runlevels 3 and 5.

      ntsysv --level 35

    Image:ntsysv.png

    To turn on or off a RC script you can also use the command:

      chkconfig --level command on/off

    The option --level sets the run level to be change for the command that is turned on or off. This can also be done with the GUI system-config-services.

      chkconfig --list

    This command will list all the services and if they are on or off for each run level.

      chkconfig --add/--del command

    This command will add or delete a new command from the RC start-up scripts.

    After configuring a system like Apache it is easy to forget make it start at boot time. Don't forget to reboot you system before the test is over.

    You can debug the RC process by booting into single user mode and running the RC scripts in the run level by hand. You can also bypass init by adding init=/bin/bash the kernel line in GRUB.


    CLONING or RESTORING a System

    THIS IS NOT NEEDED FOR THE TEST

    Here are some of the issues if you are cloning or restoring a system by copy all the files into empty directories and then restoring the boot process. This process involves creating all the required root directories (/ /etc /usr /bin /var /opt /home) and coping all the files back into place with their ownership and permissions maintained. Directories that are not copied include /tmp /dev /proc /mnt. The directories that are not copied do need to be created.

    • The partitions and/or e2 labels may not be the same. This will require changing /etc/fstab
    • Some directories will/may not be copied. This may include /dev. In witch case mounting the root file system with the chroot command will leave you without any devices.
    • Grub.conf (/etc/grub/grub.conf and menu.lst) may also need editing. Both the root and kernel lines may contain references to the wrong partitions.
    • /etc/mtab needs to be edited to match the new disk. Partition numbers can change and sometimes the type, like from IDE to SCSI (hda to sda).

    After booting into recover mode with the install CD. You will need to mount all of the file systems into their place under /mnt/sysimage. You can them mount the live proc and dev inplace with the command:

      mount -o bind /dev /mnt/sysimage/dev
    mount -o bind /proc /mnt/sysimage/proc

    With the file systems in place you can use the chroot command to create the write environment for fixing the master boot record and Grub.

      chroot /mnt/sysimage


    REFERENCES
    http://linuxfanboy.com/index.php/The_Boot_Processes

    Thursday, April 29, 2010

    tar doesn't compress .hidden files in the same directory it is run in?

    SkyHi @ Thursday, April 29, 2010
    Example Directory Contains:

    .htaccess

    .news

    info.txt

    info.log


    Code:

    tar -cvpzf test.tgz ./*
    ./info.log
    ./info.txt

    What gives, why isn't .htaccess or .news being added to the tar?



    Furthermore if there is a .htaccess file in a subdirectory it is compressed.



    Example Directory Contains:

    .htaccess

    .news

    info.txt

    info.log

    /subdir/.htaccess/


    Code:

    tar -cvpzf test.tgz ./*<br />./info.log<br />./info.txt<br />./subdir/<br />./subdir/.htaccess

    Why is this, how do I work-around?

    Solution:
    Globbing with * does not include hidden files, whereas every file in a
    directory (hidden ones included) are put into the archive. So you can
    simply do


    Code:

    $ tar -cvpzf test.tgz .

    However, you can force the shell to include hidden files in
    globbing, using


    Code:

    $ shopt -s dotglob<br />$ tar -cvpzf test.tgz ./*<br />$ shopt -u dotglob         # to disable the shell option


    REFERENCES
    http://www.linuxquestions.org/questions/linux-newbie-8/tar-doesnt-compress-hidden-files-in-the-same-directory-it-is-run-in-730222/

    Mount LVM partitions from an external hard drive

    SkyHi @ Thursday, April 29, 2010

    Mount LVM partitions from an external hard drive

    Q Is it possible, and if so how, to mount LVM partitions from an external hard drive? I'm thinking of my old Fedora system drive from which I would like to retrieve a single file without having to boot from it.

    A As long as you have the LVM tools installed on the distro you are booting, you can mount LVM partitions from any disk (I even did it from a USB key once). Run

    vgscan
    vgchange -a y

    as root and all the partitions should have devices created in the form /dev/volumegroup/logicalvolume, which you can then mount in the usual way:

    mount /dev/volumegroup/logicalvolume /mnt/somewhere


    REFERENCES
    http://www.tuxradar.com/answers/296

    Mounting a Linux LVM volume on External harddrive

    SkyHi @ Thursday, April 29, 2010
    You do not mount a partition of type "Linux LVM" the same way you mount
    a partition using a standard Linux file system (e.g. ext2, ext3).





    # fdisk -l /dev/hda





    Disk /dev/hda: 160.0 GB, 160041885696 bytes


    255 heads, 63 sectors/track, 19457 cylinders


    Units = cylinders of 16065 * 512 = 8225280 bytes





       Device
    Boot     
    Start        
    End      Blocks   Id  System



    /dev/hda1  
    *          
    1         
    13      104391   83  Linux



    /dev/hda2             
    14       19457  
    156183930   8e  Linux LVM






    # mount /dev/hda2 /tmp/mnt


    mount: /dev/hda2 already mounted or /tmp/mnt busy





    First, let's determine the volume group containing the physical volume /dev/hda2.





    # pvs


     
    PV        
    VG         Fmt  Attr
    PSize   PFree



      /dev/hda2  VolGroup01 lvm2 a-   148.94G 32.00M


      /dev/hdb2  VolGroup00 lvm2 a-   114.94G 96.00M





    Next, let's list the logical volumes in VolGroup01.





    # lvdisplay /dev/VolGroup01


      --- Logical volume ---


      LV Name                /dev/VolGroup01/LogVol00


      VG Name                VolGroup01


      LV
    UUID               
    zOQogm-G8I7-a4WC-T7KI-AhWe-Ex3Y-JVzFcR



      LV Write Access        read/write


      LV Status              available


      # open                 0


      LV Size                146.97 GB


      Current LE             4703


      Segments               1


      Allocation             inherit


      Read ahead sectors     0


      Block device           253:2


      


      --- Logical volume ---


      LV
    Name               
    /dev/VolGroup01/LogVol01



      VG Name                VolGroup01


      LV
    UUID               
    araUBI-4eer-uh5L-Dvnr-3bI6-4gYg-APgYy2



      LV Write Access        read/write


      LV Status              available


      # open                 0


      LV Size                1.94 GB


      Current LE             62


      Segments               1


      Allocation             inherit


      Read ahead sectors     0


      Block device           253:3





    The logical volume I would like to "mount" (in purely the computing-related sense) is /dev/VolGroup01/LogVol00. The other logical volume is a swap partition.





    # mount /dev/VolGroup01/LogVol00 /tmp/mnt

    REFERENCES
    http://www.brandonhutchinson.com/Mounting_a_Linux_LVM_volume.html


    I've not much experience with LVM, but I did have a similar problem to
    you, so here's how I solved it (Ubuntu 7.04 server).



    1. Install lvm2:



    sudo apt-get install lvm2

    sudo cp -r /lib/lvm-200/ /lib/lvm-0



    2. Take note of the LV Name for the volume you want to mount from the
    output of the following command (/dev/VolGroup00/LogVol00 in my case):



    sudo lvdisplay



    3. Run the following commands to mount the logical volume:



    sudo modprobe dm-mod

    sudo vgchange -ay

    sudo mkdir /mnt/old_hd

    sudo mount /dev/VolGroup00/LogVol00 /mnt/old_hd



    Worked for me!

    REFERENCES
    http://ubuntuforums.org/showthread.php?t=428292

    Wednesday, April 28, 2010

    How To Install Subversion with TRAC on CentOS 5.x

    SkyHi @ Wednesday, April 28, 2010

    In this howto i will describe how to install subversion with TRAC. Subversion is an open source version control system alternative to CVS and TRAC an enhanced wiki and issue tracking system for software development projects which provides an interface to Subversion. I install it on CentOS 5.4 which is already running as Web Server. I will use sohailriaz.com source to be maintain by Subversion and TRAC to track all development.


    1) Installation


    To install subversion and trac on CentOS 5.4 we will use dag repositories as it has latest packages (rpms) available for said softwares.


    Red Hat Enterprise Linux / CentOS 5 / i386:


    rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm


    Red Hat Enterprise Linux / CentOS 5 / x86_64:


    rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm


    Now issue yum command to install subversion and trac with pre-requisites.


    yum -y install subversion trac mod_dav_svn mod_python


    where mod-dav_svn and mod_python are apache modules which will be use later on to access subversion and trac.


    2) Configuring Subversion.


    2.1) Creating directories for Subversion.


    mkdir /var/www/svn/svnrepos

    mkdir /var/www/svn/auth


    2.2) User Authentication.


    We will create a user to access SVN repositories


    htpasswd -cb /var/www/svn/auth/svn.htpasswd svnuser1 passw0rd

    Adding password for user svnuser1


    2.3) Create Project Repository.


    Now we will create a Project Repository. It can be user define name. I will choose site-sohailriaz.com name here for my Project Repository.


    svnadmin create /var/www/svn/svnrepos/site-sohailriaz.com


    svn mkdir file:///var/www/svn/svnrepos/site-sohailriaz.com/branches file:///var/www/svn/svnrepos/site-sohailriaz.com/tags file:///var/www/svn/svnrepos/site-sohailriaz.com/trunk -m “Creating directories for initial import”


    Committed revision 1.


    Change ownership and group member to apache (default user for web server)


    chown -R apache:apache /var/www/svn/svnrepos/site-sohailriaz.com/


    Generate configuration for svn to view from website.


    vi /etc/httpd/conf.d/svn.conf


    <Location /svn>

    DAV svn

    SVNListParentPath on

    SVNParentPath /var/www/svn/svnrepos/


    AuthType Basic

    AuthName “SohailRiaz.com Site Repository”

    AuthUserFile /var/www/svn/auth/svn.htpasswd

    Require valid-user

    </Location>


    Start service to take the changes.


    /etc/init.d/httpd restart


    Now browse your site to see the SVN repository.


    http://www.sohailriaz.com/svn/


    It will ask the user/pass you created initially and after successful login you will see your repositories.


    2.4) SVN Import for site files.


    We will use svn import to import files from our site to repository to maintain the code.


    svn import /home/sohail/public_html/ http://www.sohailriaz.com/svn/site-sohailriaz.com/trunk/

    Authentication realm: SohailRiaz.com Site Repository

    Password for ‘root’ : <enter root password>

    Authentication realm: SohailRiaz.com Site Repository

    Username : svnuser1

    Password : passw0rd


    Now browse your site and see the trunk folder, you will see your code listed there.


    2.5) Branches


    If you need to have multiple branches for your site then that is relatively very easy within subversion. All you need to copy from trunk to branches folder with user define name to recognized.


    svn copy http://www.sohailriaz.com/svn/site-sohailriaz.com/trunk/ http://www.sohailriaz.com/svn/site-sohailriaz.com/branches/site-sohailriaz.com-branch-1 -m “1st Branch for Site SohailRiaz.com”


    3) Configure Trac.


    First configure trac instance using trac-admin command for svn repository site-sohailriaz.com


    trac-admin /var/www/trac/site-sohailriaz.com initenv

    Creating a new Trac environment at /var/www/trac/site-sohailriaz.com


    Trac will first ask a few questions about your environment

    in order to initalize and prepare the project database.


    Please enter the name of your project.

    This name will be used in page titles and descriptions.


    Project Name [My Project]> Site SohailRiaz.com


    Please specify the connection string for the database to use.

    By default, a local SQLite database is created in the environment

    directory. It is also possible to use an already existing

    PostgreSQL database (check the Trac documentation for the exact

    connection string syntax).


    Database connection string [sqlite:db/trac.db]> <Enter>


    Please specify the type of version control system,

    By default, it will be svn.


    If you don’t want to use Trac with version control integration,

    choose the default here and don’t specify a repository directory.

    in the next question.


    Repository type [svn]> <Enter>


    Please specify the absolute path to the version control

    repository, or leave it blank to use Trac without a repository.

    You can also set the repository location later.


    Path to repository [/path/to/repos]> /var/www/svn/svnrepos/site-sohailriaz.com


    Please enter location of Trac page templates.

    Default is the location of the site-wide templates installed with Trac.


    Templates directory [/usr/share/trac/templates]> <Enter>

    …………………..

    …………………..

    …………………..

    Congratulation!


    Edit /etc/httpd/conf.d/trac.conf and change /var/trac to /var/www/trac at line starting from PythonOption TracEnvParentDir


    vi /etc/httpd/conf.d/trac.conf


    following line should be like this


    PythonOption TracEnvParentDir /var/www/trac


    Create user account for trac access


    htpasswd -cb /var/www/trac/.htpasswd tracuser1 passw0rd


    Change ownership and group member to apache of trac instances.


    chown -R apache:apache /var/www/trac/site-sohailriaz.com


    Restart webserver to take changes.


    /etc/init.d/httpd restart


    Now browse the site and you will see all available projects under trac and then open the project to browse by viewing source.


    REFERENCES

    http://www.sohailriaz.com/how-to-install-subversion-with-trac-on-centos-5-x/

    Oracle 11g Software Installation on Linux—CentOS-5

    SkyHi @ Wednesday, April 28, 2010

    Introduction

    This paper takes a look at installing Oracle 11g (11.1) on Linux (CentOS-5).You can read about CentOS at www.centos.org and be assured of its' Enterprise-class quality. This paper will use Oracle's Quick Installation Guide for Linux x86 as its' guide—noting where additional information may be obtained but getting Oracle installed on Linux as fast as possible. We at thecheapdba.com have years of experience installing Oracle—starting back with Oracle 7. We will point out best practices so that you end up with a reliable database that provides exceptional performance. We will occasionally re-visit, edit, and post additions to this paper as we find further configuration best practices.

    This paper will not cover the installation of CentOS-5 as that can be acquired through the CentOS website and additional Linux guides. We will however point out those alterations to the Linux environment that pertains to getting Oracle installed.

    Our goal is to provide you with the steps to properly install the Oracle 11g software without having to read Oracle's installation guide from front to back cover. We will provide you the commands to execute (just cut-n-paste) and the desired outcome of those commands. If you get something other than what is expected it would be time for you to re-visit earlier steps in this process. So hold on, here we go.

    It is assumed that the installer of Oracle software has access and is running on an X Window System workstation. Please consult X Server documentation if you need help. We at thecheapdba.com typically will use cygwin ( www.cygwin.com ) for all interfacing with our Linux distribution. It has an X Window System that works quite well—and as we always like is free.

    Checking Hardware Requirements

    Log into the CentOS-5 system as the root user.

    For setting up the system to be used by Oracle there are a few prerequisites that must be checked and possibly changed by the root user. Log in as the root user and this document will tell you when it is time to switch from the root user to someone else.

    How much memory

    command: grep -i memtotal /proc/meminfo

    results: should be at least 1GB

    How much swap

    command: grep -i swaptotal /proc/meminfo

    results: should be 1.5 the size of memtotal if memtotal <>

    should be equal to memtotal if memtotal is between 2GB and 8GB

    should be .75 the size of memtotal if memtotal > 8GB

    What processor type

    command: grep "model name" /proc/cpuinfo

    results: informational

    How much available RAM and swap

    command: free

    results: informational

    How much shared memory available

    command: df -k /dev/shm

    results: informational

    purpose: The shared memory should be sized to be at least the greater of MEMORY_MAX_TARGET and MEMORY_TARGET for each Oracle instance on the computer.

    How much disk space in /tmp

    command: df -k /tmp

    results: should have at least 400MB available

    How much disk space for Oracle binaries

    command: df -k

    results: Depending on installation type you should have between 1.5GB and 3.5GB

    Checking Software Requirements

    What distribution and version of Linux is installed

    command: cat /proc/version

    results: Linux version 2.6.18-8.1.15.el5 (mockbuild@builder6.centos.org)

    (gcc version 4.1.1 20070105 (Red Hat 4.1.1-52))

    #1 SMP Mon Oct 22 08:32:04 EDT 2007

    What version of the kernel is installed

    command: uname -r

    results: 2.6.18-8.1.15.el5

    Are the following packages installed (assumes CentOS-5 and above distribution)

    command:rpm -q binutils \

    compat-libstdc++ \

    elfutils-libelf \

    elfutils-libelf-devel \

    glibc \

    glibc-common \

    glibc-devel \

    glibc-headers \

    gcc \

    gcc-c++ \

    libaio-devel \

    libaio \

    libgcc \

    libstdc++ \

    libstdc++ \

    make \

    sysstat \

    unixODBC \

    unixODBC-devel

    results: you will probably get quite a few packages that are not installed with a typical installation. You can investigate missing packages with the following command making sure you add/subtract from this list if necessary.

    yum list available "compat*" \

    "elfutils*" \

    "glibc*" \

    "gcc*" \

    "libaio*" \

    "sysstat*" \

    "unixODBC*"

    action : Our base installation left us needing to issue the following command to install missing packages.

    yum -y install compat-libstdc++-296.i386 \

    compat-libstdc++-33.i386 \

    elfutils-libelf-devel.i386 \

    glibc-devel.i386 \

    glibc-headers.i386 \

    gcc.i386 \

    gcc-c++.i386 \

    libaio-devel.i386 \

    sysstat.i386 \

    unixODBC.i386 \

    unixODBC-devel.i386

    Create Oracle user and group

    Create groups oinstall & dba

    command: /usr/sbin/groupadd oinstall

    /usr/sbin/groupadd dba

    Create the Oracle and change password

    command: /usr/sbin/useradd -g oinstall -G dba -s /bin/bash oracle

    /usr/bin/passwd oracle

    Validate the nobody user exists

    command: /usr/bin/id nobody

    results: this user is almost always created on a base CentOS installation

    action : if this user is not created use the following command to create

    /usr/sbin/useradd nobody

    Configuring kernel parameters

    The following kernel parameters must be validated and possibly changed. Use the commands given below to view a particular kernel setting and then change if the setting is lower than the recommendation given in the following table.

    You can make the changes by editing the /etc/sysctl.conf file and then rebooting the server. The following results are what we observed on our server and should not be expected on yours.

    shmmni

    4096

    shmall

    2097152

    shmmax

    2147483648

    semmsl

    250

    semmns

    32000

    semopm

    100

    semmni

    128

    file-max

    65536

    ip_local_port_range

    1024 - 65000

    rmem_default

    1048576

    rmem_max

    1048576

    wmem_default

    262144

    wmem_max

    262144

    command: /sbin/sysctl -a | grep kernel.sem

    results: kernel.sem = 250 32000 100 128

    command: /sbin/sysctl -a | grep kernel.shm

    results: kernel.shmmni = 4096

    kernel.shmall = 268435456

    kernel.shmmax = 4294967295

    command: /sbin/sysctl -a | grep file-max

    results: fs.file-max = 102440

    command: /sbin/sysctl -a | grep ip_local_port_range

    results: net.ipv4.ip_local_port_range = 32768 61000

    command: /sbin/sysctl -a | grep rmem_default

    results: net.core.rmem_default = 109568

    command: /sbin/sysctl -a | grep rmem_max

    results: net.core.rmem_max = 131071

    command: /sbin/sysctl -a | grep wmem_default

    results: net.core.wmem_default = 109568

    command: /sbin/sysctl -a | grep wmem_max

    results: net.core.wmem_max = 131071

    sample /etc/sysctl.conf file. This is given as an example only and does not reflect the results obtained above by the /sbin/sysctl commands. Only add lines that are needed and do not change any values to be lower than the base installation might have assigned.

    kernel.shmall = 2097152

    kernel.shmmax = 2147483648

    kernel.shmmni = 4096

    kernel.sem = 250 32000 100 128

    fs.file-max = 65536

    net.ipv4.ip_local_port_range = 1024 65000

    net.core.rmem_default = 4194304

    net.core.rmem_max = 4194304

    net.core.wmem_default = 262144

    net.core.wmem_max = 262144

    Setting shell limits for the Oracle user

    Add the following lines to /etc/security/limits.conf

    oracle soft nproc 2047

    oracle hard nproc 16384

    oracle soft nofile 1024

    oracle hard nofile 65536

    Add the following lines to /etc/pam.d/login

    session required /lib/security/pam_limits.so

    session required pam_limits.so

    Add the following lines to /etc/profile

    if [ $USER = "oracle" ]; then

    if [ $SHELL = "/bin/ksh" ]; then

    ulimit -p 16384

    ulimit -n 65536

    else

    ulimit -u 16384 -n 65536

    fi

    fi

    Creating Directories to Install the Oracle Software

    Validate you have enough space on disk and choose a directory to install

    command: df -k

    results: pick a mount point that has enough space—we have chosen /opt for the our.

    Create subdirectories and give permissions to the oracle user

    The following directory used is common for Oracle installations. Note that we are creating all directories under /opt and that there are no other applications using /opt/app and below. This is very important as we are changing permissions with the following commands.

    command: mkdir -p /opt/app/oracle/product/11.1.0

    chown -R oracle:oinstall /opt/app

    chmod -R 775 /opt/app

    Switch to the oracle user

    Up to know we have been doing everything as the root user. It is now time to switch to the oracle user to actually install the Oracle software.

    command: su – oracle

    Add the following line to $HOME/.bash_profile

    umask 022

    Execute oracle's bash_profile to use new setting

    command: . ./.bash_profile

    Make sure the oracle user is using an X Windows System

    It is assumed you know how to set up an X Windows System as stated earlier in the document. Please verify it is working by issuing the xterm command and validating an X Terminal comes up. You may close the X Terminal if you wish.

    Set Oracle environment for the installation

    Issue the following commands to set/unset particular Oracle environments in preparation for the installation.

    command: export ORACLE_BASE=/opt/app/oracle

    export ORACLE_SID=orcl

    unset ORACLE_HOME

    unset TNS_ADMIN

    Start Oracle Installer

    This paper assumes you have downloaded the Oracle software from the net and have unzipped the files. We have unzipped our software into /opt and the following commands will take you through starting the Oracle installer form that mount point.

    command: cd /opt/database

    ./runInstaller

    From this point, Oracle will do a few minor checks on the operating system and then put up the Oracle Installation screen. Our particular configuration did not throw any errors at this point but it should be noted, as it can be helpful, that sometimes the Oracle installer will complain at this very early stage about various Linux system configurations. If this is the case you might be able to bypass them by adding an additional argument to the runInstaller command. Please only use this as a last resort to the normal installation path.

    command: ./runInstaller -ignoreSysPrereqs

    From this point on we will walk through each of the prompts one at a time to give you a simple feel for a full installation of the Oracle software.

    Select installation method

    This screen is very busy to say the least. We are not going to create any databases at this point as it is not required nor is it suggested to do at this point. We like to create databases separately through the Database Creation Assistant (DBCA) and not confuse the software installation process.

    1. Choose basic installation

    1. verify Oracle Base of '/opt/app/oracle'

    2. verify Oracle Home of '/opt/app/oracle/product/11.1.0/db_1'

    3. verify installation type of 'Enterprise Edition'

    4. verify dba group of 'dba'

    2. Un-check “Create Starter Database”

    3. Un-check “Advanced Installation”

    4. Click

    Specify Inventory directory and credentials

    1. verify path of inventory directory of '/opt/app/oraInventory'

    2. verify group name for install of 'oinstall'

    3. Click

    Product-Specific Prerequisite Checks

    This screen, the installer will verify the system environment and report on any issues it may find. If all goes well you will get the status of 'Succeeded' for every check. Scroll through and make sure nothing has failed or look at the status box at the bottom of the screen and verify you get the following:

    'Check complete. The overall result of this check is: Passed'

    1. verify all statuses

    2. Click

    Summary

    This screen give a summary of the installation you are about to perform. It can be interesting to click and expand the products being installed to give you an idea of the what product and version is going to be installed.

    1. validate 'Global Settings' for directories

    2. validate 'Space Requirements'

    3. Click

    Install

    This screen gives a status of what is being installed. If all system settings have been properly set and all packages been installed properly then this should proceed without error. The status bar gives some indication of what is being installed at a particular point and the amount of work to be performed. But as all status bars you never really know how long in the process it is.

    1. Note the time it takes for specific products. If you notice one hanging or taking a long amount of time (greater than 10 minutes) you could have a condition that requires a pre-installation patch. Don't stop the installer yet but instead start looking for a bug / patch for the Oracle 11g installation process and the actual product being installed.

    2. Execute Configuration scripts

    1. open up a different terminal window

    2. login as the root user

    3. run /opt/app/oraInventory/orainstRoot.sh

    4. run /opt/app/oracle/product/11.1.0/db_1/root.sh

    1. accept default of /usr/local/bin

    5. Click

    3. Click

    4. Click

    Cleanup

    1. If you downloaded the software from the net you can now remove .zip file and the complete directory structure you unzipped it to. That particular command is not given here as it can be quite disastrous if executed from the wrong directory.

    2. Add the following lines to oracle's $HOME/.bash_profile file. This will allow you to execute various Oracle binaries to create databases, configure network settings, and generally manage the Oracle database environment.

    export ORACLE_HOME=/opt/app/oracle/product/11.1.0/db_1

    export PATH=$ORACLE_HOME/bin:$PATH

    Installation is complete

    Congratulations on a successful installation of the Oracle software. This paper hopefully was also successful in its attempt to guide you down a more simplistic path—giving you the commands to execute and working past the minor hurdles encountered during installation. Obviously this paper can not predict all the issues that you may encounter but if you have a relatively current system with ample memory and disk space there is no reason not to believe your installation wouldn't run smoothly.

    REFERENCES

    http://www.jameskoopmann.com/docs/Install_Oracle11gCentOS5.htm