Thursday, December 15, 2011




 HACKING CONCEPTS OVERVIEW

Module 01: Introduction to Ethical Hacking

    Internet Crime Current Report: IC3
    Data Breach Investigations Report
    Types of Data Stolen From the Organizations
    Essential Terminologies
    Elements of Information Security
    Authenticity and Non-Repudiation
    The Security, Functionality, and Usability Triangle
    Security Challenges
    Effects of Hacking
        Effects of Hacking on Business
    Who is a Hacker?
    Hacker Classes
    Hacktivism
    What Does a Hacker Do?
    Phase 1 - Reconnaissance
        Reconnaissance Types
    Phase 2 - Scanning
    Phase 3 – Gaining Access
    Phase 4 – Maintaining Access
    Phase 5 – Covering Tracks
    Types of Attacks on a System
        Operating System Attacks
        Application-Level Attacks
        Shrink Wrap Code Attacks
        Misconfiguration Attacks
    Why Ethical Hacking is Necessary?
    Defense in Depth
    Scope and Limitations of Ethical Hacking
    What Do Ethical Hackers Do?
    Skills of an Ethical Hacker
    Vulnerability Research
    Vulnerability Research Websites
    What is Penetration Testing?
    Why Penetration Testing?
    Penetration Testing Methodology


Module 02: Footprinting and Reconnaissance

    Footprinting Terminologies
    What is Footprinting?
    Objectives of Footprinting
    Footprinting Threats
    Finding a Company’s URL
    Locate Internal URLs
    Public and Restricted Websites
    Search for Company’s Information
        Tools to Extract Company’s Data
    Footprinting Through Search Engines
    Collect Location Information
        Satellite Picture of a Residence
    People Search
        People Search Using http://pipl.com
        People Search Online Services
        People Search on Social Networking Services
    Gather Information from Financial Services
    Footprinting Through Job Sites
    Monitoring Target Using Alerts
    Competitive Intelligence Gathering
        Competitive Intelligence-When Did this Company Begin?  How Did it Develop?
        Competitive Intelligence-What are the Company's Plans?
        Competitive Intelligence-What Expert Opinion Say About the Company?
        Competitive Intelligence Tools
        Competitive Intelligence Consulting Companies
    WHOIS Lookup
        WHOIS Lookup Result Analysis
        WHOIS Lookup Tools: SmartWhois
        WHOIS Lookup Tools
        WHOIS Lookup Online Tools
    Extracting DNS Information
        DNS Interrogation Tools
        DNS Interrogation Online Tools
    Locate the Network Range
    Traceroute
        Traceroute Analysis
        Traceroute Tool: 3D Traceroute
        Traceroute Tool: LoriotPro
        Traceroute Tool: Path Analyzer Pro
        Traceroute Tools
    Mirroring Entire Website
        Website Mirroring Tools
        Mirroring Entire Website Tools
    Extract Website Information from http://www.archive.org
    Monitoring Web Updates Using Website Watcher
    Tracking Email Communications
        Email Tracking Tools
    Footprint Using Google Hacking Techniques
    What a Hacker Can Do With Google Hacking?
    Google Advance Search Operators
        Finding Resources using Google Advance Operator
    Google Hacking Tool: Google Hacking Database (GHDB)
    Google Hacking Tools
    Additional Footprinting Tools
    Footprinting Countermeasures
    Footprinting Pen Testing


Module 03: Scanning Networks

    Network Scanning
    Types of Scanning
    Checking for Live Systems - ICMP Scanning
    Ping Sweep
        Ping Sweep Tools
    Three-Way Handshake
    TCP Communication Flags
        Create Custom Packet using TCP Flags
    Hping2 / Hping3
    Hping Commands
    Scanning Techniques
        TCP Connect / Full Open Scan
        Stealth Scan (Half-open Scan)
        Xmas Scan
        FIN Scan
        NULL Scan
        IDLE Scan
            IDLE Scan: Step 1
            IDLE Scan: Step 2.1 (Open Port)
            IDLE Scan: Step 2.2  (Closed Port)
            IDLE Scan: Step 3
        ICMP Echo Scanning/List Scan
        SYN/FIN Scanning Using IP Fragments
        UDP Scanning
        Inverse TCP Flag Scanning
        ACK Flag Scanning
    Scanning: IDS Evasion Techniques
    IP Fragmentation Tools
    Scanning Tool: Nmap
    Scanning Tool: NetScan Tools Pro
    Scanning Tools
    Do Not Scan These IP Addresses (Unless you want to get into trouble)
    Scanning Countermeasures
    War Dialing
    Why War Dialing?
    War Dialing Tools
    War Dialing Countermeasures
        War Dialing Countermeasures: SandTrap Tool
    OS Fingerprinting
        Active Banner Grabbing Using Telnet
    Banner Grabbing Tool: ID Serve
    GET REQUESTS
    Banner Grabbing Tool: Netcraft
    Banner Grabbing Tools
    Banner Grabbing Countermeasures: Disabling or Changing Banner
    Hiding File Extensions
    Hiding File Extensions from Webpages
    Vulnerability Scanning
        Vulnerability Scanning Tool: Nessus
        Vulnerability Scanning Tool: SAINT
        Vulnerability Scanning Tool: GFI LANGuard
    Network Vulnerability Scanners
    LANsurveyor
    Network Mappers
    Proxy Servers
    Why Attackers Use Proxy Servers?
    Use of Proxies for Attack
    How Does MultiProxy Work?
    Free Proxy Servers
    Proxy Workbench
    Proxifier Tool: Create Chain of Proxy Servers
    SocksChain
    TOR (The Onion Routing)
    TOR Proxy Chaining Software
    HTTP Tunneling Techniques
    Why do I Need HTTP Tunneling?
    Super Network Tunnel Tool
    Httptunnel for Windows
    Additional HTTP  Tunneling Tools
    SSH Tunneling
    SSL Proxy Tool
    How to Run SSL Proxy?
    Proxy Tools
    Anonymizers
    Types of Anonymizers
    Case: Bloggers Write Text Backwards to Bypass Web Filters in China
    Text Conversion to Avoid Filters
    Censorship Circumvention Tool:  Psiphon
    How Psiphon Works?
    How to Check if  Your Website is Blocked in China or Not?
    G-Zapper
    Anonymizer Tools
    Spoofing IP Address
    IP Spoofing Detection Techniques: Direct TTL Probes
    IP Spoofing Detection Techniques: IP Identification Number
    IP Spoofing Detection Techniques: TCP Flow Control Method
    IP Spoofing Countermeasures
    Scanning Pen Testing


Module 04: Enumeration

    What is Enumeration?
    Techniques for Enumeration
    Netbios Enumeration
        NetBIOS Enumeration Tool: SuperScan
        NetBIOS Enumeration Tool: NetBIOS Enumerator
    Enumerating User Accounts
    Enumerate Systems Using Default Passwords
    SNMP (Simple Network Management Protocol) Enumeration
        Management Information Base (MIB)
        SNMP Enumeration Tool: OpUtils Network Monitoring Toolset
        SNMP Enumeration Tool: SolarWinds
        SNMP Enumeration Tools
    UNIX/Linux Enumeration
        Linux Enumeration Tool: Enum4linux
    LDAP Enumeration
        LDAP Enumeration Tool: JXplorer
        LDAP Enumeration Tool
    NTP Enumeration
        NTP Server Discovery Tool: NTP Server Scanner
        NTP Server: PresenTense Time Server
        NTP Enumeration Tools
    SMTP Enumeration
        SMTP Enumeration Tool: NetScanTools Pro
    DNS Zone Transfer Enumeration Using nslookup
        DNS Analyzing and Enumeration Tool:  The Men & Mice Suite
    Enumeration Countermeasures
        SMB Enumeration Countermeasures
    Enumeration Pen Testing


Module 05: System Hacking

    Information at Hand Before System Hacking Stage
    System Hacking: Goals
    CEH Hacking Methodology (CHM)
    Password Cracking
        Password Complexity
        Password Cracking Techniques
        Types of Password Attacks
            Passive Online Attacks: Wire Sniffing
            Password Sniffing
            Passive Online Attack:  Man-in-the-Middle and Replay Attack
            Active Online Attack: Password Guessing
                Active Online Attack: Trojan/Spyware/Keylogger
                Active Online Attack: Hash Injection Attack
            Rainbow Attacks: Pre-Computed Hash
            Distributed Network Attack
                Elcomsoft Distributed Password Recovery
            Non-Electronic Attacks
                Default Passwords
            Manual Password Cracking (Guessing)
            Automatic Password Cracking Algorithm
            Stealing Passwords Using USB Drive
    Microsoft Authentication
    How Hash Passwords are Stored in Windows SAM?
    What is LAN Manager Hash?
        LM “Hash” Generation
        LM, NTLMv1, and NTLMv2
        NTLM Authentication Process
    Kerberos Authentication
    Salting
    PWdump7 and Fgdump
    L0phtCrack
    Ophcrack
    Cain & Abel
    RainbowCrack
    Password Cracking Tools
    LM Hash Backward Compatibility
        How to Disable LM HASH?
    How to Defend against Password Cracking?
        Implement and Enforce Strong Security Policy
    Privilege Escalation
        Escalation of Privileges
    Active@ Password Changer
    Privilege Escalation Tools
    How to Defend against Privilege Escalation?
    Executing Applications
    Alchemy Remote Executor
    RemoteExec
    Execute This!
    Keylogger
    Types of Keystroke Loggers
    Acoustic/CAM Keylogger
        Keylogger: Advanced Keylogger
        Keylogger: Spytech SpyAgent
        Keylogger: Perfect Keylogger
        Keylogger: Powered Keylogger
        Keylogger for Mac: Aobo Mac OS X KeyLogger
        Keylogger for Mac: Perfect Keylogger for Mac
        Hardware Keylogger: KeyGhost
    Keyloggers
    Spyware
        What Does the Spyware Do?
        Types of Spywares
            Desktop Spyware
                Desktop Spyware: Activity Monitor
            Email and Internet Spyware
                Email and Internet Spyware: eBLASTER
            Internet and E-mail Spyware
            Child Monitoring Spyware
                Child Monitoring Spyware: Advanced Parental Control
            Screen Capturing Spyware
                Screen Capturing Spyware: Spector Pro
            USB Spyware
                USB Spyware: USBDumper
            Audio Spyware
                Audio Spyware: RoboNanny, Stealth Recorder Pro and Spy Voice Recorder
            Video Spyware
                Video Spyware: Net Video Spy
            Print Spyware
                Print Spyware: Printer Activity Monitor
            Telephone/Cellphone Spyware
            Cellphone Spyware: Mobile Spy
            GPS Spyware
                GPS Spyware: GPS TrackMaker
    How to Defend against Keyloggers?
        Anti-Keylogger
        Anti-Keylogger: Zemana AntiLogger
        Anti-Keyloggers
    How to Defend against Spyware?
        Anti-Spyware: Spyware Doctor
    Rootkits
    Types of Rootkits
    How Rootkit Works?
    Rootkit: Fu
    Detecting Rootkits
        Steps for Detecting Rootkits
    How to Defend against Rootkits?
    Anti-Rootkit: RootkitRevealer and McAfee Rootkit Detective
    NTFS Data Stream
        How to Create NTFS Streams?
        NTFS Stream Manipulation
        How to Defend against NTFS Streams?
        NTFS Stream Detector: ADS Scan Engine
        NTFS Stream Detectors
    What is Steganography?
        Steganography Techniques
        How Steganography Works?
    Types of Steganography
        Whitespace Steganography Tool: SNOW
    Image Steganography
        Image Steganography: Hermetic Stego
        Image Steganography Tools
    Document Steganography: wbStego
        Document Steganography Tools
    Video Steganography: Our Secret
        Video Steganography Tools
    Audio Steganography: Mp3stegz
        Audio Steganography Tools
    Folder Steganography: Invisible Secrets 4
        Folder Steganography Tools
    Spam/Email Steganography: Spam Mimic
    Natural Text Steganography: Sams Big G Play Maker
    Steganalysis
        Steganalysis Methods/Attacks on Steganography
    Steganography Detection Tool: Stegdetect
        Steganography Detection Tools
    Why Cover Tracks?
        Covering Tracks
    Ways to Clear Online Tracks
    Disabling Auditing: Auditpol
    Covering Tracks Tool: Window Washer
    Covering Tracks Tool: Tracks Eraser Pro
        Track Covering Tools
    System Hacking Penetration Testing


