Change host address/name after Linux install

Help
2008-03-31
2013-05-01
  • I just installed DimDim Dimdim_installer_centos4.5_32bit_offline onto a virgin install of CentOS 4.5.

    The install process did not ask me what IP address I wanted to use or what hostname. It just turned out with the behind-the-firewall IP address hard coded into many files. The documentation I could read suggest I change dimdim.properties however I can see the offending IP address lurking in other files too resulting in the audio/video recorder never connecting. Here is the list of affected files I found in /usr/local/dimdim...

    ./ConferenceServer/apache-tomcat-5.5.17/webapps/dimdim/WEB-INF/classes/resources/dimdim.properties
    ./ConferenceServer/ConferenceServer/apache-tomcat-5.5.17/webapps/dimdim/html/meetNow.html
    ./ConferenceServer/ConferenceServer/apache-tomcat-5.5.17/webapps/dimdim/html/joinConf.html
    ./ConferenceServer/ConferenceServer/apache-tomcat-5.5.17/webapps/dimdim/html/createConf.html
    ./ConferenceServer/ConferenceServer/apache-tomcat-5.5.17/webapps/dimdim/html/startConf.html
    ./ConferenceServer/ConferenceServer/apache-tomcat-5.5.17/webapps/dimdim/WelcomePage.html
    ./ConferenceServer/ConferenceServer/apache-tomcat-5.5.17/webapps/dimdim/WEB-INF/classes/resources/streaming.properties

    Certainly, I can deal with this using a nifty one-liner such as...

    for i in `find . -type f -print0 | xargs -0 grep -li "<WRONG IP ADDRESS>" | grep -v ".log"`; do sed -i "$i" 's/<WRONG IP ADDRESS>/<RIGHT IP ADDRESS or HOSTNAME>/gi'; done

    Where the <WRONG IP ADDRESS> is what gets assumed during install and the <RIGHT IP ADDRESS or HOSTNAME> is what I wanted it to be.

    However, I'm curious if there is a more supported way of doing this. Also, if the Windows installer gathers this information during the install then why not the Linux installer?

     
    • Correction to the above one-liner with a real IP address example. This should also work quicker.

      for i in `find /usr/local/dimdim/ConferenceServer -type f -print0 | xargs -0 grep -li "192.168.1.10" | grep -v ".log"`; do sed -i 's/192\.168\.1\.10/my\.domain\.com/gi' "$i"; done