Announcement Module
No announcement yet.

RF Inspector Version 1- CentOS 6+ server installation instructions

Page Title Module
Move Remove Collapse
This is a sticky topic.
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • RF Inspector Version 1- CentOS 6+ server installation instructions

    Base OS using CentOS 6.5

    Some of our newest products need newer versions of software, one of those being Tomcat 7. At this time, Tomcat7 is NOT yumable in either CentOS 5.x or 6.x lines. However, it does require Java 1.7, which IS yumable in newer CentOS 6.x varieties. So our first requirement is a CentOS 6.5+ base server install.
    Once your basic server install has completed (as usual, make sure to customize now and add Development Tools at install time) update and then make some package additions and removals.

    yum remove tomcat6 java-1.5.0-gcj samba-common yum install java-1.7.0 ftp wget samba4 sssd krb5-workstation Make sure your java is the correct version, and find out where it is located. We will need that location later in the install.

    [root@rflicense conf]# java -version java version "1.7.0_55" OpenJDK Runtime Environment (rhel- u55-b13) OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode) [root@rflicense conf]
    # which java /usr/bin/java [root@rflicense conf]
    # ls -al /usr/bin/java lrwxrwxrwx 1 root root 22 Apr 24 11:31 /usr/bin/java -> /etc/alternatives/java
    [root@rflicense conf]# ls -al /etc/alternatives/java lrwxrwxrwx 1 root root 46 Apr 24 11:31 /etc/alternatives/java -> /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
    add apf (redhat installation) and enter ip's into allowed_hosts.rules wget http://rfnetwork/downloads/apf-current.tar.gz

    Note: If network is not set to start on boot during the installation process, vi /etc/sysconfig/network-scripts/ifcfg-eth0 and set ONBOOT="YES"
    set up hostname and verify

    vi /etc/hosts rfinspector rfinspector.
    Tomcat 7 setup
    You will need to grab the current Tomcat7 from a mirror. This version and mirror work as of 04/20/2014.

    wget tar -zxvf apache-tomcat-7.0.53.tar.gz -C /usr/local ln -s apache-tomcat-7.0.53 tomcat7 This should give you a functioning Tomcat7 install which can be stopped and started with the control scripts located in /usr/local/tomcat7/bin.

    Run as an alternate user
    For security reasons, it is a good idea to run Tomcat as a user other than root.

    groupadd tomcat7
    useradd -s /bin/bash -d /usr/local/tomcat7 -g tomcat7 tomcat7
    chown -Rf tomcat7:tomcat7 /usr/local/tomcat7/ Init script

    Tomcat7 doesn't install an init script, so you have to create your own. In /etc/init.d, create your script and use the following template (which is meant to be used with the alternate user setup!)
    Remember when we mentioned that you'd need the location of your Java binary? Here it is - you will need to put the base java directory as the $JAVA_HOME variable.

    vi /etc/init.d/tomcat7

    HTML Code:
    # description: Tomcat Start Stop Restart
    # processname: tomcat
    # chkconfig: 234 20 80
    JAVA_HOME=/etc/alternatives/jre export JAVA_HOME PATH=$JAVA_HOME/bin:
    $PATH export PATH TOMCAT_HOME=/usr/local/tomcat7/bin case $1 in start) /bin/su tomcat7 $TOMCAT_HOME/ ;; stop) /bin/su tomcat7 $TOMCAT_HOME/ ;; restart) /bin/su tomcat7 $TOMCAT_HOME/ /bin/su tomcat7 $TOMCAT_HOME/ ;; esac
    exit 0
    Make sure to fix ownership and permissions on the init script too!
    Make the file executable

    chmod 755 /etc/init.d/tomcat7 Add to rc2.d

    chkconfig --add tomcat7 You should now be able to stop and start Tomcat7 in the "Upstart" manner (or the old Init V way)
    service tomcat7 stop
    service tomcat7 start
    Once you log into the tomcat interface at http://:/admin add the tomcat manager. This will make it easy to start and stop the Rf-Inspector.
    Add the the manager users in the /var/local/apache-tomcat-7.0.52/conf/tomcat-users.xml file.

    Adding the Rf-Inspector software
    First verify that tomcat is shutdown.
    service tomcat7 stop
    Copy the downloaded rfinspector.war file to /usr/local/apache-tomcat7.x/webapps directory.
    Create the file /etc/

    add the following information

    databaseName: /usr/local/scripts/apache-tomcat7.x/databases/rfInspector
    adminUsername: your_adminUsername
    adminPassword: your_adminPassword
    readWriteCommunityString: your_readWriteCommunityString
    cpeDiscoveryIps: your ip blocks
    cpeDiscoverySchedule: 0 0 2 ? * *

    There is a space intentionally left after the colon. Make sure it's there.

    Note: the last line is based on quartz cron
    Change the ownership of the to the user you created.

    chown -R tomcat:tomcat /etc/ Create the rf-inspector.xml file.

    vi /usr/local/apache-tomcat7.x/conf/Catalina/localhost/rf-inspector.xml
    add the following information where XXX is the fully qualified path to the rf-inspector properties file you made earlier. Note the 3 slashes before the path for linux.
    PHP Code:

    <?xml version="1.0" encoding=UTF-8"?>
    <Context> <Enviromentname="
    rfInspector.configuration" value="file:///XXX" type="java.lang.String"/> </Context>
    Save the script above as rf-inspector.xml not PHP

    Start tomcat7

    service tomcat7 start Open up your browser and go to the tomcat manager
    Start the rf-inspector by click on the checkbox for rf-inspector and click the Start button.
    It should say OK at the top bar
    If it does not, you probably have a typo in the scripts you created. Recheck the scripts.
    Login with your adminUsername and adminPassword located in your file.
    Add yourself as user first. Complete all the fields and be mindful of password rules. Click Submit and continue to add users

    Troubleshooting Hints

    If you are unable to get to tomcat or get a 404 page, check the server firewall. Allow ports 8080, 8005 and 8010.
    If the rf-inspector will not run, check the following
    • Verify that the file is correct.
      • check for proper spaces, quotes, etc. Yes there is a space after the colon.
      • It must be in the format shown above. Check for proper spaces, quotes, etc.
    • Verify the rf-inspector.xml file is also correct
      • check for proper spaces, quotes, etc. Yes there is a space after the colon.
      • It must be in the format shown above. Check for proper spaces, quotes, etc.
    Have them right click on the files and click properties. It must show xml and properties in the file type field. If not, have them re-save the file as "File Types All" and delete the .txt files.
    If they can get to the login screen but get incorrect password, even if they are using the username and passoword in the file, Have them check to make sure there is not a space after both fields.
    For Debian OS users only Increase the amount of memory for Tomcat 7 to keep it from crashing by changing /etc/default/tomcat7 from

    JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC" to JAVA_OPTS="-Djava.awt.headless=true -Xms512m -Xmx1024m -XX:+UseConcMarkSweepGC"

    create a softlink to the JRE7

    ln -s /usr/lib/jvm/java-7-openjdk-i386/ /usr/lib/jvm/default-java Remove the version 6 link if that is there

    rm ln -s /usr/lib/jvm/java-7-openjdk-i386/ /usr/lib/jvm/default-java
    If you have any more troubleshooting suggestions, contact