Module 06: Trojans and Backdoors

    What is a Trojan?
    Overt and Covert Channels
    Purpose of Trojans
    What Do Trojan Creators Look For?
    Indications of a Trojan Attack
    Common Ports used by Trojans
    How to Infect Systems Using a Trojan?
    Wrappers
        Wrapper Covert Programs
    Different Ways a Trojan can Get into a System
    How to Deploy a Trojan?
    Evading Anti-Virus Techniques
    Types of Trojans
        Command Shell Trojans
            Command Shell Trojan: Netcat
        GUI Trojan: MoSucker
            GUI Trojan: Jumper and Biodox
        Document Trojans
        E-mail Trojans
            E-mail Trojans: RemoteByMail
        Defacement Trojans
            Defacement Trojans: Restorator
        Botnet Trojans
            Botnet Trojan: Illusion Bot
            Botnet Trojan: NetBot Attacker
        Proxy Server Trojans
            Proxy Server Trojan: W3bPrOxy Tr0j4nCr34t0r (Funny Name)
        FTP Trojans
            FTP Trojan: TinyFTPD
        VNC Trojans
        HTTP/HTTPS Trojans
            HTTP Trojan: HTTP RAT
        Shttpd Trojan - HTTPS (SSL)
        ICMP Tunneling
            ICMP Trojan: icmpsend
        Remote Access Trojans
            Remote Access Trojan: RAT DarkComet
            Remote Access Trojan: Apocalypse
        Covert Channel Trojan: CCTT
        E-banking Trojans
        Banking Trojan Analysis
            E-banking Trojan: ZeuS
    Destructive Trojans
    Notification Trojans
    Credit Card Trojans
    Data Hiding Trojans (Encrypted Trojans)
    BlackBerry Trojan: PhoneSnoop
    MAC OS X Trojan: DNSChanger
    MAC OS X Trojan: DNSChanger
    Mac OS X Trojan: Hell Raiser
    How to Detect Trojans?
        Scanning for Suspicious Ports
        Port Monitoring Tool: IceSword
        Port Monitoring Tools: CurrPorts and TCPView
        Scanning for Suspicious Processes
    Process Monitoring Tool: What's Running
        Process Monitoring Tools
    Scanning for Suspicious Registry Entries
    Registry Entry Monitoring Tools
    Scanning for Suspicious Device Drivers
        Device Drivers Monitoring Tools: DriverView
        Device Drivers Monitoring Tools
    Scanning for Suspicious Windows Services
        Windows Services Monitoring Tools: Windows Service Manager (SrvMan)
        Windows Services Monitoring Tools
    Scanning for Suspicious Startup Programs
        Windows7 Startup Registry Entries
        Startup Programs Monitoring Tools: Starter
        Startup Programs Monitoring Tools: Security AutoRun
        Startup Programs Monitoring Tools
    Scanning for Suspicious Files and Folders
        Files and Folder Integrity Checker: FastSum and WinMD5
        Files and Folder Integrity Checker
    Scanning for Suspicious Network Activities
        Detecting Trojans and Worms with Capsa Network Analyzer
    Trojan Countermeasures
    Backdoor Countermeasures
    Trojan Horse Construction Kit
    Anti-Trojan Software: TrojanHunter
    Anti-Trojan Software: Emsisoft Anti-Malware
    Anti-Trojan Softwares
    Pen Testing for Trojans and Backdoors


Module 07: Viruses and Worms

    Introduction to Viruses
    Virus and Worm Statistics 2010
    Stages of Virus Life
    Working of  Viruses: Infection Phase
    Working of  Viruses: Attack Phase
    Why Do People Create Computer Viruses?
    Indications of Virus Attack
    How does a Computer get Infected by Viruses?
    Virus Hoaxes
    Virus Analysis:
        W32/Sality AA
        W32/Toal-A
        W32/Virut
        Klez
    Types of Viruses
        System or Boot Sector Viruses
        File and Multipartite Viruses
        Macro Viruses
        Cluster Viruses
        Stealth/Tunneling Viruses
        Encryption Viruses
        Polymorphic Code
        Metamorphic Viruses
        File Overwriting or Cavity Viruses
        Sparse Infector Viruses
        Companion/Camouflage Viruses
        Shell Viruses
        File Extension Viruses
        Add-on and Intrusive Viruses
    Transient and Terminate and Stay Resident Viruses
    Writing a Simple Virus Program
        Terabit Virus Maker
        JPS Virus Maker
        DELmE's Batch Virus Maker
    Computer  Worms
    How is a Worm Different from a Virus?
    Example of Worm Infection: Conficker Worm
        What does the Conficker Worm do?
        How does the Conficker Worm Work?
    Worm Analysis:
        W32/Netsky
        W32/Bagle.GE
    Worm Maker: Internet Worm Maker Thing
    What is Sheep Dip Computer?
    Anti-Virus Sensors Systems
    Malware Analysis Procedure
    String Extracting Tool: Bintext
    Compression and Decompression Tool: UPX
    Process Monitoring Tools: Process Monitor
    Log Packet Content Monitoring Tools: NetResident
    Debugging Tool: Ollydbg
    Virus  Analysis Tool: IDA Pro
    Online Malware Testing:
        Sunbelt CWSandbox
        VirusTotal
    Online Malware Analysis Services
    Virus Detection Methods
    Virus and Worms Countermeasures
    Companion Antivirus: Immunet Protect
    Anti-virus Tools
    Penetration Testing for Virus


Module 08: Sniffers

    Lawful Intercept
        Benefits of Lawful Intercept
        Network Components Used for Lawful Intercept
    Wiretapping
    Sniffing Threats
    How a Sniffer Works?
    Hacker Attacking a Switch
    Types of Sniffing: Passive Sniffing
    Types of Sniffing: Active Sniffing
    Protocols Vulnerable to Sniffing
    Tie to Data Link Layer in OSI Model
    Hardware Protocol Analyzers
    SPAN Port
    MAC Flooding
        MAC Address/CAM Table
        How CAM Works?
        What Happens When CAM Table is Full?
        Mac Flooding Switches with macof
        MAC Flooding Tool: Yersinia
        How to Defend against MAC Attacks?
    How DHCP Works?
        DHCP Request/Reply Messages
        IPv4 DHCP Packet Format
        DHCP Starvation Attack
        Rogue DHCP Server Attack
        DHCP Starvation Attack Tool: Gobbler
        How to Defend Against DHCP Starvation and Rogue Server Attack?
    What is Address Resolution Protocol (ARP)?
        ARP Spoofing Attack
        How Does ARP Spoofing Work?
        Threats of ARP Poisoning
        ARP Poisoning Tool: Cain and Abel
        ARP Poisoning Tool: WinArpAttacker
        ARP Poisoning Tool: Ufasoft Snif
        How to Defend Against ARP Poisoning? Use DHCP Snooping Binding Table and Dynamic ARP Inspection
    Configuring DHCP Snooping and Dynamic ARP Inspection on Cisco Switches
    MAC Spoofing/Duplicating
        Spoofing Attack Threats
        MAC Spoofing Tool: SMAC
        How to Defend Against MAC Spoofing? Use DHCP Snooping Binding Table, Dynamic ARP Inspection and IP Source Guard
    DNS Poisoning Techniques
        Intranet DNS Spoofing
        Internet DNS Spoofing
        Proxy Server DNS Poisoning
        DNS Cache Poisoning
        How to Defend Against DNS Spoofing?
    Sniffing Tool: Wireshark
        Follow TCP Stream in Wireshark
        Display Filters in Wireshark
        Additional Wireshark Filters
    Sniffing Tool: CACE Pilot
    Sniffing Tool: Tcpdump/Windump
    Discovery Tool: NetworkView
    Discovery Tool: The Dude Sniffer
    Password Sniffing Tool: Ace
    Packet Sniffing Tool: Capsa Network Analyzer
    OmniPeek Network Analyzer
    Network Packet Analyzer: Observer
    Session Capture Sniffer: NetWitness
    Email Message Sniffer: Big-Mother
    TCP/IP Packet Crafter: Packet Builder
    Additional Sniffing Tools
    How an Attacker Hacks the Network Using Sniffers?
    How to Defend Against Sniffing?
    Sniffing Prevention Techniques
    How to Detect Sniffing?
    Promiscuous Detection Tool: PromqryUI
    Promiscuous Detection Tool: PromiScan


Module 09: Social Engineering

    What is Social Engineering?
    Behaviors Vulnerable to Attacks
        Factors that Make Companies Vulnerable to Attacks
    Why is Social Engineering Effective?
    Warning Signs of an Attack
    Phases in a Social Engineering Attack
    Impact on the Organization
    Command Injection Attacks
    Common Targets of Social Engineering
        Common Targets of Social Engineering: Office Workers
    Types of Social Engineering
        Human-Based Social Engineering
            Technical Support Example
            Authority Support Example
            Human-based Social Engineering: Dumpster Diving
        Computer-Based Social Engineering
            Computer-Based Social Engineering: Pop-Ups
            Computer-Based Social Engineering: Phishing
        Social Engineering Using SMS
        Social Engineering by a “Fake SMS Spying Tool”
    Insider Attack
        Disgruntled Employee
        Preventing Insider Threats
    Common Intrusion Tactics and Strategies for Prevention
    Social Engineering Through Impersonation on Social Networking Sites
        Social Engineering Example: LinkedIn Profile
        Social Engineering on Facebook
        Social Engineering on Twitter
        Social Engineering on Orkut
        Social Engineering on MySpace
    Risks of Social Networking to Corporate Networks
    Identity Theft Statistics 2010
        Identify Theft
        How to Steal an Identity?
        STEP 1
        STEP 2
        STEP 3
    Real Steven Gets Huge Credit Card Statement
    Identity Theft - Serious Problem
    Social Engineering Countermeasures: Policies
        Social Engineering Countermeasures
    How to Detect Phishing Emails?
        Anti-Phishing Toolbar: Netcraft
        Anti-Phishing Toolbar: PhishTank
    Identity Theft Countermeasures
    Social Engineering Pen Testing
        Social Engineering Pen Testing: Using Emails
        Social Engineering Pen Testing: Using Phone
        Social Engineering Pen Testing: In Person


Module 10: Denial of Service

    What is a Denial of Service Attack?
    What is Distributed Denial of Service Attacks?
        How Distributed Denial of Service Attacks Work?
    Symptoms of a DoS Attack
    Cyber Criminals
        Organized Cyber Crime: Organizational Chart
    Internet Chat Query (ICQ)
    Internet Relay Chat (IRC)
    DoS Attack Techniques
        Bandwidth Attacks
        Service Request Floods
        SYN Attack
        SYN Flooding
        ICMP Flood Attack
        Peer-to-Peer Attacks
        Permanent Denial-of-Service Attack
        Application Level Flood Attacks
    Botnet
        Botnet Propagation Technique
        Botnet Ecosystem
        Botnet Trojan: Shark
        Poison Ivy: Botnet Command Control Center
        Botnet Trojan: PlugBot
    WikiLeak Operation Payback
        DDoS Attack
        DDoS Attack Tool: LOIC
        Denial of Service Attack Against MasterCard, Visa, and Swiss Banks
        Hackers Advertise Links to Download Botnet
    DoS Attack Tools
    Detection Techniques
        Activity Profiling
        Wavelet Analysis
        Sequential Change-Point Detection
    DoS/DDoS Countermeasure Strategies
    DDoS Attack Countermeasures
        DoS/DDoS Countermeasures: Protect Secondary Victims
        DoS/DDoS Countermeasures: Detect and Neutralize Handlers
        DoS/DDoS Countermeasures: Detect Potential Attacks
        DoS/DDoS Countermeasures: Deflect Attacks
        DoS/DDoS Countermeasures: Mitigate Attacks
    Post-attack Forensics
    Techniques to Defend against Botnets
    DoS/DDoS Countermeasures
    DoS/DDoS Protection at ISP Level
    Enabling TCP Intercept on Cisco IOS Software
    Advanced DDoS Protection: IntelliGuard DDoS Protection System (DPS)
    DoS/DDoS Protection Tool
    Denial of Service (DoS) Attack Penetration Testing


Module 11: Session Hijacking

    What is Session Hijacking?
    Dangers Posed by Hijacking
    Why Session Hijacking is Successful?
    Key Session Hijacking Techniques
    Brute Forcing
        Brute Forcing Attack
    HTTP Referrer Attack
    Spoofing vs. Hijacking
    Session Hijacking Process
    Packet Analysis of a Local Session Hijack
    Types of Session Hijacking
        Session Hijacking in OSI Model
        Application Level Session Hijacking
        Session Sniffing
    Predictable Session Token
        How to Predict a Session Token?
    Man-in-the-Middle Attack
    Man-in-the-Browser Attack
        Steps to Perform Man-in-the-Browser Attack
    Client-side Attacks
    Cross-site Script Attack
    Session Fixation
        Session Fixation Attack
    Network Level Session Hijacking
    The 3-Way Handshake
    Sequence Numbers
        Sequence Number Prediction
    TCP/IP Hijacking
    IP Spoofing: Source Routed Packets
    RST Hijacking
    Blind Hijacking
    Man-in-the-Middle Attack using Packet Sniffer
    UDP Hijacking
    Session Hijacking Tools
        Paros
        Burp Suite
        Firesheep
    Countermeasures
    Protecting against Session Hijacking
    Methods to Prevent Session Hijacking: To be Followed by Web Developers
    Methods to Prevent Session Hijacking: To be Followed by Web Users
    Defending against Session Hijack Attacks
    Session Hijacking Remediation
    IPSec
        Modes of IPSec
        IPSec Architecture
        IPSec Authentication and Confidentiality
        Components of IPSec
        IPSec Implementation
    Session Hijacking Pen Testing


Module 12: Hijacking Webservers

    Webserver Market Shares
    Open Source Webserver Architecture
    IIS Webserver Architecture
    Website Defacement
    Case Study
    Why Web Servers are Compromised?
    Impact of Webserver Attacks
    Webserver Misconfiguration
        Example
    Directory Traversal Attacks
    HTTP Response Splitting Attack
    Web Cache Poisoning Attack
    HTTP Response Hijacking
    SSH Bruteforce Attack
    Man-in-the-Middle Attack
    Webserver Password Cracking
        Webserver Password Cracking Techniques
    Web Application Attacks
    Webserver Attack Methodology
        Information Gathering
        Webserver Footprinting
            Webserver Footprinting Tools
        Mirroring a Website
        Vulnerability Scanning
        Session Hijacking
        Hacking Web Passwords
    Webserver Attack Tools
        Metasploit
            Metasploit Architecture
            Metasploit Exploit Module
            Metasploit Payload Module
            Metasploit Auxiliary Module
            Metasploit NOPS Module
        Wfetch
    Web Password Cracking Tool
        Brutus
        THC-Hydra
    Countermeasures
        Patches and Updates
        Protocols
        Accounts
        Files and Directories
    How to Defend Against Web Server Attacks?
    How to Defend against HTTP Response Splitting and Web Cache Poisoning?
    Patches and Hotfixes
    What is Patch Management?
    Identifying Appropriate Sources for Updates and Patches
    Installation of a Patch
    Patch Management Tool: Microsoft Baseline Security Analyzer (MBSA)
        Patch Management Tools
    Web Application Security Scanner: Sandcat
    Web Server Security Scanner: Wikto
    Webserver Malware Infection Monitoring Tool: HackAlert
    Webserver Security Tools
    Web Server Penetration Testing


