Project

General

Profile

Add host » History » Revision 12

Revision 11 (Anchi Cheng, 08/12/2014 02:40 PM) → Revision 12/13 (Anchi Cheng, 08/12/2014 02:41 PM)

h2. Add the IP address and matching hostname of the microscope and digital camera computer in your host file on the main Leginon computer, and vice versa. 

 h3. Find out what python thinks the hostname is with python command line.    REPEAT this both on Linux and Windows PC 

 Run the following in python command line: 
 <pre> 
 import socket 
 socket.gethostname() 
 </pre> 

 h3. Find out the ip address associate with the hostname 

 Run the following in python command line: 
 <pre> 
 import socket 
 socket.gethostbyname('your_host_name') 
 </pre> 

 h3. REPEAT the above on each instrument WIndows PC* so you have all the information. 

 h3. Modify your "hosts" file on the linux Leginon computer to include the instrument hosts if the latter is not already mapped by your domain name server 

 *    On Linux, this "hosts" file is at 
 > /etc/hosts 

 Example of a "hosts" file: 

 <pre> 
 192.000.1.222     instrument_host_name.domain_name instrument_short_host_name 
 </pre> 

 h3. Use shorter linux hostname if desired 

 If you'd like to shorten your linux hostname recognized by socket without the domain name, you may do so as root 
 <pre> 
 hostname your_shorter_hostname 
 </pre> 

 and also add that to the /etc/hosts as an alternative name 
 <pre> 
 192.000.1.333     long_host_name.domain_name your_shorter_hostname 
 </pre> 

 You will need to restart networking to make it persistent. 
 <pre> 
 /etc/init.d/network restart 
 </pre> 

 Test the change by finding the ip address with the hostname as in the above section. 

 h3. The Linux main Leginon computer also needs to identify itself by its hostname registered on the instrument Windows computer. 

 *    On Window XP and WIndows 7 this host file is 
 > C:\\WINDOWS\system32\drivers\etc\hosts 

 *    On Window NT, this host file is 
 > C:\\WINNT\system32\drivers\etc\hosts