Module 13: Hacking Web Applications

    Web Application Security Statistics
    Introduction to Web Applications
    Web Application Components
    How Web Applications Work?
    Web Application Architecture
    Web 2.0 Applications
    Vulnerability Stack
    Web Attack Vectors
    Web Application Threats - 1
    Web Application Threats - 2
    Unvalidated Input
    Parameter/Form Tampering
    Directory Traversal
    Security Misconfiguration
    Injection Flaws
        SQL Injection Attacks
        Command Injection Attacks
        Command Injection Example
        File Injection Attack
    What is LDAP Injection?
    How LDAP Injection Works?
    Hidden Field Manipulation Attack
    Cross-Site Scripting (XSS) Attacks
        How XSS Attacks Work?
        Cross-Site Scripting Attack Scenario: Attack via Email
        XSS Example: Attack via Email
        XSS Example: Stealing Users' Cookies
        XSS Example: Sending an Unauthorized Request
        XSS Attack in Blog Posting
        XSS Attack in Comment Field
        XSS Cheat Sheet
        Cross-Site Request Forgery (CSRF) Attack
        How CSRF Attacks Work?
    Web Application Denial-of-Service (DoS) Attack
        Denial of Service (DoS) Examples
    Buffer Overflow Attacks
    Cookie/Session Poisoning
        How Cookie Poisoning Works?
    Session Fixation Attack
    Insufficient Transport Layer Protection
    Improper Error Handling
    Insecure Cryptographic Storage
    Broken Authentication and Session Management
    Unvalidated Redirects and Forwards
    Web Services Architecture
        Web Services Attack
        Web Services Footprinting Attack
        Web Services XML Poisoning
    Footprint Web Infrastructure
        Footprint Web Infrastructure: Server Discovery
        Footprint Web Infrastructure: Server Identification/Banner Grabbing
        Footprint Web Infrastructure: Hidden Content Discovery
    Web Spidering Using Burp Suite
    Hacking Web Servers
        Web Server Hacking Tool: WebInspect
    Analyze Web Applications
        Analyze Web Applications: Identify Entry Points for User Input
        Analyze Web Applications: Identify Server-Side Technologies
        Analyze Web Applications: Identify Server-Side Functionality
        Analyze Web Applications: Map the Attack Surface
    Attack Authentication Mechanism
    Username Enumeration
    Password Attacks: Password Functionality Exploits
    Password Attacks: Password Guessing
    Password Attacks: Brute-forcing
    Session Attacks: Session ID Prediction/ Brute-forcing
    Cookie Exploitation: Cookie Poisoning
    Authorization Attack
        HTTP Request Tampering
        Authorization Attack: Cookie Parameter Tampering
    Session Management Attack
        Attacking Session Token Generation Mechanism
        Attacking Session Tokens Handling Mechanism: Session Token Sniffing
    Injection Attacks
    Attack Data Connectivity
        Connection String Injection
        Connection String Parameter Pollution (CSPP) Attacks
        Connection Pool DoS
    Attack Web App Client
    Attack Web Services
    Web Services Probing Attacks
        Web Service Attacks: SOAP Injection
        Web Service Attacks: XML Injection
        Web Services Parsing Attacks
    Web Service Attack Tool: soapUI
    Web Service Attack Tool: XMLSpy
    Web Application Hacking Tool: Burp Suite Professional
    Web Application Hacking Tools: CookieDigger
    Web Application Hacking Tools: WebScarab
        Web Application Hacking Tools
    Encoding Schemes
        How to Defend Against SQL Injection Attacks?
        How to Defend Against Command Injection Flaws?
        How to Defend Against XSS Attacks?
        How to Defend Against DoS Attack?
        How to Defend Against Web Services Attack?
    Web Application Countermeasures
        How to Defend Against Web Application Attacks?
        Web Application Security Tool: Acunetix Web Vulnerability Scanner
        Web Application Security Tool: Falcove Web Vulnerability Scanner
        Web Application Security Scanner: Netsparker
        Web Application Security Tool: N-Stalker Web Application Security Scanner
        Web Application Security Tools
    Web Application Firewall:  dotDefender
    Web Application Firewall: IBM AppScan
    Web Application Firewall: ServerDefender VP
        Web Application Firewall
    Web Application Pen Testing
        Information Gathering
        Configuration Management Testing
        Authentication Testing
        Session Management Testing
        Authorization Testing
        Data Validation Testing
        Denial of Service Testing
        Web Services Testing
        AJAX Testing


Module 14: SQL Injection

    SQL Injection is the Most Prevalent Vulnerability in 2010
    SQL Injection Threats
    What is SQL Injection?
    SQL Injection Attacks
    How Web Applications Work?
    Server Side Technologies
    HTTP Post Request
        Example 1: Normal SQL Query
        Example 1: SQL Injection Query
        Example 1: Code Analysis
        Example 2: BadProductList.aspx
        Example 2: Attack Analysis
        Example 3: Updating Table
        Example 4: Adding New Records
        Example 5: Identifying the Table Name
        Example 6: Deleting a Table
    SQL Injection Detection
        SQL Injection Error Messages
        SQL Injection Attack Characters
        Additional Methods to Detect SQL Injection
    SQL Injection Black Box Pen Testing
        Testing for SQL Injection
    Types of SQL Injection
        Simple SQL Injection Attack
        Union SQL Injection Example
        SQL Injection Error Based
    What is Blind SQL Injection?
        No Error Messages Returned
        Blind SQL Injection: WAITFOR DELAY YES or NO Response
        Blind SQL Injection – Exploitation (MySQL)
        Blind SQL Injection - Extract Database User
        Blind SQL Injection - Extract Database Name
        Blind SQL Injection - Extract Column Name
        Blind SQL Injection - Extract Data from ROWS
    SQL Injection Methodology
    Information Gathering
        Extracting Information through Error Messages
        Understanding SQL Query
        Bypass Website Logins Using SQL Injection
    Database, Table, and Column Enumeration
        Advanced Enumeration
    Features of Different DBMSs
        Creating Database Accounts
    Password Grabbing
        Grabbing SQL Server Hashes
        Extracting SQL Hashes (In a Single Statement)
    Transfer Database to Attacker’s Machine
    Interacting with the Operating System
    Interacting with the FileSystem
    Network Reconnaissance Full Query
    SQL Injection Tools
        SQL Injection Tools: BSQLHacker
        SQL Injection Tools: Marathon Tool
        SQL Injection Tools: SQL Power Injector
        SQL Injection Tools: Havij
    Evading IDS
        Types of Signature Evasion Techniques
        Evasion Technique: Sophisticated Matches
        Evasion Technique: Hex Encoding
        Evasion Technique: Manipulating White Spaces
        Evasion Technique: In-line Comment
        Evasion Technique: Char Encoding
        Evasion Technique: String Concatenation
        Evasion Technique: Obfuscated Codes
    How to Defend Against SQL Injection Attacks?
        How to Defend Against SQL Injection Attacks: Use Type-Safe SQL Parameters
    SQL Injection Detection Tools
        SQL Injection Detection Tool: Microsoft Source Code Analyzer
        SQL Injection Detection Tool: Microsoft UrlScan
        SQL Injection Detection Tool: dotDefender
        SQL Injection Detection Tool: IBM AppScan
    Snort Rule to Detect SQL Injection Attacks


Module 15: Hacking Wireless Networks

    Wireless Networks
    Wi-Fi Usage Statistics in the US
    Wi-Fi Hotspots at Public Places
    Wi-Fi Networks at Home
    Types of Wireless Networks
    Wireless Standards
    Service Set Identifier (SSID)
    Wi-Fi Authentication Modes
        Wi-Fi Authentication Process Using a Centralized Authentication Server
        Wi-Fi Authentication Process
    Wireless Terminologies
    Wi-Fi Chalking
        Wi-Fi Chalking Symbols
    Wi-Fi Hotspot Finder: jiwire.com
    Wi-Fi Hotspot Finder: WeFi.com
    Types of Wireless Antenna
    Parabolic Grid Antenna
    Types of Wireless Encryption
    WEP Encryption
        How WEP Works?
    What is WPA?
        How WPA Works?
    Temporal Keys
    What is WPA2?
        How WPA2 Works?
    WEP vs. WPA vs. WPA2
    WEP Issues
    Weak Initialization Vectors (IV)
    How to Break WEP Encryption?
    How to Break WPA/WPA2 Encryption?
    How to Defend Against WPA Cracking?
    Wireless Threats: Access Control Attacks
    Wireless Threats: Integrity Attacks
    Wireless Threats: Confidentiality Attacks
    Wireless Threats: Availability Attacks
    Wireless Threats: Authentication Attacks
    Rogue Access Point Attack
    Client Mis-association
    Misconfigured Access Point Attack
    Unauthorized Association
    Ad Hoc Connection Attack
    HoneySpot Access Point Attack
    AP MAC Spoofing
    Denial-of-Service Attack
    Jamming Signal Attack
    Wi-Fi Jamming Devices
    Wireless Hacking Methodology
    Find Wi-Fi Networks to Attack
    Attackers Scanning for Wi-Fi Networks
    Footprint the Wireless Network
    Wi-Fi Discovery Tool: inSSIDer
    Wi-Fi Discovery Tool: NetSurveyor
    Wi-Fi Discovery Tool: NetStumbler
    Wi-Fi Discovery Tool: Vistumbler
    Wi-Fi Discovery Tool: WirelessMon
    Wi-Fi Discovery Tools
    GPS Mapping
        GPS Mapping Tool: WIGLE
        GPS Mapping Tool: Skyhook
    How to Discover Wi-Fi Network Using Wardriving?
    Wireless Traffic Analysis
    Wireless Cards and Chipsets
    Wi-Fi USB Dongle: AirPcap
    Wi-Fi Packet Sniffer: Wireshark with AirPcap
    Wi-Fi Packet Sniffer: Wi-Fi Pilot
    Wi-Fi Packet Sniffer: OmniPeek
    Wi-Fi Packet Sniffer: CommView for Wi-Fi
    What is Spectrum Analysis?
    Wireless Sniffers
    Aircrack-ng Suite
    How to Reveal Hidden SSIDs
    Fragmentation Attack
    How to Launch MAC Spoofing Attack?
    Denial of Service: Deauthentication and Disassociation Attacks
    Man-in-the-Middle Attack
    MITM Attack Using Aircrack-ng
    Wireless ARP Poisoning Attack
    Rogue Access Point
    Evil Twin
        How to Set Up a Fake Hotspot (Evil Twin)?
    How to Crack WEP Using Aircrack?
    How to Crack WEP Using Aircrack? Screenshot 1/2
    How to Crack WEP Using Aircrack? Screenshot 2/2
    How to Crack WPA-PSK Using Aircrack?
    WPA Cracking Tool: KisMAC
    WEP Cracking Using Cain & Abel
    WPA Brute Forcing Using Cain & Abel
    WPA Cracking Tool: Elcomsoft Wireless Security Auditor
    WEP/WPA Cracking Tools
    Wi-Fi Sniffer: Kismet
    Wardriving Tools
    RF Monitoring Tools
    Wi-Fi Connection Manager Tools
    Wi-Fi Traffic Analyzer Tools
    Wi-Fi Raw Packet Capturing Tools
    Wi-Fi Spectrum Analyzing Tools
    Bluetooth Hacking
        Bluetooth Stack
        Bluetooth Threats
    How to BlueJack a Victim?
    Bluetooth Hacking Tool: Super Bluetooth Hack
    Bluetooth Hacking Tool: PhoneSnoop
    Bluetooth Hacking Tool:  BlueScanner
        Bluetooth Hacking Tools
    How to Defend Against Bluetooth Hacking?
    How to Detect and Block Rogue AP?
    Wireless Security Layers
    How to Defend Against Wireless Attacks?
    Wireless Intrusion Prevention Systems
    Wireless IPS Deployment
    Wi-Fi Security Auditing Tool: AirMagnet WiFi Analyzer
    Wi-Fi Security Auditing Tool: AirDefense
    Wi-Fi Security Auditing Tool: Adaptive Wireless IPS
    Wi-Fi Security Auditing Tool: Aruba RFProtect WIPS
    Wi-Fi Intrusion Prevention System
    Wi-Fi Predictive Planning Tools
    Wi-Fi Vulnerability Scanning Tools
    Wireless Penetration Testing
        Wireless Penetration Testing Framework
        Wi-Fi Pen Testing Framework
        Pen Testing LEAP Encrypted WLAN
        Pen Testing WPA/WPA2 Encrypted WLAN
        Pen Testing WEP Encrypted WLAN
        Pen Testing Unencrypted WLAN


Module 16: Evading IDS, Firewalls, and Honeypots

    Intrusion Detection Systems (IDS) and its Placement
    How IDS Works?
    Ways to Detect an Intrusion
    Types of Intrusion Detection Systems
    System Integrity Verifiers (SIV)
    General Indications of Intrusions
    General Indications of System Intrusions
    Firewall
        Firewall Architecture
    DeMilitarized Zone (DMZ)
    Types of Firewall
        Packet Filtering Firewall
        Circuit-Level Gateway Firewall
        Application-Level Firewall
        Stateful Multilayer Inspection Firewall
    Firewall Identification
        Port Scanning
        Firewalking
        Banner Grabbing
    Honeypot
        Types of Honeypots
    How to Set Up a Honeypot?
    Intrusion Detection Tool
        Snort
        Snort Rules
        Rule Actions and IP Protocols
        The Direction Operator and IP Addresses
        Port Numbers
    Intrusion Detection Systems: Tipping Point
        Intrusion Detection Tools
    Firewall: Sunbelt Personal Firewall
        Firewalls
    Honeypot Tools
        KFSensor
        SPECTER
    Insertion Attack
    Evasion
    Denial-of-Service Attack (DoS)
    Obfuscating
    False Positive Generation
    Session Splicing
    Unicode Evasion Technique
    Fragmentation Attack
    Overlapping Fragments
    Time-To-Live Attacks
    Invalid RST Packets
    Urgency Flag
    Polymorphic Shellcode
    ASCII Shellcode
    Application-Layer Attacks
    Desynchronization
    Pre Connection SYN
    Post Connection SYN
    Other Types of Evasion
        IP Address Spoofing
        Attacking Session Token Generation Mechanism
        Tiny Fragments
    Bypass Blocked Sites Using IP Address in Place of URL
        Bypass Blocked Sites Using Anonymous Website Surfing Sites
    Bypass a Firewall using Proxy Server
        Bypassing Firewall through ICMP Tunneling Method
        Bypassing Firewall through ACK Tunneling Method
        Bypassing Firewall through HTTP Tunneling Method
        Bypassing Firewall through External Systems
        Bypassing Firewall through MITM Attack
    Detecting Honeypots
    Honeypot Detecting Tool: Send-Safe Honeypot Hunter
    Firewall Evasion Tools
        Traffic IQ Professional
        tcp-over-dns
        Firewall Evasion Tools
    Packet Fragment Generators
    Countermeasures
    Firewall/IDS Penetration Testing
        Firewall Penetration Testing
        IDS Penetration Testing


Module 17: Buffer Overflow

    Buffer Overflows
    Why are Programs And Applications Vulnerable?
    Understanding Stacks
    Stack-Based Buffer Overflow
    Understanding Heap
        Heap-Based Buffer Overflow
    Stack Operations
        Shellcode
        No Operations (NOPs)
    Knowledge Required to Program Buffer Overflow Exploits
    Buffer Overflow Steps
        Attacking a Real Program
        Format String Problem
        Overflow using Format String
        Smashing the Stack
        Once the Stack is Smashed...
    Simple Uncontrolled Overflow
    Simple Buffer Overflow in C
    Code Analysis
    Exploiting Semantic Comments in C (Annotations)
    How to Mutate a Buffer Overflow Exploit?
    Identifying Buffer Overflows
    How to Detect Buffer Overflows in a Program?
    BOU (Buffer Overflow Utility)
    Testing for Heap Overflow Conditions: heap.exe
    Steps for Testing for Stack Overflow in OllyDbg Debugger
        Testing for Stack Overflow in OllyDbg Debugger
    Testing for Format String Conditions using IDA Pro
    BoF Detection Tools
    Defense Against Buffer Overflows
        Preventing BoF Attacks
        Programming Countermeasures
    Data Execution Prevention (DEP)
    Enhanced Mitigation Experience Toolkit (EMET)
        EMET System Configuration Settings
        EMET Application Configuration Window
    BoF Security Tools
        BufferShield
    Buffer Overflow Penetration Testing


Module 18: Cryptography

    Cryptography
    Types of Cryptography
    Government Access to Keys (GAK)
    Ciphers
    Advanced Encryption Standard (AES)
    Data Encryption Standard (DES)
    RC4, RC5, RC6 Algorithms
    The DSA and Related Signature Schemes
    RSA (Rivest Shamir Adleman)
        Example of RSA Algorithm
        The RSA Signature Scheme
    Message Digest (One-way Bash) Functions
        Message Digest Function: MD5
    Secure Hashing Algorithm (SHA)
    What is SSH (Secure Shell)?
    MD5 Hash Calculators: HashCalc, MD5 Calculator and HashMyFiles
    Cryptography Tool: Advanced Encryption Package
    Cryptography Tools
    Public Key Infrastructure (PKI)
    Certification Authorities
    Digital Signature
    SSL (Secure Sockets Layer)
    Transport Layer Security (TLS)
    Disk Encryption
        Disk Encryption Tool: TrueCrypt
        Disk Encryption Tools
    Cryptography Attacks
    Code Breaking Methodologies
        Brute-Force Attack
    Meet-in-the-Middle Attack on Digital Signature Schemes
    Cryptanalysis Tool: CrypTool
    Cryptanalysis Tools
    Online MD5 Decryption Tool


Module 19: Penetration Testing

    Introduction to Penetration Testing
    Security Assessments
    Vulnerability Assessment
        Limitations of  Vulnerability Assessment
    Penetration Testing
    Why Penetration Testing?
    What Should be Tested?
    What Makes a Good Penetration Test?
    ROI on Penetration Testing
    Testing Points
    Testing Locations
    Types of Penetration Testing
        External Penetration Testing
        Internal Security Assessment
        Black-box Penetration Testing
        Grey-box Penetration Testing
        White-box Penetration Testing
        Announced / Unannounced Testing
        Automated Testing
        Manual Testing
    Common Penetration Testing Techniques
    Using DNS Domain Name and IP Address Information
    Enumerating Information about Hosts on Publicly-Available Networks
    Phases of Penetration Testing
        Pre-Attack Phase
        Attack Phase
            Activity: Perimeter Testing
            Enumerating Devices
            Activity: Acquiring Target
            Activity: Escalating Privileges
            Activity: Execute, Implant, and Retract
        Post-Attack Phase and Activities
            Penetration Testing Deliverable Templates
    Penetration Testing Methodology
        Application Security Assessment
            Web Application Testing - I
            Web Application Testing - II
            Web Application Testing - III
        Network Security Assessment
        Wireless/Remote Access Assessment
            Wireless Testing
        Telephony Security Assessment
        Social Engineering
        Testing Network-Filtering Devices
        Denial of Service Emulation
    Outsourcing Penetration Testing Services
        Terms of Engagement
        Project Scope
        Pentest Service Level Agreements
        Penetration Testing Consultants
    Evaluating Different Types of Pentest Tools
    Application Security Assessment Tool
        Webscarab
    Network Security Assessment Tool
        Angry IP scanner
        GFI LANguard
    Wireless/Remote Access Assessment Tool
        Kismet
    Telephony Security Assessment Tool
        Omnipeek
    Testing Network-Filtering Device Tool
        Traffic IQ Professional



Friday, December 2, 2011

Named server ins and out

//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
acl internal { 192.168.0.0/24;};

options {
    listen-on port 53 { 127.0.0.1; 192.168.0.4; };
    listen-on-v6 port 53 { ::1; };
    directory     "/var/named";
    dump-file     "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";

    // Those options should be used carefully because they disable port
    // randomization
    // query-source    port 53;   
    // query-source-v6 port 53;

    allow-query     { localhost; };
    allow-query-cache { localhost; };
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
view internal {
    match-clients        { localhost; internal; };
    match-destinations { localhost; };
    recursion yes;
    zone "aem.example.com" IN {
        type master;
        file "forward.zone";
    };

    zone "0.168.192.in-addr.arpa" IN {
        type master;
        file "reverse.zone";
    };

    include "/etc/named.rfc1912.zones";
};

view localhost_resolver {
    match-clients        { localhost; };
    match-destinations { localhost; };
    recursion yes;
    include "/etc/named.rfc1912.zones";
};

##FORWARD ZONE CONFIGURATION
-----------------------------------------------------
$TTL    86400
@        IN SOA    station4.aem.example.com.       root.aem.example.com. (
                    42        ; serial (d. adams)
                    3H        ; refresh
                    15M        ; retry
                    1W        ; expiry
                    1D )        ; minimum

            IN NS        station4.aem.example.com.
         IN A        192.168.0.4
station4    IN A        192.168.0.4
www        IN A        192.168.0.1
web.aem.example.com.    3600 IN CNAME    www.aem.example.com.


##REVERSE ZONE
------------------------------------------------------

$TTL    86400
@       IN      SOA    station4.aem.example.com. root.aem.example.com.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
@        IN      NS     station4.aem.example.com.
4       IN      PTR     station4.aem.exmaple.com.



--------------------------------------------------------------------------------------------------------------------------------------------




//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
include "/etc/transfer.key";
acl internal { 192.168.0.0/24; };
acl external { 192.168.1.0/24; };
options {
    listen-on port 53 { 127.0.0.1; 192.168.0.2; 192.168.1.102; };
    listen-on-v6 port 53 { ::1; };
    directory     "/var/named";
    dump-file     "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";

    // Those options should be used carefully because they disable port
    // randomization
    // query-source    port 53;   
    // query-source-v6 port 53;

    allow-transfer { key master-slave; };
    allow-query     { localhost; internal; external; };
    allow-query-cache { localhost; internal; external; };
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
view internal {
    match-clients        { localhost; internal; };
    match-destinations { localhost; };
    recursion yes;
    zone "sudipta.example.com" IN {
        type master;   
        file "fw.zone";
    };
    zone "0.168.192.in-addr.arpa" IN {
        type master;
        file "re.zone";
    };
    include "/etc/named.rfc1912.zones";
};
view external {
    match-clients        { localhost; internal; external; };
    match-destinations { localhost; };
    recursion yes;
    zone "sudipta.example.com" IN {
        type master;   
        file "fw1.zone";
    };
    zone "1.168.192.in-addr.arpa" IN {
        type master;
        file "re1.zone";
    };
    include "/etc/named.rfc1912.zones";
};
view localhost_resolver {
    match-clients        { localhost; 192.168.0.0/24; };
    match-destinations { localhost; };
    recursion yes;
    include "/etc/named.rfc1912.zones";
};


fw1.zone
-----------
$TTL    86400
@        IN SOA    station2.sudipta.example.com.       root.sudipta.example.com. (
                    42        ; serial (d. adams)
                    3H        ; refresh
                    15M        ; retry
                    1W        ; expiry
                    1D )        ; minimum

@            IN NS        station2.sudipta.example.com.
@         IN A        192.168.1.102
station2    IN A        192.168.1.102
;;station3    IN A        192.168.0.3
;;station9    IN A        192.168.0.9

;;MX
@        IN MX    10    station2.sudipta.example.com.

;;CNAME
mail.sudipta.example.com.    3600    IN    CNAME    station2


re1.zone
----------------
$TTL    86400
@       IN      SOA     station2.sudipta.example.com. root.sudipta.example.com. (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      station2.sudipta.example.com.
102       IN      PTR     station2.sudipta.example.com.
;;3       IN      PTR     station3.sudipta.example.com.
;;9       IN      PTR     station9.sudipta.example.com.











Thursday, August 5, 2010

Subversion

Subversion server installation and Configuration:
Subversion logo

Subversion server configuration options:

* svnserve: This is a simple stand-alone server which comes with the Subversion release.
* svn+ssh: This is a simple stand-alone server which uses ssh security,
* Apache httpd server with Subversion:
o allows more integration
o allows web server viewing straight from the repository
o ability to mount repository as a network share (WEBDAV capability offered through Apache)

This tutorial covers the Apache-Subversion installation and configuration.

Subversion download options:

* Use the version of Subversion which comes with your release of Linux:
o Red Hat Enterprise Linux 5/CentOS 5 (Apache 2.2, Python 2.4, ...) - Subversion 1.4
o Red Hat Enterprise Linux 4/CentOS 4 (Apache 2.0, Python 2.3, ...) - Subversion 1.1
* Install or upgrade to the DAG RPM Subversion packages with slightly newer but compatible versions.
* Use the latest CollabNet bundled release of Apache, Subversion and ViewVC. Unfortuanetly this is a stripped down version of Apache without support for Perl modules, PHP, etc. This release is what is required to run a Subversion server and the ViewVC web front-end only. It even includes stripped down python support. I could not get this version to work with Apache authentication Perl modules or with Trac.
* Use the Summersoft RPMs. Great for the latest releases of Subversion which will work with the OS release of Apache, Python, etc. Problems arise when trying to put the latest release of Subversion with dependencies on very current versions of framework applications onto an older version of the OS (i.e. installing SVN 1.6.9 on RHEL4). Great for use SVN 1.6.9 with a current OS (i.e. RHEL5)
* Download source and compile. Requires downloads of source and compilation of dependencies as well.

Subversion.Apache.org Subversion downloads page [source]

This tutorial focuses on the version of Subversion which is released with the OS (RHEL4/5 and CentOS 4/5) or compatible DAG upgrades.

Red Hat Enterprise 5 with SVN 1.6.9: (Summersoft RPM upgrade. Default is SVN 1.4)
Download: http://summersoft.fay.ar.us/pub/subversion/1.6.9/rhel5/i386/ (32 bit i386. 64 bit also available)

* mod_dav_svn-1.6.9-1.i386.rpm
* neon-0.28.4-1.i386.rpm (neon-devel-0.28.4-1.i386.rpm)
* sqlite-3.5.9-2.i386.rpm (sqlite-devel-3.5.9-2.i386.rpm)
* subversion-1.6.9-1.i386.rpm (subversion-devel-1.6.9-1.i386.rpm)
* subversion-perl-1.6.9-1.i386.rpm
* subversion-python-1.6.9-1.i386.rpm
* subversion-tools-1.6.9-1.i386.rpm (May require dependency Perl module File::Path RPM package. eg: perl-File-Path-2.03-1.n0i.3.fc8.noarch.rpm. File::Path may also be included with Perl in which case ignore the dependency: rpm -ivh --force subversion-tools-1.6.9-1.i386.rpm)

Installation:

* rpm -Uvh sqlite-3.5.9-2.i386.rpm sqlite-devel-3.5.9-2.i386.rpm
* rpm -ivh neon-0.28.4-1.i386.rpm neon-devel-0.28.4-1.i386.rpm
* rpm -ivh subversion-1.6.9-1.i386.rpm subversion-devel-1.6.9-1.i386.rpm subversion-python-1.6.9-1.i386.rpm subversion-perl-1.6.9-1.i386.rpm mod_dav_svn-1.6.9-1.i386.rpm

Note:

* The "devel" RPMs provide C language include files and libraries for open source development and are not required unless you plan to build an application which requires the "devel" RPMs.
* May be required to remove existing SNV installation to avoid conflicts: rpm -e subversion subversion-devel

Red Hat Enterprise 4 with SVN 1.1.4: (RHEL4 default)
Install from RPM (RHEL4): rpm -ivh subversion-1.1.4-2.ent.i386.rpm

Red Hat Enterprise 4 with SVN 1.4.2: (Dag Wieers upgrade RPMs)
http://dag.wieers.com/rpm/packages/subversion/
Upgrade: rpm -Uvh subversion-tools-1.4.2-1.i386.rpm subversion-python-1.4.2-1.i386.rpm subversion-perl-1.4.2-1.i386.rpm subversion-1.4.2-1.i386.rpm mod_dav_svn-1.4.2-1.i386.rpm apr-0.9.12-1.i386.rpm apr-devel-0.9.12-1.i386.rpm apr-util-0.9.12-1.i386.rpm

Installation of Subversion 1.4.6 using RPMs from DAG on Red Hat Enterprise Linux 5 (or CentOS 5) is almost exactly the same.

Ubuntu: apt-get install subversion enscript libapache2-mod-python python-docutils db4.3-util libapache2-svn subversion-tools

Subversion Repository Creation:

There are two database options available for the Subversion repository creation.

* FSFS:
* Berkeley DB:

Discussion of differences and merits of FSFS vs Berkeley DB.

Create a Subversion repository using the FSFS database format: (as root)

* mkdir /srv/svn/repos
* svnadmin create --fs-type fsfs /srv/svn/repos
* chown apache:apache -R /srv/svn/repos
(The Apache web server running as user "apache" is the process owner which will be interfacing with the Subversion repository.)
* SELinux security attribute assignment: (Red Hat EL4+, Fedora 3+)
restorecon -R /srv/svn/repos
or
chcon -R -h -t httpd_sys_content_t /srv/svn/repos"
Options:
o -h: affect symbolic links instead of any referenced file
o -t: set type TYPE in the target security context
o -R: change files and directories recursively

(Required for SELinux systems so that apache can write to this area or turn off SELinux. For more info see the YoLinux SysAdmin/SELinux tutorial)

This will create the default database files, configuration files and directory structure required to support Subversion. The choice of repository type is stored in /srv/svn/repository-name/db/fstype. In this case if you "cat" the file it will show "fsfs".

Apache Web Server Configuration for Subversion:

Subversion can be configured to use a local file system (NOT a network filesystem!!!), it's own server (svnserve) or use Apache and the webdav interface. This configuration shows the Subversion installation configured with Apache on Red Hat Enterprise 4 (RHEL4).

Apache configuration file: /etc/httpd/conf.d/subversion.conf

* This example performs no authentication:
view source
print?
01 # Required for Apache interface
02 LoadModule dav_svn_module modules/mod_dav_svn.so
03
04 # Required for "per-directory" access control
05 LoadModule authz_svn_module modules/mod_authz_svn.so
06
07 # URL path in web browser after "http://yourdomain.com/": /svn
08
09 DAV svn
10 # Local path on server filesystem: /srv/svn/repos
11 SVNPath /srv/svn/repos
12


* This example authenticates to a local Apache user password file: User logins and passwords have no connection to user accounts.
view source
print?
01 LoadModule dav_svn_module modules/mod_dav_svn.so
02 LoadModule authz_svn_module modules/mod_authz_svn.so
03
04 DAV svn
05 SVNPath /srv/svn/repos
06 AuthType Basic
07 AuthName "Subversion Repository"
08 AuthUserFile /etc/httpd/conf/userpw
09 require valid-user
10

Remove the line "require valid-user" to allow read-only access for unauthenticated users.

For more on Apache user file authentication see:
o YoLinux Apache Authentication: User File Authenticated Logins

* This example authenticates logins with the NIS server. This requires the installation of perl modules Apache-AuthenNIS. See the YoLinux Apache NIS authentication tutorial (See this tutorial if running Apache httpd 2.2)
view source
print?
01 LoadModule dav_svn_module modules/mod_dav_svn.so
02 LoadModule authz_svn_module modules/mod_authz_svn.so
03
04 DAV svn
05 SVNPath /srv/svn/repos
06 AuthType Basic
07 AuthName "Subversion Repository"
08 PerlAuthenHandler Apache::AuthenNIS
09 PerlSerVar AllowAlternateAuth no
10 require valid-user
11

This example is for RHEL4 with Apache httpd 2.0.

See Subversion manual: authentication options for more information.

YoLinux.com Apache authentication tutorial - password file, NIS, LDAP, ...

Allow the web server to control content: chown -R apache:apache /srv/svn

Restart Apache: service httpd restart

Importing Directory of Files Into Subversion:

Subversion Repository on Server File system:

* /srv/svn/repos

Import directory of files into Subversion:

* Local directory to import into Subversion:
o projectX/trunk/...source code goes here...
o projectX/branches
o projectX/tags
* svn import -m "Initial Import" local-directory-projectX http://server-name/svn/projectX
The import will create the new subdirectory branch "projectX" in the repository.

Alternate directory creation method: (repository exists but the directories need to be generated)

* svn mkdir -m"Initial creation of trunk directory" http://svn-server/svn/projectX/trunk
* svn mkdir -m"Initial creation of branches directory" http://svn-server/svn/projectX/branches
* svn mkdir -m"Initial creation of tags directory" http://svn-server/svn/projectX/tags

Browser view of a typical repository directory schema:

* http://svn-server/svn/projectX/trunk: For the "HEAD"
* http://svn-server/svn/projectX/branches: For branches or "forks" in the code.
* http://svn-server/svn/projectX/tags: For tags identifying snapshots of milestones or significant releases.

Explanation of Subversion directories:

* /trunk : Contains the current development branch. New projects should be started here.
* /branches : A branch is just a special copy of the source tree within Subversion that started with a specific revision of the code. A branch is created by using "svn copy" of the trunk to a branch i.e. /branch/name_of_branch_1.0.
* /branches/personal : Personal branches are for doing some work which you don't want to have interfere with the main trunk until it is working or better defined.
* /tags : This is a ethod of bookmarking or taking a "snapshot" of some work in progress.
* /releases : This is similar to "tags" except that this version of the code makes it to production. Names used here should match product release names. i.e. version_1.1

Avoiding false diffs due to "^M" in a cross platform environment:
The Microsoft development tools love to add a "^M" at the end of the line of every file they edit. This breaks UNIX shell script and causes many file difference tools to show a difference in a line of code. This can be avoided in a cross platform environment by telling Subversion that certain files (or all files) that no "^M"'s should be appended at the end of a line. The trigger in fact removes the "^M" when the file is checked in. It can also be removed using the command dos2unix.

Import files to support no "^M" carriage returns at the end of lines:
(This sets file properties and creates a check-in trigger.)

* Remove "^M" from files: find local-directory -name "*.cpp" -exec dos2unix {} \;
* Upload directory of files into Subversion:
svn import -m "Initial Import" local-directory http://server-name/svn/projectX
* Checkout files from repository: svn co http://server-name/svn/projectX/trunk
This creates your local working directory under Subversion control.
* Set file properties such that "^M" are removed during check-in if added:
find ./ -name "*.cpp" -exec svn propset svn:eol-style LF {} \;
* Apply property changes to repository: svn ci -m "Apply LF properties" local-directory

Note that the "propset" command must be used for new files added to the Subversion repository if they are to have these properties.

Users can also set this option in the file: $HOME/.subversion/config

..
...

[auto-props]
README = svn:eol-style=native
INSTALL = svn:eol-style=native
*.c = svn:eol-style=LF
*.cpp = svn:eol-style=LF
*.h = svn:eol-style=LF
*.dsp = svn:eol-style=CRLF
*.dsw = svn:eol-style=CRLF
*.sh = svn:eol-style=native;svn:executable
*.txt = svn:eol-style=LF
*.png = svn:mime-type=image/png
*.jpg = svn:mime-type=image/jpeg
Makefile = svn:eol-style=LF
*.html = svn:eol-style=LF
*.css = svn:eol-style=LF
*.java = svn:eol-style=LF
*.xml = svn:eol-style=LF
*.m4 = svn:eol-style=LF
*.pdf = svn:mime-type=application/pdf

...
..

Subversion Repository Transfer:

Data repository dump:

* Dump first entry to current:
svnadmin dump /srv/svn/repos --revision 0:HEAD > repos.dump
* Dump revision 625 to current:
svnadmin dump /srv/svn/repos --revision 625:HEAD --incremental > repos-625.dump

Data repository load:

* First load: svnadmin load /srv/svn/repos < repos.dump
* Incremental load: svnadmin load /srv/svn/repos < repos-625.dump

For more complex transfers with path translation, see the YoLinux Subversion repository data transfer tutorials.

Subversion Repository Backups:

The following is a cron job to dump the repository to an ascii file as a backup:

File: /etc/cron.daily/CmSvnDump.sh
view source
print?
1 #!/bin/bash
2 #
3 cd /mnt/backup/cm
4 /etc/init.d/httpd stop
5 umask 002
6 /usr/bin/svnadmin dump /srv/svn/projectX --revision 0:HEAD > CmSvnDump-`date +%m%d%y`.dump
7 /etc/init.d/httpd start
SELinux requirement: chcon -u system_u -t bin_t CmSvnDump.sh

Subversion XSLT:

The best presentation interface is "Insurrection" detailed below. For a quick and easy improvement to the Subversion web interface, use the XSLT file which comes with the "subversion-tools RPM".

Create path links:

* ln -s /usr/lib/subversion/tools/xslt/svnindex.xsl /var/www/html/
* ln -s /usr/lib/subversion/tools/xslt/svnindex.css /var/www/html/

or for the 64 bit Summersoft RPM releases:

* ln -s /usr/lib64/subversion/tools/xslt/svnindex.xsl /var/www/html/
* ln -s /usr/lib64/subversion/tools/xslt/svnindex.css /var/www/html/

Add the "SVNIndexXSLT" directive to the file /etc/http/conf.d/subversion.conf

view source
print?
1 LoadModule dav_svn_module modules/mod_dav_svn.so
2
3 DAV svn
4 SVNPath /srv/svn/repos
5
6 SVNIndexXSLT "/svnindex.xsl"
7

The XSLT reference can also be a full URL: SVNIndexXSLT "http://yourdomain/path/svnindex.xsl"

[Potential Pitfall]: Some browsers (like Konquerer), do not process XSLT. This will prohibit them from traversing directories which are rendered with XSLT. This is unfortunate as Konquerer has syntax highlighting for rendering many of the popular programming languages.

Subversion Links:

* Online O'Reily Subversion book
* Subversion Repository Administration (O'Reily Chapter 5)
* Subversion Server configuration (O'Reily Chapter 6)
* WANdisco: Subversion MultiSite
* ViewVC: Web front-end
o ViewVC (installation below)
o ViewVC RPMs

Web Interface Front-ends to Subversion:

While Subversion has a native web interface it does not allow one to view anything but the "HEAD" or latest versions of the files stored. The following web front-ends to Subversion will allow one to view previous file revisions and even perform file comparisons between revisions. Insurrection seems to have a more elegant interface and structure but is more difficult to install and configure.

* ViewVC
* Insurrection

ViewVC:

ViewVC is a Python based web interface to Subversion available in an installable RPM package or can be installed from source.

Install RPM: rpm -ivh viewvc-1.0.5-1.el4.rf.noarch.rpm

Install from source:

* Download from http://www.viewvc.org/download.html
* tar xzf viewvc-1.1.2.tar.gz
* cd viewvc-1.1.2/
* ./viewvc-install
Installation path [/usr/local/viewvc-1.1.2]: /opt/viewvc
* cp /opt/viewvc/bin/cgi/viewvc.cgi /var/www/cgi-bin
* cp /opt/viewvc/bin/cgi/query.cgi /var/www/cgi-bin
* Edit /opt/viewvc/viewvc.conf
(See example below)

Apache configuration file: /etc/httpd/conf.d/viewvc.conf

view source
print?
01 ScriptAlias /viewvc /var/www/cgi-bin/viewvc.cgi
02 ScriptAlias /query /var/www/cgi-bin/query.cgi
03 Alias /viewvc-static /var/www/viewvc
04 #
05
06 Allow from all
07

08
09
10 AuthType Basic
11 AuthName "Authorization Realm"
12 PerlAuthenHandler Apache::AuthenNIS
13 PerlSetVar AllowAlternateAuth no
14 Require valid-user
15

16
17
18 AuthType Basic
19 AuthName "Authorization Realm"
20 PerlAuthenHandler Apache::AuthenNIS
21 PerlSetVar AllowAlternateAuth no
22 Require valid-user
23


File:

* RPM install: /etc/viewvc/viewvc.conf
* Installed from source: /opt/viewvc/viewvc.conf

[general]
svn_roots = projectX: /srv/svn/projectX,projectY: /srv/svn/projectY
default_root = projectX


Try it out: http://localhost/viewvc/

Links:

* ViewVC.org - home page
* Dag.Wieers.com: Red Hat/Fedora RPMs
* RPM.pbone.net: OpenSuSE, Red Hat, Fedora, Mandriva RPMs

Insurrection Installation and Configuration:

Insurrection is a HTML, CSS and XSLT (and some perl) web presentation layer for Subversion. It creates a more functional and feature rich web interface to Subversion. It does not support Opera or browsers without XSLT support. Supports IE/Mozilla and Firefox.

Installation:

* Download using Subversion: svn export http://svn.code-host.net/svn/Insurrection/trunk/
This will download Insurrection to a local directory called "trunk".
OR
* insurrection-100906.tar.gz

Installation:

* Move to web directory: mv trunk /var/www/Insurrection
* Edit files:
o insurrection.conf: Place this file in /etc/httpd/conf.d/
This Apache configuration files needs to be edited to suit your installation. This example is set to replace your /etc/httpd/conf.d/subversion.conf file. Do not duplicate functionality in both.
o insurrection.js: Edit SVN_URL per your Subversion repository.
o insurrection.pl:
Edit and set variables:
+ SVN_REPOSITORIES_URL
+ SVN_AUTH
+ SVN_BASE
* Add a logo image file to your insurrection directory: /var/www/Insurrection/cm.megacorp.com.gif
Note: This is required as the logic checks for the existence of this file to function properly. If using a port other than web port 80, (i.e. port 222) then specify the port: /var/www/Insurrection/cm.megacorp.com:222.gif
* Edit the file /var/www/Insurrection/.htaccess for the gif logo path. May have to edit the SVN_URL location in insurrection.js. Comment out lines referencing ls.cgi in RewriteCond and RewriteRule.

Note that Insurrection's default configuration is set to use a virtual host or a dedicated server for Subversion. This is due to "DocumentRoot" being set to "/". If using a different Apache "DocumentRoot" configuration, edit the directory prefixes in insurrection.xsl.

Links:

* Home page: http://insurrection.tigris.org
* Info

StatSVN: Subversion repository statistics and analytics

StatSVN is a metrics-analysis tool which will provide web reporting and charting of lines of code (LOC), developer activity, file count, file size and project statistics based on Subversion repository activity.

Note that StatSVN requires Java. See the YoLinux.com Java installation tutorial.

Note that StatSVN version 0.4.1 is the last version which does not require an X-Window frame bufffer (thus easy to use with a cron or batch script).

Install and Configure:

* Download the compressed compiled Java file statsvn-0.4.1.zip from sourceforge.
wget http://prdownloads.sourceforge.net/statsvn/statsvn-0.4.1.zip
* Decompress and extract contents of zip file: unzip statsvn-0.4.1.zip
* Install Java program: mv statsvn-0.4.1/statsvn.jar /opt/bin/statsvn.jar

Configuring StatSVN as a cron job:
Create the following cron job script: /etc/cron.daily/StatSVN.sh

view source
print?
01 #!/bin/bash
02 #
03 # Generate the StatSVN web pages
04 #
05 if [ -d /usr/java/latest ]
06 then
07 export PATH=/usr/java/latest/bin:$PATH
08 export JAVA_HOME=/usr/java/latest
09 export CLASSPATH=/usr/java/latest/lib/tools.jar:./
10 else
11 exit
12 fi
13
14 # Update local Subversion repository
15 # Uncomment this line if this script is to update the local working Subversion repository.
16 # svn update /opt/Cabie/BUILDS/buildserver1/trunk
17
18 # Generate Subversion log file
19 svn log -v --xml /opt/Cabie/BUILDS/buildserver1/trunk > \
20 /opt/Cabie/BUILDS/buildserver1/StatSVN/logfile.log
21
22 # Create web content here:
23 cd /opt/Cabie/BUILDS/buildserver1/StatSVN
24
25 # Generate web content
26 java -jar /opt/bin/statsvn.jar -viewvc http://cmserver.yourdomain.com/viewvc/ProjectX/trunk/application1/ \
27 -output-dir /opt/Cabie/BUILDS/buildserver1/StatSVN/html \
28 /opt/Cabie/BUILDS/buildserver1/StatSVN/logfile.log \
29 /opt/Cabie/BUILDS/buildserver1/ProjectX/trunk/application1/
30
Specify the correct directory paths for your configuration:

* Subversion local checkout directory: /opt/Cabie/BUILDS/buildserver1/trunk
(Our is located on our Cabie build server. See the YoLinux Cabie tutorial.)
* Path for Subversion metrics-analysis web pages created by StatSVN which is also accessible to the Apache web server: /opt/Cabie/BUILDS/buildserver1/StatSVN
* Temporary log file: /opt/Cabie/BUILDS/buildserver1/StatSVN/logfile.log
(Can also use /etc/logfile.log)
* If using SELinux, you will be required to change the security context of this script file so that cron can execute it. This method copies an existing cron script context of an existing cron script:

chcon --reference=/etc/cron.daily/makewhatis.cron /etc/cron.daily/StatSVN.sh

Note in this installation, our Cabie build server updates the local repository after every check-in. If your repositry is not updated automatically, uncomment the line in the script to do so.

[Potential Pitfall]: Cron jobs execute as root. You may have to specify an alternative login and password which has access to the Subversion repository. e.g.
svn log -v --xml --username userX --password supersecret /opt/Cabie/BUILDS/...

Create a local specific non-system account Subversion login for the cron job.
See Concurrent file and LDAP Apache authentication.
Avoid interactive dialog during the cron job by setting the following Subversion configuration parameter setting in /root/.subversion/servers (Cron jobs run as user root)

[global]
store-plaintext-passwords = no

This will avoid the following interactive message: Store password unencrypted (yes/no)?

Command Line Options:
statsvn.jar command line options: (Usage: java -jar statsvn.jar [options] )

Option Description
-version print the version information and exit
-output-dir directory where HTML suite will be saved
-include include only files matching pattern, e.g. **/*.c;**/*.h
-exclude exclude matching files, e.g. tests/**;docs/**
-tags show matching tags in lines of code chart, e.g. version-.*
-title Project title to be used in reports <br /> -viewvc <url> Integrate with ViewVC installation at <url> <br /> This option causes StatSVN to generate hyperlinks to ViewVC for source code file names listed by StatSVN. <br /> -trac <url> integrate with Trac at <url> <br /> -bugzilla <url> integrate with Bugzilla installation at <url> <br /> -username <svnusername> username to pass to svn <br /> -password <svnpassword> password to pass to svn <br /> -verbose print extra progress information <br /> -xdoc optional switch output to xdoc <br /> -xml optional switch output to xml <br /> -threads <int> how many threads for svn diff (default: 25) <br /> -concurrency-threshold <millisec> switch to concurrent svn diff if 1st call > threshold (default: 4000) <br /> -dump dump the Repository content on console <br /> -charset <charset> specify the charset to use for html/xdoc <br /> -tags-dir <directory> optional, specifies the director for tags (default '/tags/') <br /> <br />Apache configuration so that StatSVN reports are viewable: <br /> <br /> File: /etc/httpd/conf.d/statsvn.conf <br /> view source <br /> print? <br /> 1 Alias /StatSVN /opt/Builds/buildserver1/StatSVN/html <br /> 2 <Directory "/opt/Builds/buildserver1/StatSVN/html"> <br /> 3 Options Indexes FollowSymLinks <br /> 4 AuthType Basic <br /> 5 ... <br /> 6 </Directory> <br /> View with browser: http://cmserver.yourdomain.com/StatSVN/ <br /> <br /> In this example the web content will be in /opt/Cabie/BUILDS/buildserver1/StatSVN/html. Apache must be configured to view this directory. See the YoLinux Apache Web server configuration tutorials. <br /> <br />StatSVN version 5.0 and above require X-Windows to support Java Swing classes used by statsvn.jar. If running via a cron or batch job, one will have to set up a virtual frame buffer. I never got this to work successfully so I just used StatSVN 0.4.1 instead. <br />Virtual frame buffer configuration: <br /> <br /> * Install Xvfb: <br /> o yum update xorg-x11-server-Xorg <br /> o yum install xorg-x11-server-Xvfb <br /> * /usr/bin/Xvfb :2 -nolisten tcp -shmem & <br /> * export DISPLAY=:2.0 <br /> * Run statsvn.jar here <br /> * killall Xvfb <br /> <br />Note that it would be preferable to start Xvfb with an init script so that it starts and stops when the system boots and shuts down. See the YoLinux.com init process tutorial. <br /> <br />Links: <br /> <br /> * StatSVN.org - home page <br /> * Sourceforge Page <br /> * statSVN example report <br /> <br />Trac Server Installation and Configuration: <br /> <br />Red Hat EL4: RPM installation (Red Hat Enterprise Linux 4 [Python 2.3], Trac 0.9.6 example) <br /> <br /> * http://dag.wieers.com: <br /> (Select: Home made + RPM repository + RPMforge) <br /> o trac-0.9.6-1.el4.rf.noarch.rpm <br /> o clearsilver-0.10.1-1.2.el4.rf.i386.rpm <br /> o clearsilver-devel-0.10.1-1.2.el4.rf.i386.rpm <br /> o python-clearsilver-0.10.1-1.2.el4.rf.i386.rpm <br /> o python-imaging-1.1.5-5.el4.i386.rpm <br /> o python-sqlite-1.0.1-1.2.el4.rf.i386.rpm <br /> o sqlite-2.8.16-1.2.el4.rf.i386.rpm <br /> o sqlite-devel-2.8.16-1.2.el4.rf.i386.rpm <br /> * http://rpm.pbone.net: <br /> o python-docutils-0.4-2.el4.noarch.rpm <br /> <br /> or configure YUM and import from the DAG YUM repository. See the YoLinux SysAdmin Tutorial: YUM <br /> <br /> yum install -y trac <br /> <br />Red Hat EL5: manual installation from source (Red Hat Enterprise Linux 5 [Python 2.4, sqlite], Trac 0.11.5 example) <br /> <br /> Note: <br /> <br /> * Clearsilver web templates depricated, now uses Genshi. Trac 0.11.5 required to support Subversion 1.6.X. <br /> * If upgrading, remove old version. See: /usr/lib/python2.3/site-packages/trac/, /usr/share/trac/, /srv/trac/ProjectX/egg_cache/, /usr/bin/trac-admin and tracd <br /> * RHEL5 package prerequisites: python, python-setuptools, httpd <br /> <br /> Installation: <br /> <br /> * Download: http://trac.edgewall.org/wiki/TracDownload <br /> * tar xzf Trac-0.11.5.tar.gz <br /> * cd Trac-0.11.5/ <br /> * List commands: python ./setup.py --help <br /> * Install: python ./setup.py install <br /> o This installs the Python template package Genshi <br /> o Installs Trac to /usr/lib/python2.4/site-packages/Trac-0.11.5-py2.4.egg/ <br /> o Installs commands (trac-admin, tracd): /usr/bin <br /> [Potential Pitfall]: If the Trac install fails to download and install Genshi, one can manually install it: <br /> o Download from: http://genshi.edgewall.org/wiki/Download <br /> (or wget http://ftp.edgewall.com/pub/genshi/Genshi-0.5.1.tar.gz) <br /> o tar xzf Genshi-0.5.1.tar.gz <br /> o cd Genshi-0.5.1/ <br /> o python setup.py install <br /> Then attempt to install Trac again: python ./setup.py install <br /> * Install CGI: cp cgi-bin/trac.cgi cgi-bin/trac.fcgi /var/www/cgi-bin <br /> Note: <br /> o Set environment variable (Trac 0.11+) in /etc/httpd/conf.d/trac.conf: <br /> SetEnv PYTHON_EGG_CACHE /srv/trac/projectX/egg_cache <br /> o Create the directory /srv/trac/projectX/egg_cache as it must be present even if not used. <br /> * Create new project repository: <br /> <br /> # trac-admin /srv/trac/projectX initenv <br /> Project Name [My Project]> projectX <br /> Database connection string [sqlite:db/trac.db]> <br /> Path to repository [/path/to/repos]> /srv/svn/projectX <br /> <br /> <br />Ubuntu: apt-get install trac <br /> <br />Allow Trac CGI to be executed (Two methods. Pick one.): <br /> <br /> 1. Copy the CGI to the default CGI bin directory: cp /usr/share/trac/cgi-bin/trac.cgi /var/www/cgi-bin <br /> OR <br /> 2. Enable Apache to execute the CGI: <br /> <br /> view source <br /> print? <br /> 1 .. <br /> 2 ScriptAlias /trac /usr/share/trac/cgi-bin/trac.cgi <br /> 3 .. <br /> <br />Note:The CGI trac.fcgi is for use with Apache Python module mod_fastcgi to improve performance. <br /> <br />As root: [root]# trac-admin /srv/trac/projectX initenv <br /> <br /> Project Name [My Project]> projectX <br /> Database connection string [sqlite:db/trac.db]> <br /> Path to repository [/var/svn/test]> /srv/svn/projectX <br /> Templates directory [/usr/share/trac/templates]> <br /> <br /> <br /> Note: <br /> <br /> * The directory /srv/trac MUST exist. <br /> * The directory /srv/trac/projectX MUST not exist before execution of command. <br /> <br /> Trac repository directories: <br /> <br /> * SuSE: /srv/trac/ <br /> * Red Hat: /usr/share/trac/proj_trac/ <br /> <br />This command will initialize the Trac data repository and create a directory structure and default configuration files. <br /> <br />Allow paths and files to be accessible by Apache: [root]# chown -R apache:apache /srv/trac/projectX <br /> <br />SELinux: <br /> <br /> * chcon -R -t httpd_sys_content_t /usr/share/trac/ <br /> * chcon -R -t httpd_sys_content_t /srv/trac/ <br /> <br />Component Home pages: <br /> <br /> * Trac <br /> * Clearsilver <br /> * Docutils <br /> * Python Imaging <br /> * pySQLite <br /> * SQLite.org <br /> <br />Trac Configuration: <br /> <br />File: /srv/trac/projectX/conf/trac.ini <br />(Created using the "trac-admin" command above and not provided by the RPM package.) <br /> <br /> Specify project URL: <br /> <br /> .. <br /> ... <br /> <br /> [trac] <br /> ... <br /> repository_dir = /srv/svn/projectX - This ties Trac to Subversion <br /> <br /> ... <br /> ... <br /> <br /> [notification] <br /> Set email and SMTP information here <br /> <br /> ... <br /> ... <br /> <br /> [project] <br /> url = http://projectX.com <br /> <br /> <br /> For more trac.ini configuration information see Trac: trac.ini configuration <br /> <br />[Potential Pitfall]: Once Trac is configured and used (i.e. it has tickets, etc), it can not be pointed to a different Subversion repository. If you point "repository_dir" to a new Subversion repository, you will not have a Trac database which is in sync with Subversion and Trac will fail. The name of the directory path and the "repository_dir" can be renamed with matching names, but the actual Subversion repository must remain the same. <br /> <br />Apache Web Server configuration file for Trac integration: <br /> <br />Trac can be run using the stand-alone Trac daemon "tracd". This configuration shows the use of Apache with Trac. <br /> <br />File: /etc/httpd/conf.d/trac.conf <br /> <br /> * This example performs no authentication: <br /> view source <br /> print? <br /> 1 Alias /trac/ "/usr/share/trac/htdocs/" <br /> 2 <Location "/cgi-bin/trac.cgi"> <br /> 3 SetEnv TRAC_ENV "/srv/trac/projectX" <br /> 4 </Location> <br /> or Red Hat Dag.Wieers.com rpm installation example: <br /> view source <br /> print? <br /> 1 ScriptAlias /trac /usr/share/trac/cgi-bin/trac.cgi <br /> 2 <Location "/trac"> <br /> 3 SetEnv TRAC_ENV "/srv/trac/projectX" <br /> 4 </Location> <br /> <br /> * This example authenticates logins internally using Apache. User logins and passwords have no connection to user accounts. <br /> view source <br /> print? <br /> 01 Alias /trac/ "/usr/share/trac/htdocs/" <br /> 02 <Location "/cgi-bin/trac.cgi"> <br /> 03 SetEnv TRAC_ENV "/srv/trac/projectX" <br /> 04 </Location> <br /> 05 <br /> 06 # The following enables the "login" link in Trac. <br /> 07 # (Top right hand corner) <br /> 08 <br /> 09 <Location "/cgi-bin/trac.cgi/login"> <br /> 10 AuthType Basic <br /> 11 AuthName "Project X Trac" <br /> 12 AuthUserFile /etc/httpd/conf/userpw <br /> 13 require valid-user <br /> 14 </Location> <br /> For more on Apache user file authentication see: <br /> o YoLinux Apache Authentication: User File Authenticated Logins <br /> <br /> * This example authenticates logins internally using Trac and Digest authentication. User logins and passwords have no connection to user accounts. <br /> view source <br /> print? <br /> 01 Alias /trac/ "/usr/share/trac/htdocs/" <br /> 02 <Location "/cgi-bin/trac.cgi"> <br /> 03 SetEnv TRAC_ENV "/srv/trac/projectX" <br /> 04 </Location> <br /> 05 <br /> 06 # The following enables the "login" link in Trac. <br /> 07 # (Top right hand corner) <br /> 08 <br /> 09 <Location "/cgi-bin/trac.cgi/login"> <br /> 10 AuthType Digest <br /> 11 AuthName "Project X Trac" <br /> 12 AuthDigestDomain /trac <br /> 13 AuthDigestFile /etc/httpd/conf/digestpw <br /> 14 require valid-user <br /> 15 </Location> <br /> For more on digest authentication see: <br /> o Apache.org: Module mod_auth_digest <br /> o RFC 2617 <br /> <br /> * This example authenticates user account logins with the NIS server. This requires the installation of perl modules Apache-AuthenNIS. See the YoLinux Apache NIS authentication tutorial (See this tutorial if running Apache httpd 2.2) <br /> view source <br /> print? <br /> 01 Alias /trac/ "/usr/share/trac/htdocs/" <br /> 02 <Location "/cgi-bin/trac.cgi"> <br /> 03 SetEnv TRAC_ENV "/srv/trac/projectX" <br /> 04 AuthType Basic <br /> 05 AuthName "Project X Trac" <br /> 06 PerlAuthenHandler Apache::AuthenNIS <br /> 07 PerlSerVar AllowAlternateAuth no <br /> 08 require valid-user <br /> 09 </Location> <br /> 10 <br /> 11 # The following enables the "login" link in Trac. <br /> 12 # (Top right hand corner) <br /> 13 <br /> 14 <Location "/cgi-bin/trac.cgi/login"> <br /> 15 AuthType Basic <br /> 16 AuthName "Project X Trac" <br /> 17 PerlAuthenHandler Apache::AuthenNIS <br /> 18 PerlSerVar AllowAlternateAuth no <br /> 19 require valid-user <br /> 20 </Location> <br /> Auth configuration prohibits anonymous use of Trac <br /> <br /> This example is for RHEL4 with Apache httpd 2.0. <br /> <br />Restart Apache: service httpd restart <br /> <br />Also see YoLinux Apache authentication tutorial: LDAP, NIS, File. <br /> <br />Trac Administration: <br /> <br />Issue Trac commands as root: <br /> <br /> * Command line: trac-admin --help <br /> OR <br /> * Enter into Trac Admin shell: trac-admin /srv/trac/projectX <br /> Then type "help" to see list of commands. <br /> Use the command "quit" to exit the shell. <br /> <br />Set Permissions: <br /> <br /> * Grant administration privileges to a user: <br /> <br /> trac-admin /srv/trac/projectX permission add userid TRAC_ADMIN <br /> <br /> <br /> These permissions are required if using web interface to manage "roadmaps". <br /> * Show permissions: <br /> <br /> trac-admin /srv/trac/projectX permission list user-id <br /> <br /> * Remove write for anonymous users: <br /> <br /> trac-admin /srv/trac/projectX permission remove anonymous TICKET_CREATE TICKET_MODIFY WIKI_CREATE WIKI_MODIFY <br /> <br /> * Set default for authenticated users: <br /> <br /> trac-admin /srv/trac/projectX permission add authenticated TICKET_CREATE TICKET_MODIFY TICKET_VIEW WIKI_CREATE WIKI_MODIFY <br /> <br />Add components to be managed by Trac: <br /> <br /> * Roadmap/Product Milestones: <br /> o trac-admin /srv/trac/projectX milestone add name-of-milestone YYYY-MM-DD <br /> o trac-admin /srv/trac/projectX milestone completed name-of-milestone YYYY-MM-DD <br /> (Where "YYYY-MM-DD" is the due date or completion date. i.e. 2006-11-17) <br /> The milestones can be created using the web interface. <br /> * Software Components: trac-admin /srv/trac/projectX component add name-of-component owner-id <br /> <br />Defaults for "New Ticket": <br /> <br /> * Type: defect, enhancement, task <br /> View using the command: trac-admin /srv/trac/projectX ticket_type list <br /> Use "add" or "delete" to change the default. <br /> * Priority: blocker, critical, major, minor, trivial <br /> View using the command: trac-admin /srv/trac/projectX priority list <br /> Use "add" or "delete" to change the default. <br /> * Severity: highest, high, normal, low, lowest <br /> View using the command: trac-admin /srv/trac/projectX severity list <br /> Use "add" or "delete" to change the default. <br /> <br />Trac-Admin commands: trac-admin /path/to/projenv [command [subcommand] [option ...]] <br /> <br /> Command Description <br /> about Shows information about trac-admin <br /> help Show documentation <br /> initenv Create and initialize a new environment interactively <br /> initenv <projectname> <db> <repospath> <templatepath> Create and initialize a new environment from arguments <br /> hotcopy <backupdir> Make a hot backup copy of an environment <br /> resync Re-synchronize trac with the repository <br /> upgrade Upgrade database to current version <br /> wiki list List wiki pages <br /> wiki remove <name> Remove wiki page <br /> wiki export <page> [file] Export wiki page to file or stdout <br /> wiki import <page> [file] Import wiki page from file or stdin <br /> wiki dump <directory> Export all wiki pages to files named by title <br /> wiki load <directory> Import all wiki pages from directory <br /> wiki upgrade Upgrade default wiki pages to current version <br /> permission list [user] List permission rules <br /> permission add <user> <action> [action] [...] Add a new permission rule <br /> permission remove <user> <action> [action] [...] Remove permission rule <br /> component list Show available components <br /> component add <name> <owner> Add a new component <br /> component rename <name> <newname> Rename a component <br /> component remove <name> Remove/uninstall component <br /> component chown <name> <owner> Change component ownership <br /> ticket_type list Show possible ticket types <br /> ticket_type add <value> Add a ticket type <br /> ticket_type change <value> <newvalue> Change a ticket type <br /> ticket_type remove <value> Remove a ticket type <br /> ticket_type order <value> up|down Move a ticket type up or down in the list <br /> priority list Show possible ticket priorities <br /> priority add <value> Add a priority value option <br /> priority change <value> <newvalue> Change a priority value <br /> priority remove <value> Remove priority value <br /> priority order <value> up|down Move a priority value up or down in the list <br /> severity list Show possible ticket severities <br /> severity add <value> Add a severity value option <br /> severity change <value> <newvalue> Change a severity value <br /> severity remove <value> Remove severity value <br /> severity order <value> up|down Move a severity value up or down in the list <br /> version list Show versions <br /> version add <name> [time] Add version <br /> version rename <name> <newname> Rename version <br /> version time <name> <time> Set version date (Format: "YYYY-MM-DD" or "now") <br /> version remove <name> Remove version <br /> milestone list Show milestones <br /> milestone add <name> [due] Add milestone <br /> milestone rename <name> <newname> Rename milestone <br /> milestone due <name> <due> Set milestone due date (Format: "YYYY-MM-DD" or "now") <br /> milestone completed <name> <completed> Set milestone completed date (Format: "YYYY-MM-DD" or "now") <br /> milestone remove <name> Remove milestone <br /> Invoking trac-admin without command starts interactive mode. <br /> <br />Use the command trac-admin /srv/trac/projectX wiki list to view Wiki entries. <br /> <br />Trac Page Formatting: <br /> <br /> Display Trac/Wiki Format Code HTML Code Equivalent <br /> A forced line <br /> break. A forced line[[br]]break. A forced line<br>break. <br /> Bold text '''Bold text''' <b> </b> <br /> Italic text ''Italic text'' <i> </i> <br /> Bold italic text '''''Bold italic text''''' <b><i> </i></b> <br /> Underline __Underline__ <u> </u> <br /> Monospace text {{{Monospace text}}} <br /> or <br /> `Monospace text` <tt> </tt> <br /> strike-through ~~strike-through~~ <del> </del> <br /> Textsuperscript ^superscript^ <sup> </sup> <br /> Textsubscript ,,subscript,, <sub> </sub> <br /> ''' !''' <br /> The "!" escapes the Trac Wiki parser. <br /> Heading <br /> = Heading = Same as HTML "h1" <br /> Subheading <br /> == Subheading == Same as HTML "h2" <br /> Smaller subheading <br /> ===Smaller subheading=== Same as HTML "h3" <br /> Text line 1 <br /> Text line 2 Text line 1[[BR]]Text line 2 HTML line break <br> <br /> <br /> * List item one <br /> * List item two <br /> o Nested item <br /> <br /> <br /> <br /> * List item one <br /> * List item two <br /> * Nested item <br /> <br /> Note: A blank space must be present before the "*". <br /> HTML unordered list: <br /> <ul> <br /> <li>List item one</li> <br /> <li>List item two <br /> <ul> <br /> <li>Nested item</li> <br /> </ul></li> <br /> </ul> <br /> <br /> 1. List item one <br /> 1. Nested item <br /> 2. List item two <br /> 1. Nested item <br /> <br /> <br /> <br /> 1. List item one <br /> i. Nested item <br /> 2. List item two <br /> a Nested item <br /> <br /> Note: A blank space must be present before the list item: "1" <br /> HTML ordered list: <br /> <ol> <br /> <li>List item one <br /> <ol type="lower-roman"> <br /> <li>Nested item</li> <br /> </li> <br /> <li>List item two <br /> <ol type="lower-alpha"> <br /> <li>Nested item</li> <br /> </ol></li> <br /> </ol> <br /> Cell 1 Cell 2 Cell 3 <br /> Cell 4 Cell 5 Cell 6 <br /> <br /> <br /> ||Cell 1||Cell 2||Cell 3|| <br /> ||Cell 4||Cell 5||Cell 6|| <br /> <br /> <table border> <br /> <tr><td>Cell 1</td><td></td>Cell 2</td><td></td>Cell 3</td></tr> <br /> <tr><td>Cell 4</td><td></td>Cell 5</td><td></td>Cell 6</td></tr> <br /> </table> <br /> [[Image(http://URL-goes-here/images/image-file.gif)]] <br /> <br /> (URLs ending in .png, .gif or .jpg are interpreted as image links. See "Creating Wiki links" below) <br /> <img src="http://URL-goes-here/images/image-file.gif> <br /> For more information on Trac Wiki formatting, see WikiFormatting <br /> <br />Creating Wiki links: <br /> <br /> * Web URL: [http://URL-goes-here Link text goes here] <br /> (Traditional HTML link) <br /> * Create a link to a Trac Milestone: <br /> o milestone:1.2 <br /> o milestone:"Release maui" <br /> * Create link to Subversion for given revision changeset: <br /> o [subversion-revision-number-goes-here] <br /> o r207, r209 <br /> o changeset:207 <br /> Prefix the Subversion revision number with the letter "r" to have Wiki formatting create a link to the Subversion revision logs. <br /> * Create link to Subversion revision logs: <br /> o r3:5 <br /> o [3:5] <br /> o log:branches/version6.2-beta#3:5 <br /> Where "version6.2-beta" is the name of the branch for which logs are to be reported. <br /> * Create link to Trac ticket: <br /> o #ticket-number-goes-here <br /> o #45 <br /> Note: To escape the "#" without making it a link, prefix with a "!". i.e. !#45 will not generate a link. <br /> o ticket:45 <br /> * Create link to a specific file: <br /> o source:trunk/dira/dirb/file.cpp <br /> o source:"trunk/dira/dirb/file with spaces.cpp" <br /> (Files with spaces in the name should be encapsulated in quotes.) <br /> * Create link to a specific revision of a file: source:trunk/dira/dirb/file.cpp#207 <br /> * Create link to a report: <br /> o {report-number-goes-here} <br /> o report:report-number-goes-here <br /> * Create link to Wiki page: CamelCaseStringGoesHere <br /> This becomes a link to an HTML page of the same name. <br /> * Link to a Trac Wiki attachment: attachment:presentation.ppt <br /> <br />Use the command trac-admin /srv/trac/projectX wiki list to view Wiki entries. <br /> <br />The Trac SQL Database: <br /> <br />One can access the Trac SQLite database directly: <br /> <br /> Sample session: (response not included) <br /> <br /> [prompt]$ cd /srv/trac/projectX/db <br /> [prompt]$ sqlite trac.db <br /> sqlite> .help <br /> sqlite> .tables <br /> sqlite> .schema ticket <br /> sqlite> SELECT * FROM ticket; <br /> sqlite> .exit <br /> <br />Backup and restore: <br /> <br /> Dump database: <br /> <br /> [prompt]$ cd /srv/trac/projectX/db <br /> [prompt]$ sqlite trac.db <br /> sqlite> .outfile /tmp/trac.sql <br /> sqlite> .dump <br /> sqlite> .exit <br /> <br /> Load database: <br /> <br /> [prompt]$ cd /srv/trac/projectX/db <br /> [prompt]$ rm trac.db <br /> [prompt]$ sqlite trac.db <br /> sqlite> .read /tmp/trac.sql <br /> sqlite> .exit <br /> [prompt]$ trac-admin trac resync <br /> <br />Trac database schema <br /> <br />Database migration: (from /usr/share/trac/proj_trac/projectX/db) <br /> <br /> * Upgrade: sqlite trac.db .dump | sqlite3 tracV3.db <br /> Typically this would have to be accompanied with a Trac database and environment upgrade: <br /> <br /> trac-admin /usr/share/trac/proj_trac/projectX upgrade <br /> <br /> <br /> and a Trac wiki manual upgrade: <br /> <br /> trac-admin /usr/share/trac/proj_trac/projectX wiki upgrade <br /> <br /> * Downgrade: sqlite3 trac.db .dump | sqlite tracV2.db <br /> Typically this would have to be accompanied with a Trac database table downgrade: <br /> <br /> sqlite3 trac.db "update system set value=20 where name='2'" <br /> <br />Rename database to "trac.db" to be usable. <br /> <br />Trac User Registration: <br /> <br />Trac can assign new tickets (bugs/enhancements) to developers registered in the system. It can also communicate via email. To register, a user must login to Trac and: <br /> <br /> * Select the "Settings" link at the top right hand side of the web page. <br /> * Enter your name and email address. <br /> <br />Trac Upgrades: <br /> <br />After an upgrade to Trac, the configuration and data files you employ must also be upgraded. The RPM upgrades miss this so perform manually: <br /> <br /> trac-admin /srv/trac/projectX upgrade <br /> <br />Upgrading OS from RHEL4 to RHEL5: <br />This OS upgrade will upgrade the version of the embedded database package sqlite. The following must be performed for any OS upgrade which will also upgrade the Trac database environment. <br /> <br /> * Prior to the OS upgrade, dump the database to a text file: <br /> o cd /srv/trac/projectX/db <br /> o sqlite trac.db .dump > trac.dump_sqlite <br /> * Upgrade the OS <br /> * Import the database using the newer version of sqlite <br /> o cd /srv/trac/projectX/db <br /> o cat trac.dump_sqlite | sqlite3 trac.db <br /> Note that Trac requires the database name trac.db <br /> * Upgrade the trac repository: trac-admin /srv/trac/projectX upgrade <br /> * Upgrade wiki: trac-admin /srv/trac/projectX wiki upgrade <br /> * Synchronize Trac with Subversion: trac-admin /srv/trac/projectX resync <br /> This step is required when Subversion is upgraded (i.e. 1.4.2 to 1.6.9) <br /> <br />Trac Links: <br /> <br /> * Trac home page <br /> <br />Also see /usr/share/doc/trac-... for local documentation. <br /> <br />Trac plugins: <br /> <br />Trac plugins are available to enhance Trac functionality. The plugins require some Python infrastructure for installation. Install the Python package "setuptools" which includes command "easy_install". The following is an example for Red Hat Enterprise 4 / CentOS 4. Use one of the following two methods to install the command "/usr/bin/easy_install": <br /> <br /> 1. Python script: <br /> * Download the Python script http://peak.telecommunity.com/dist/ez_setup.py <br /> * Run: python ez_setup.py <br /> This will download and run the script: setuptools-0.6c6-py2.3.egg which installs "easy_install". <br /> 2. Egg script: <br /> * Download: http://cheeseshop.python.org/packages/2.4/s/setuptools/setuptools-0.6c6-py2.4.egg <br /> * As root: chmod +x setuptools-0.6c6-py2.3.egg <br /> * Run: ./setuptools-0.6c6-py2.3.egg <br /> <br />Trac "webadmin" plugin installation: <br /> <br />This will no longer be required with Trac version 0.10 or later as it will be integrated into the Trac. <br /> <br />Installation: <br /> <br /> * Use Subversion to download latest webadmin plugin software: <br /> <br /> svn export http://svn.edgewall.com/repos/trac/sandbox/webadmin/ <br /> <br /> This will create the directory webadmin/ and its contents. <br /> * cd webadmin <br /> * Install Trac plugin: easyinstall . <br /> <br />If installing from an egg file: <br /> <br /> * mv TracWebAdmin-0.1.2dev_r4240-py2.3.egg.zip TracWebAdmin-0.1.2dev_r4240-py2.3.egg <br /> * easy_install TracWebAdmin-0.1.2dev_r4240-py2.3.egg <br /> <br />Direct Trac to employ the component "webadmin". Add to end of file: /srv/trac/ProjectX/conf/trac.ini <br /> <br /> ... <br /> .. <br /> <br /> <br /> [components] <br /> webadmin.* = enabled <br /> <br />Apache configuration modification. File: /etc/httpd/conf.d/trac.conf <br /> <br /> view source <br /> print? <br /> 1 <Location "/trac"> <br /> 2 SetEnv TRAC_ENV "/srv/trac/projectX" <br /> 3 SetEnv PYTHON_EGG_CACHE /srv/trac/projectX/egg_cache <br /> 4 <br /> 5 ... <br /> 6 .. <br /> 7 </Location> <br /> <br />Create cache directory: <br /> <br /> * mkdir /srv/trac/ProjectX/egg_cache <br /> * chown apache.apache /srv/trac/ProjectX/egg_cache <br /> <br />Restart apache: service httpd restart <br /> <br />Test to see if plugin has been installed: python -c "import webadmin" <br />The proper response is no output. Error response: "ImportError: No module named webadmin" <br /> <br />The final step is to add the Trac administrator privileges: <br /> <br /> trac-admin /srv/trac/ProjectX permission add user1 TRAC_ADMIN <br /> <br />Users who have been given "TRAC_ADMIN" privileges, will see an extra tab in the Trac toolbar interface labeled "Admin". Select this tab to access the "webadmin" interface to Trac. This interface will allow you to create components, associate components with roadmaps, etc. <br /> <br />Documentation: <br /> <br /> * EasyInstall <br /> * setuptools <br /> <br />Hosting Multiple Subversion and Trac repositories: <br /> <br />SVN Hosting and Multiple Subversion Repositories with Apache: <br /> <br />One can have multiple Subversion repositories on one server. It is encouraged for separate projects. Subversion increments the revision number for each check-in in the repository and it makes the most logical sense to track revisions for a logically grouped set of applications or even a single application. If you want, you can even have a separate repository which links other projects in separate repositories and servers to look logically as one. (See Subversion property svn:externals) <br /> <br />Create repository locations: <br /> <br /> * svnadmin create --fs-type fsfs /srv/svn/reposX <br /> * svnadmin create --fs-type fsfs /srv/svn/reposY <br /> * svnadmin create --fs-type fsfs /srv/svn/reposZ <br /> * ... <br /> <br />Each repository would have a separate "Location" defined in the Apache configuration: <br /> <br /> view source <br /> print? <br /> 01 LoadModule dav_svn_module modules/mod_dav_svn.so <br /> 02 LoadModule authz_svn_module modules/mod_authz_svn.so <br /> 03 <br /> 04 <Location /reposX> <br /> 05 DAV svn <br /> 06 SVNPath /srv/svn/reposX <br /> 07 ... <br /> 08 .. <br /> 09 </Location> <br /> 10 <Location /reposY> <br /> 11 DAV svn <br /> 12 SVNPath /srv/svn/reposY <br /> 13 ... <br /> 14 .. <br /> 15 </Location> <br /> 16 <Location /reposZ> <br /> 17 DAV svn <br /> 18 SVNPath /srv/svn/reposZ <br /> 19 ... <br /> 20 .. <br /> 21 </Location> <br /> All the following URLs would be available: <br /> <br /> * http://yourdomain/reposX/ <br /> * http://yourdomain/reposY/ <br /> * http://yourdomain/reposZ/ <br /> <br /> or specify the "SVNParentPath": <br /> view source <br /> print? <br /> 1 LoadModule dav_svn_module modules/mod_dav_svn.so <br /> 2 LoadModule authz_svn_module modules/mod_authz_svn.so <br /> 3 <br /> 4 <Location /svn> <br /> 5 DAV svn <br /> 6 SVNParentPath /srv/svn <br /> 7 ... <br /> 8 .. <br /> 9 </Location> <br /> All the following URLs would be available: <br /> <br /> * http://yourdomain/svn/reposX/ <br /> * http://yourdomain/svn/reposY/ <br /> * http://yourdomain/svn/reposZ/ <br /> <br />Multiple Trac repositories: <br />Define a Trac parent directory under which you may locate multiple instances of Trac: <br /> <br /> view source <br /> print? <br /> 01 ScriptAlias /trac /usr/share/trac/cgi-bin/trac.cgi <br /> 02 <br /> 03 <Location "/trac"> <br /> 04 SetEnv TRAC_ENV_PARENT_DIR "/srv/trac/trac_projects" <br /> 05 AuthType Basic <br /> 06 AuthName "Trac" <br /> 07 AuthUserFile /srv/passwd/trac.htpasswd <br /> 08 Require valid-user <br /> 09 </Location> <br /> 10 <br /> 11 <LocationMatch "/trac/[^/]+/login"> <br /> 12 AuthType Basic <br /> 13 AuthName "Trac" <br /> 14 AuthUserFile /srv/passwd/trac.htpasswd <br /> 15 Require valid-user <br /> 16 </LocationMatch> <br /> <br /> Note: <br /> <br /> * All trac repositories reside under /srv/trac/trac_projects <br /> i.e. /srv/trac/trac_projects/projectX, /srv/trac/trac_projects/projectY, etc <br /> Web URL: http://server-name/trac/projectX <br /> * This example uses file authentication as defined in /etc/httpd/conf.d/subversion.conf <br /> view source <br /> print? <br /> 1 AccessFileName /srv/passwd/trac.htpasswd <br /> 2 <br /> 3 <Directory /srv/passwd> <br /> 4 Options -Indexes -FollowSymLinks <br /> 5 AllowOverride None <br /> 6 </Directory> <br /> <br />Trac and multiple Subversion repositories and Multiple Trac instances: <br />If using Trac with Subversion, you will be required to create separate Trac instances. Trac can use InterTrac Links to refer to resources of other Trac instances or servers, from within the Wiki markup. Trac can also have a global "trac.ini" file used for multiple instances of Trac. Also see: <br /> <br /> * Trac and Multiple Subversion Repositories <br /> * Configure Apache for multiple Trac projects <br /> * Hosting Multiple Projects <br /> * Access to multiple projects using mod_authz_svn.so <br /> <br />Proposals such as MultiTrac are not available. <br /> <br />Subversion Read-Only Access: <br /> <br />Repositories and directory branches can be configured as read-only. <br /> <br />Apache configuration to use granular Subversion rules: /etc/httpd/conf.d/subversion.conf <br /> <br /> view source <br /> print? <br /> 1 <Location /svn> <br /> 2 DAV svn <br /> 3 SVNParentPath /srv/svn <br /> 4 AuthzSVNAccessFile /srv/config/svn_granular_rules <br /> 5 ... <br /> 6 ... <br /> 7 </Location> <br /> The inclusion of the "AuthzSVNAccessFile" Apache module directive, directs granular access control to the file "/srv/config/svn_granular_rules". <br /> <br />Granular directory level access rules: /srv/config/svn_granular_rules <br /> <br /> [projectX:/tags] <br /> * = r <br /> userx = rw <br /> [projectX:/] <br /> * = rw <br /> [projectY:/] <br /> * = rw <br /> <br /> <br /> Once granular access control has been assigned to this control file, all projects must have access assignments or none will be granted by default. <br /> <br />This rule set enforces read-only access to the "tags" branch except for "userx" who has read and write access to the "tags" branch. All other repositories under the "SVNParentPath" must be listed. The "*" refers to all users. <br /> <br />SE-Linux configuration: <br /> <br />Of course it is easiest to turn off Security Enhanced Linux features by: <br /> <br /> * editing the file /etc/selinux/config, setting "SELINUX=disabled" and reboot <br /> OR <br /> * use the command "setenforce 0". <br /> <br />If using SELinux, you must set the context of the content accessed by the server: <br /> <br /> chcon -R -h -u system_u -r object_r -t httpd_sys_content_t /srv/svn /srv/trac <br /> <br />For more on SELinux see the YoLinux SysAdmin Tutorial <br /> <br />Repository Home Page: <br /> <br />The final touch is to create a homepage for your repositories so that they are easy to find, especially if you are hosting multiple reporitories. The default homepage for most major Linux distributions (Red Hat, Fedora, CentOS, Ubuntu, Debian) is /var/www/html/index.html Create a home page here or create a redirect to the Trac Wiki home page and post links there. <br /> <br />Redirect to the Trac Wiki <br /> <br /> <br /> <META HTTP-EQUIV="Refresh" Content="0; URL=/trac/"> <br /> <br />Sample home page: <br /> <br /> view source <br /> print? <br /> 01 <html> <br /> 02 <head> <br /> 03 <title>Welcome to Project X
04
05
06

Welcome to Project X


07
13
14

Wednesday, July 14, 2010

Creating a selfsign certificate using webserver

Create a Certificate Server in Redhat Linux

StepI

---------

>> vim /etc/pki/tls/openssl.cnf

>> Make the following changes in openssl.cnf file

dir=/etc/pki/CA

certificate=$dir/ca.crt

private=$dir/private/ca.key

Step II

---------

>> Then create the following directory and file

>> mkdir {certs newcerts crl }

>> touch index.txt

>> echo “01” > serial

Step III

---------

>> cd /etc/pki/tls/certs

>> make ca.crt

>> Country Name=US

>> Stateprovince Name=North Carolina

>>Locatily= Raleigh

>>Organization=Example, Inc.

>> cp –a ca.crt /etc/pki/CA

>> cp –a ca.key /etc/pki/CA/private/

Create a private key for webserver

StepI

>>Yum install mod_ssl httpd

>>cd /etc/httpd/conf

>> openssl genrsa 1024 > http.key

>> openssl req –new –key http.key –out http.csr

>> cp –a http.csr /etc/pki/CA (upload on CA server directory)

StepII

--------

>>Now in CA server

>> cd /etc/pki/CA

>> openssl ca –in http.csr –out http.crt

>> cp –a ca.crt /etc/httpd/conf

>> cp –a http.crt /etc/httpd/conf

>> vim /etc/httpd/conf.d/ssl.conf

>> change the follwing path in ssl.conf

SSl Certificate file / Key file / SSl CA file