Arahan screen membolehkan anda melaksanakan arahan yang panjang tanpa perlu risau jika berlakunya gangguan kepada sambungan SSH dari PC ke server. Screen tidak dipasangkan secara 'default' ke dalam Linux pada masa kini.
Pemasangan screen ke dalam Linux
Arahan ini adalah untuk sistem pengoperasian CentOS 6.x. CentOS 7.x mungkin berbeza. Pos ini akan dikemaskini kemudian.
$ yum install screen
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Determining fastest mirrors
* base: mirror.server.domain
* extras: mirror.server.domain
* updates: mirror.server.domain
base | 3.7 kB 00:00 base/primary_db | 4.6 MB 00:00
extras | 3.4 kB 00:00 extras/primary_db | 32 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 2.0 MB 00:00 Resolving Dependencies
--> Running transaction check
---> Package screen.x86_64 0:4.0.3-18.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==================================================================================================== Package Arch Version Repository Size
====================================================================================================
Installing:
screen x86_64 4.0.3-18.el6 base 494 k
Transaction Summary
====================================================================================================
Install 1 Package(s)
Total download size: 494 k
Installed size: 795 k
Is this ok [y/N]:y
Downloading Packages:
screen4.0.3-18.el6.x86_64.rpm
| 494 kB 00:19
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : screen-4.0.3-18.el6.x86_64 1/1
Verifying : screen-4.0.3-18.el6.x86_64 1/1
Installed:
screen.x86_64 0:4.0.3-18.el6
Complete!
Cara penggunaan screen
Untuk menggunakan screen, taip
$ screen
Satu skrin lain akan dipaparkan. Anda boleh menggunakan sebarang arahan linux di dalam skrin ini. Sebagai contoh, jika saya ingin memindahkan fail ke dalam server yang lain, saya menggunakan arahan ftp -i server.your.domain. -i adalah bagi mengelakkan sebarang aktiviti interaktif antara anda dan server.
Setelah selesai anda cuma tekan Ctrl+A+D atau Ctrl+a+d. Untuk memaparkan skrin yang masih aktif, taip arahan $ screen -list. Anda akan mendapat output seperti di bawah
There is a screen on:
5117.pts-1.eprints (Detached)
1 Socket in /var/run/screen/S-root.
Untuk memasuki kembali skrin tersebut, taip $ screen -r. Jika hanya ada satu skrin, anda akan dibawa ke skrin tersebut. Jika anda ada lebih dari satu skrin, taip $ screen -r screenid.
Selamat mencuba!
Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts
How to change DHCP to static
I changed my IP from DHCP to static by editing configuration file. And guess what? Sendmail daemon can't be started. Ping can't work from the server and to the server. The reason? I used MAC address of eth1 for eth0. Damn.
These instruction only work for Redhat and Redhat-based distro.
1. Edit /etc/sysconfig/network-script/ifcfg-ethX. You can replace X with your network card number. Your current file will look like this
DEVICE=ethX
BOOTPROTO=dhcp
HWADDR=xx:xx:xx:xx:xx:xx
ONBOOT=yes
DHCP_HOSTNAME=yourmachinename.yourdomainname.suffix
Change it into
DEVICE=ethX
BOOTPROTO=static
HWADDR=xx:xx:xx:xx:xx:xx <--please don't change this
IPADDR=your.ip.address
NETMASK=your.net.mask
NETWORK=your.network.address
ONBOOT=yes <--please don't change this
If you can't calculate your network address, please asked your admin
2. Edit /etc/sysconfig/network. Your current file will look like this
NETWORKING=yes
NETWORKING_IPv6=no
HOSTNAME=yourmachinename.yourdomainname.suffix
Just add another line
GATEWAY=your.gateway.IPAddress
3. Restart your network.
$ /etc/init.d/network restart
4. Try ping to somewhere else. If you get a reply, congratulation, you have successfully change your IP address from DHCP to static by using configuration files.
These instruction only work for Redhat and Redhat-based distro.
1. Edit /etc/sysconfig/network-script/ifcfg-ethX. You can replace X with your network card number. Your current file will look like this
DEVICE=ethX
BOOTPROTO=dhcp
HWADDR=xx:xx:xx:xx:xx:xx
ONBOOT=yes
DHCP_HOSTNAME=yourmachinename.yourdomainname.suffix
Change it into
DEVICE=ethX
BOOTPROTO=static
HWADDR=xx:xx:xx:xx:xx:xx <--please don't change this
IPADDR=your.ip.address
NETMASK=your.net.mask
NETWORK=your.network.address
ONBOOT=yes <--please don't change this
If you can't calculate your network address, please asked your admin
2. Edit /etc/sysconfig/network. Your current file will look like this
NETWORKING=yes
NETWORKING_IPv6=no
HOSTNAME=yourmachinename.yourdomainname.suffix
Just add another line
GATEWAY=your.gateway.IPAddress
3. Restart your network.
$ /etc/init.d/network restart
4. Try ping to somewhere else. If you get a reply, congratulation, you have successfully change your IP address from DHCP to static by using configuration files.
Simple Samba Configuration
This is an English translation for this article.
With the current Linux distro evolution that making things much simpler to install, installing Samba is easy. Very easy in fact. What you need to do is configuring Samba so, it can fit your requirement.
At my workplace, most people use Windows-based operating system. Most servers also use Windows-based operating system with the exception of DNS, DHCP, and email filtering system. We also have two open source servers that is mainly to host our website.
Because of that, some users need to access the machine using Netbios protocol (although there are much simpler method such as SFTP that is enable by default) to transfer file between their machine and the server.
These are the steps that I used that allow users to access their own home directory in the machine.
1. Edit samba configuration file. The file's name is smb.conf but sometimes it can be named as samba.conf. It is located most probably in /etc/smb.conf or /etc/samba/smb.conf or /etc/sysconfig/smb.conf. If you didn't find the file, use locate or find command.
2. At Global Settings in the configuration file, remove the comment tags for workgroup and hosts allow. Replace the workgroup with your local workgroup name. And limit the computer that can access your samba because with more desktop that can access your server, it will become much more vulnerable towards internal attack (such as worms, viruses, rootkit and other malicious applications).
workgroup = your_local_workgroup
hosts allow = 127. your.local.ip
3. At the Share Definitions, remove comment tags or add [homes] section like this
[homes]
comment = Home Directories
path = /home/%S
browseable = yes
writeable = yes
valid users = %S
4. Save smb.conf and restart Samba daemon
$ /etc/init.d/smb restart
5. Add a new user. The user must exist in your Linux system mean it exist in /etc/passwd. You will be prompted to insert a password. Please don't use the same password as the server login. :)
$ smbpasswd -a new_user
New SMB password:
Retype new SMB password:
Added user new_user.
6. Connect to the server by using a dekstop machine or at the localhost. Its better to use Windows desktop to test the connection. Some machine especially Vista need you to tweak some configuration in the Vista itself before it can connect to the Samba. If you plan to test it just using a commandline (to see it works or not), just run this
$ smbclient -L localhost -Unama_user_baru
passwd : masukkan_passwd_di_sini
7. Samba will display status that notify it works. Most of the time, this configuration will work. Trust me. ^_^
Happy Samba-ing
With the current Linux distro evolution that making things much simpler to install, installing Samba is easy. Very easy in fact. What you need to do is configuring Samba so, it can fit your requirement.
At my workplace, most people use Windows-based operating system. Most servers also use Windows-based operating system with the exception of DNS, DHCP, and email filtering system. We also have two open source servers that is mainly to host our website.
Because of that, some users need to access the machine using Netbios protocol (although there are much simpler method such as SFTP that is enable by default) to transfer file between their machine and the server.
These are the steps that I used that allow users to access their own home directory in the machine.
1. Edit samba configuration file. The file's name is smb.conf but sometimes it can be named as samba.conf. It is located most probably in /etc/smb.conf or /etc/samba/smb.conf or /etc/sysconfig/smb.conf. If you didn't find the file, use locate or find command.
2. At Global Settings in the configuration file, remove the comment tags for workgroup and hosts allow. Replace the workgroup with your local workgroup name. And limit the computer that can access your samba because with more desktop that can access your server, it will become much more vulnerable towards internal attack (such as worms, viruses, rootkit and other malicious applications).
workgroup = your_local_workgroup
hosts allow = 127. your.local.ip
3. At the Share Definitions, remove comment tags or add [homes] section like this
[homes]
comment = Home Directories
path = /home/%S
browseable = yes
writeable = yes
valid users = %S
4. Save smb.conf and restart Samba daemon
$ /etc/init.d/smb restart
5. Add a new user. The user must exist in your Linux system mean it exist in /etc/passwd. You will be prompted to insert a password. Please don't use the same password as the server login. :)
$ smbpasswd -a new_user
New SMB password:
Retype new SMB password:
Added user new_user.
6. Connect to the server by using a dekstop machine or at the localhost. Its better to use Windows desktop to test the connection. Some machine especially Vista need you to tweak some configuration in the Vista itself before it can connect to the Samba. If you plan to test it just using a commandline (to see it works or not), just run this
$ smbclient -L localhost -Unama_user_baru
passwd : masukkan_passwd_di_sini
7. Samba will display status that notify it works. Most of the time, this configuration will work. Trust me. ^_^
Happy Samba-ing
Konfigurasi dan penyelenggaraan Samba
Artikel ni untuk aku rujuk di kala susah. ^_^
Untuk memasang Samba, cuma pasang menggunakan pakej yang telah disertakan bersama-sama Linux Distro. Kalau katakan versi dah lama, sila kemaskini (update) versi terkini menggunakan arahan/cara yang digunakan bersama distro tersebut. Contoh, yum-updates dan lain-lain.
Langkah-langkah agar pengguna dapat memasuki direktori peribadi yang ada di dalam pelayan Linux menggunakan protokol Netbios adalah seperti berikut :
1. Ubah fail smb.conf (lokasi biasanya /etc/samba/smb.conf atau /etc/smb.conf atau /etc/sysconfig/smb.conf bergantung pada distro yang anda gunakan).
2. Pada Global Settings, buangkan tanda komen untuk workgroup dan hosts allow.
workgroup = your_local_workgroup
hosts allow = 127. your.local.ip.address
3. Dalam bahagian Share Definitions, buang tanda komen atau tambahkan skema [homes].
[homes]
comment = Home Directories
path = /home/%S
browseable = yes
writeable = yes
valid users = %S
4. Simpan smb.conf dan hidupkan kembali (restart) daemon samba.
$ /etc/init.d/smb restart
5. Tambahkan pengguna baru
$ smbpasswd -a nama_user_baru
New SMB password:
Retype new SMB password:
Added user nama_user_baru.
6. Sambungkan kepada pelayan tersebut sama ada menggunakan localhost atau pelanggan yang berlainan. Jika menggunakan localhost gunakan
$ smbclient -L localhost -Unama_user_baru
passwd : masukkan_passwd_di_sini
7. Status yang ditunjukkan bermakna samba telah siap dikonfigurasi.
Untuk memasang Samba, cuma pasang menggunakan pakej yang telah disertakan bersama-sama Linux Distro. Kalau katakan versi dah lama, sila kemaskini (update) versi terkini menggunakan arahan/cara yang digunakan bersama distro tersebut. Contoh, yum-updates dan lain-lain.
Langkah-langkah agar pengguna dapat memasuki direktori peribadi yang ada di dalam pelayan Linux menggunakan protokol Netbios adalah seperti berikut :
1. Ubah fail smb.conf (lokasi biasanya /etc/samba/smb.conf atau /etc/smb.conf atau /etc/sysconfig/smb.conf bergantung pada distro yang anda gunakan).
2. Pada Global Settings, buangkan tanda komen untuk workgroup dan hosts allow.
workgroup = your_local_workgroup
hosts allow = 127. your.local.ip.address
3. Dalam bahagian Share Definitions, buang tanda komen atau tambahkan skema [homes].
[homes]
comment = Home Directories
path = /home/%S
browseable = yes
writeable = yes
valid users = %S
4. Simpan smb.conf dan hidupkan kembali (restart) daemon samba.
$ /etc/init.d/smb restart
5. Tambahkan pengguna baru
$ smbpasswd -a nama_user_baru
New SMB password:
Retype new SMB password:
Added user nama_user_baru.
6. Sambungkan kepada pelayan tersebut sama ada menggunakan localhost atau pelanggan yang berlainan. Jika menggunakan localhost gunakan
$ smbclient -L localhost -Unama_user_baru
passwd : masukkan_passwd_di_sini
7. Status yang ditunjukkan bermakna samba telah siap dikonfigurasi.
Mounting USB drive
Get the information about your usb drive by using tail command
$ tail -f /var/log/messages
Then plug in your USB drive. See the messages appear in the log file. The message is almost like this.
Date Time kernel : SCSI emulation for USB Mass Storage devices
Date Time kernel : SCSI device sdb: numberofSectors numberOfByte-byte hdwr sectors (size of the USB)
Date Time kernel : sdb: Write Protect is off
Date Time kernel : sdb: sdb1
Bingo! Now you see that your usb is known as sdb1.
Create a mount point at /mnt. You can create it anywhere but the default is at /mnt.
$ mkdir /mnt/myUSB
Mount the usb.
$ mount /dev/sdb1 /mnt/myUSB
If you think you will forget about the device, just write it in /etc/fstab. Put the entry like this.
/dev/sdb1 /mnt/myUSB auto defaults 1 1
Try to umount it later after you finish using the USB.
$ tail -f /var/log/messages
Then plug in your USB drive. See the messages appear in the log file. The message is almost like this.
Date Time kernel : SCSI emulation for USB Mass Storage devices
Date Time kernel : SCSI device sdb: numberofSectors numberOfByte-byte hdwr sectors (size of the USB)
Date Time kernel : sdb: Write Protect is off
Date Time kernel : sdb: sdb1
Bingo! Now you see that your usb is known as sdb1.
Create a mount point at /mnt. You can create it anywhere but the default is at /mnt.
$ mkdir /mnt/myUSB
Mount the usb.
$ mount /dev/sdb1 /mnt/myUSB
If you think you will forget about the device, just write it in /etc/fstab. Put the entry like this.
/dev/sdb1 /mnt/myUSB auto defaults 1 1
Try to umount it later after you finish using the USB.
Learning Linux - The basic
I've taken this post from my previous blog. I'm searching for various articles that I think will benefit lots of people. Oh, and I will put the comments also in the articles (if any).
Disclaimer : Warning! Long post.
1. Knowing basic directory in Linux
/ is the starting directory for Linux. It is known as root directory where it will store every directories and files available in the OS. Usually, common user like you and me, cannot write in the / directory. Only root or super-user can write into this directory. By controlling/ directory, that person virtually can do any changes that he/she like into the system.
/boot contains files that needed by boot loader such as LILO and GRUB to start the system. By deleting a certain file in this directory, may cause failure during booting process.
/etc contains most configuration files for the system. It range from configuration file for system look and feel, mount configuration to starting up the system daemons. The user's information is also stored in this directory.
/bin contains binary files that needed during bootup that might be used by normal users.
/sbin contains binary files that needed during bootup that might be used by super-user.
/usr/bin contains binary files that might be used by normal users.
/usr/sbin contains binary files that might be used by super-user.
/tmp - all temporary files will be saved in here.
/var - this directory mostly contains files that need to be change by the system such as log files, spool directories, manual pages and etc.
/proc - this directory exist physically on the hard disk but the files are created during system uptime. I call the directory as virtual directory because all the files are stored in the RAM which mean after you shutdown the system, the files are gone from the directory.
/home - this directory purpose is to store user's home directory and user's files. Your home directory will be located in this directory. For example, user1 will have his/her home directory in /home/user1.
/root - this is a home directory for root.
2. Navigating Linux directories
cd is a Linux command that is use to navigate directories in Linux OS. The syntax for cd command is like this :
$ cd [/specify/your/directory/here]
For example, let's say that I want to go from my home directory to /usr/bin directory. I just use the cd command like this :
$ cd /usr/bin
After I execute the command, I'm now at /usr/bin directory. If I want to go back to my home directory, I can use either of these commands
$ cd
or ,
$ cd ~
Now, I'm back at my home directory.
3. Where am I?
Most newbie get lost when traversing Linux directories. To make sure you know where you are now you can use pwd command. pwd stands for 'print name of working directory'. For example, if I'm now at /var/www/htdocs, it will print /var/www/htdocs when you run pwd command.
$ pwd
/var/www/htdocs
The above is the example on how to use the command.
4. Show me the files
ls that stands for list is use to list files and directories available in a directory. Let say, you want to list files and directories in your home directory. You only have to type like this:
$ ls
If I run the command, I will get input like this (maybe you'll get a different result):
If you see the files properly, you will notice that each of the files will have their own color. These coloring reflect the type of each file. For example, directory type will be represented by dark blue, maroon is for tar and compress files, green is for executable or binary files and etc. The coloring scheme can be changes based on the user needs but in the system we use the default coloring scheme.
Let's get back on how to use ls command. These are other ways of using ls command.
$ ls -a
The option will list all files in the directory including hidden files or also known as system files. Hidden files can be recognized easily because it's name start with .(dot) characters. For example, .mydir is a hidden file. Let's look what happen when we use ls -a option.
As you can see from the output, the hidden files and directories will be shown when you use ls -a command.
Some of us might one to view the details for each files and directories in a particular directory. It's not that hard to do it. Just type ls -l in the terminal and you can see the details for each files and directories. Let's look at the example.
That's the output that you get when you run ls -l command. The first column from the left is a file description, the second column is the number of object in the files or directories (for file the number is 1 but for directories the second column will reflect how much files or directories available in that particular directory), the third column is the files or directories owner, the fourth column is the name of group who own the files or directories, fifth column indicate the files or directories sizes, the sixth column is the date when the file is last modify, the next column is the time when the file is last modify and the last column indicate the files or directory names.
Beside using only one option at one time, you can also combine the options available for the command. For example, I can combine a and l option in ls command like this :
$ ls -al
To see other options for ls command, just type ls --help in the terminal. The command will list all options available for ls command.
5. I want to change my password
The first thing you need to do when login into your account is you need to change your password. To do this, use passwd command. You must supply the old password before entering a new password. Use a good password for your account like [*mYpaSswOrD8700*], that combine upper case and lower case letters, numbers and special characters.
You've succesfully changed your password. It's a straight forward comamnd, isn't it?
6. Copying my files
To copy your file from one file to another, you need to use cp command. The command can be used like this :
$ cp file_A file_B
This example will copy file_A to file_B.
You can also copy multiple files into a directory.
$ cp file_A file_B file_C directory_Z
This command will copy file_A, file_B and file_C into directory_Z. If you run ls command in directory_Z, you will see the copy of these files in the directory.
7. Moving file(s)
We can move a file in Linux OS by using mv command. Like cp command, it will create another file at another place. The difference is only mv file will remove the original file. For example :
$ mv file_A file_B
This command will move file_A into file_B. file_A will be deleted afterwards. We can also move multiple files into a directory. Example :
$ mv file_A file_B file_C directory_Z
We can also move a directory to another place
$ mv directory_A directory_B
The above command will move all contents in directory_A into directory_B. If directory_B exist prior to the execution of the command, directory_A will be moved into directory_B.
8. How to make a new directory?
Directories can be used to store file(s) and other directories. In Linux OS every user has permission to create new directories in their respective home directory. We use mkdir command to create a new directory in the system. Example :
$ mkdir my_directory
The command will create a new directory name my_directory. How about if you want to create a new directory that reside on another new directory? We will use the options in mkdir.
$ mkdir -p directory_A/directory_B
The above command can be interpreted like this : "Create directory_B in directory_A. If directory_A is not exist, create directory_A before creating directory_B
9. I want to remove unuse file(s) and directory(ies)
For this purpose you need to use 2 command. rm command is use to remove file(s) but sometimes we also use to remove directory(ies). rmdir commmand is use to remove directory(ies). Look at the example below :
$ rm file_A
$ rm file_A file_b
$ rmdir directory_Z
The first command will remove file_A from the system, while the second command is a way to remove two or more files from the system. The third command is to remove an empty directory_Z. What if your directory is full of files and other directories? Let us try.
$ rmdir directory_Z
rmdir: `directory_Z/': Directory not empty
To remove un-empty directory, we need to use rm command with -r option. Sometimes, I also use -rf options to remove un-empty directory. Either two of these examples can remove un-empty directory :
$ rm -rf directory_Z
$ rm -r directory_Z
10. All process, show yourself!
We can view process using a few or several commands. Its all depends on the distro that you use. Basically, there are 3 command that can view process that running on your computer, ps, top and chkconfig. Depending on your distro, chkconfig may not work on some distro. So, what will this commands do?
ps is used just to print the snapshots of all the current processes run on your computer. There are several options that can be used with ps but I usually used it with -aux. -a is list all process, -u is list of process by users and -x is (err..I forgot..hehehe). If you want to use ps -aux command, I advised you to pipe the command with more. What is a pipe in Linux? I will explained it later if I have some free time. So, let's try.
That is among the process that will display itself if you use ps command. Sometimes the list is long (as in my case) but sometimes the list is short. It is depends on what are the process run on your computer.
top is used to display real time information about all process running on your computer. What I mean by real time is that it will display all the necessary information such as number of tasks currently running on your computer, CPU, memory and swap usage and all related information regarding the process. Try it yourself.
So, as you can see, my computer is currently running 66 taks but only 2 are running and the others are sleeping (maybe because of the 'cold' weather in the laboratory). Anyway, as you can see both list PID for the process. PID is process id and it is very very important when you want to stop the process (if the process is hanging or to your horror you discover that your program is running on infinite loop and can't be stopped using Ctrl + C or Ctrl + Z key functions).
I will not touch chkconfig in here. If you used Fedora Core, CentOS or any other Linux distro that is derived from Red Hat Linux, just type chkconfig --list or you can read the manual of chkconfig using man chkconfig.
11. You, nasty process! Begone!
Beside knowing on how run applications and daemons in Linux environment, you also need to know how to stop nasty apps from terrorizing your computer. If your process is hanging in command environment or terminal, it can be easily stop using Ctrl + C and Ctrl + Z. But sometimes you also want to stop daemons and apps that currently running at the background or if your Firefox freeze. What can you do?
First, you need to find the ID for the process. Type ps command with pipe option like this :
$ ps -aux | grep type_your_process_name_in_here
If you expected that the list will be long, add other pipe options :
$ ps -aux | grep type_your_process_name_in_here | more
For example, just imagine my Firefox is currenly hang right now. So, what can I do. I just type this command :
See that the firefox has several PID. So, what can you do? Try to get the earliest process ID (that is true for process or apps that fork itself). In this example, the earliest PID for firefox is 3961. Kill the process using kill PID command.
$ kill 3961
Try to use ps command once again after you finish killing the process. See, the process is now gone.
Too tired to add more. I will add later.
Disclaimer : Warning! Long post.
1. Knowing basic directory in Linux
/ is the starting directory for Linux. It is known as root directory where it will store every directories and files available in the OS. Usually, common user like you and me, cannot write in the / directory. Only root or super-user can write into this directory. By controlling
/boot contains files that needed by boot loader such as LILO and GRUB to start the system. By deleting a certain file in this directory, may cause failure during booting process.
/etc contains most configuration files for the system. It range from configuration file for system look and feel, mount configuration to starting up the system daemons. The user's information is also stored in this directory.
/bin contains binary files that needed during bootup that might be used by normal users.
/sbin contains binary files that needed during bootup that might be used by super-user.
/usr/bin contains binary files that might be used by normal users.
/usr/sbin contains binary files that might be used by super-user.
/tmp - all temporary files will be saved in here.
/var - this directory mostly contains files that need to be change by the system such as log files, spool directories, manual pages and etc.
/proc - this directory exist physically on the hard disk but the files are created during system uptime. I call the directory as virtual directory because all the files are stored in the RAM which mean after you shutdown the system, the files are gone from the directory.
/home - this directory purpose is to store user's home directory and user's files. Your home directory will be located in this directory. For example, user1 will have his/her home directory in /home/user1.
/root - this is a home directory for root.
2. Navigating Linux directories
cd is a Linux command that is use to navigate directories in Linux OS. The syntax for cd command is like this :
$ cd [/specify/your/directory/here]
For example, let's say that I want to go from my home directory to /usr/bin directory. I just use the cd command like this :
$ cd /usr/bin
After I execute the command, I'm now at /usr/bin directory. If I want to go back to my home directory, I can use either of these commands
$ cd
or ,
$ cd ~
Now, I'm back at my home directory.
3. Where am I?
Most newbie get lost when traversing Linux directories. To make sure you know where you are now you can use pwd command. pwd stands for 'print name of working directory'. For example, if I'm now at /var/www/htdocs, it will print /var/www/htdocs when you run pwd command.
$ pwd
/var/www/htdocs
The above is the example on how to use the command.
4. Show me the files
ls that stands for list is use to list files and directories available in a directory. Let say, you want to list files and directories in your home directory. You only have to type like this:
$ ls
If I run the command, I will get input like this (maybe you'll get a different result):
Desktop/ examples/ lamtests-7.1.1.tar.gz
LINUX/ lam-mpi_examples.tar.gz pvm3/
OBJECT.tga lamtests-7.1.1/
If you see the files properly, you will notice that each of the files will have their own color. These coloring reflect the type of each file. For example, directory type will be represented by dark blue, maroon is for tar and compress files, green is for executable or binary files and etc. The coloring scheme can be changes based on the user needs but in the system we use the default coloring scheme.
Let's get back on how to use ls command. These are other ways of using ls command.
$ ls -a
The option will list all files in the directory including hidden files or also known as system files. Hidden files can be recognized easily because it's name start with .(dot) characters. For example, .mydir is a hidden file. Let's look what happen when we use ls -a option.
./ .bash_profile .povrayrc .ssh/ examples/
../ .bashrc .qt/ .thumbnails/ lam-mpi_examples.tar.gz
.ICEauthority .gconf/ .recently-used Desktop/ lamtests-7.1.1/
.Xauthority .gconfd/ .rhosts LINUX/ lamtests-7.1.1.tar.gz
.bash_history .gnome/ .screenrc OBJECT.tga pvm3/
As you can see from the output, the hidden files and directories will be shown when you use ls -a command.
Some of us might one to view the details for each files and directories in a particular directory. It's not that hard to do it. Just type ls -l in the terminal and you can see the details for each files and directories. Let's look at the example.
$ ls -l
total 452
drwx------ 3 ruzaimi users 136 2005-01-24 15:00 Desktop/
drwxr-xr-x 2 ruzaimi users 48 2005-01-28 12:35 LINUX/
-rw-r--r-- 1 ruzaimi users 18 2005-01-24 15:02 OBJECT.tga
drwxr-xr-x 13 ruzaimi users 432 2005-01-27 16:03 examples/
-rw-r--r-- 1 ruzaimi users 99074 2005-02-14 13:12 lam-mpi_examples.tar.gz
drwxr-xr-x 16 ruzaimi users 744 2005-01-28 11:32 lamtests-7.1.1/
-rw-r--r-- 1 ruzaimi users 342140 2005-01-28 11:24 lamtests-7.1.1.tar.gz
drwxr-xr-x 4 ruzaimi users 96 2005-02-13 14:10 pvm3/
That's the output that you get when you run ls -l command. The first column from the left is a file description, the second column is the number of object in the files or directories (for file the number is 1 but for directories the second column will reflect how much files or directories available in that particular directory), the third column is the files or directories owner, the fourth column is the name of group who own the files or directories, fifth column indicate the files or directories sizes, the sixth column is the date when the file is last modify, the next column is the time when the file is last modify and the last column indicate the files or directory names.
Beside using only one option at one time, you can also combine the options available for the command. For example, I can combine a and l option in ls command like this :
$ ls -al
To see other options for ls command, just type ls --help in the terminal. The command will list all options available for ls command.
5. I want to change my password
The first thing you need to do when login into your account is you need to change your password. To do this, use passwd command. You must supply the old password before entering a new password. Use a good password for your account like [*mYpaSswOrD8700*], that combine upper case and lower case letters, numbers and special characters.
$ passwd
Changing password for testuser1
Old password:
Enter the new password (minimum of 5, maximum of 127 characters)
Please use a combination of upper and lower case letters and numbers.
New password:
Re-enter new password:
Password changed.
You've succesfully changed your password. It's a straight forward comamnd, isn't it?
6. Copying my files
To copy your file from one file to another, you need to use cp command. The command can be used like this :
$ cp file_A file_B
This example will copy file_A to file_B.
You can also copy multiple files into a directory.
$ cp file_A file_B file_C directory_Z
This command will copy file_A, file_B and file_C into directory_Z. If you run ls command in directory_Z, you will see the copy of these files in the directory.
7. Moving file(s)
We can move a file in Linux OS by using mv command. Like cp command, it will create another file at another place. The difference is only mv file will remove the original file. For example :
$ mv file_A file_B
This command will move file_A into file_B. file_A will be deleted afterwards. We can also move multiple files into a directory. Example :
$ mv file_A file_B file_C directory_Z
We can also move a directory to another place
$ mv directory_A directory_B
The above command will move all contents in directory_A into directory_B. If directory_B exist prior to the execution of the command, directory_A will be moved into directory_B.
8. How to make a new directory?
Directories can be used to store file(s) and other directories. In Linux OS every user has permission to create new directories in their respective home directory. We use mkdir command to create a new directory in the system. Example :
$ mkdir my_directory
The command will create a new directory name my_directory. How about if you want to create a new directory that reside on another new directory? We will use the options in mkdir.
$ mkdir -p directory_A/directory_B
The above command can be interpreted like this : "Create directory_B in directory_A. If directory_A is not exist, create directory_A before creating directory_B
9. I want to remove unuse file(s) and directory(ies)
For this purpose you need to use 2 command. rm command is use to remove file(s) but sometimes we also use to remove directory(ies). rmdir commmand is use to remove directory(ies). Look at the example below :
$ rm file_A
$ rm file_A file_b
$ rmdir directory_Z
The first command will remove file_A from the system, while the second command is a way to remove two or more files from the system. The third command is to remove an empty directory_Z. What if your directory is full of files and other directories? Let us try.
$ rmdir directory_Z
rmdir: `directory_Z/': Directory not empty
To remove un-empty directory, we need to use rm command with -r option. Sometimes, I also use -rf options to remove un-empty directory. Either two of these examples can remove un-empty directory :
$ rm -rf directory_Z
$ rm -r directory_Z
10. All process, show yourself!
We can view process using a few or several commands. Its all depends on the distro that you use. Basically, there are 3 command that can view process that running on your computer, ps, top and chkconfig. Depending on your distro, chkconfig may not work on some distro. So, what will this commands do?
ps is used just to print the snapshots of all the current processes run on your computer. There are several options that can be used with ps but I usually used it with -aux. -a is list all process, -u is list of process by users and -x is (err..I forgot..hehehe). If you want to use ps -aux command, I advised you to pipe the command with more. What is a pipe in Linux? I will explained it later if I have some free time. So, let's try.
$ ps -aux | more
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 628 52 ? S Sep10 0:04 init [4]
root 2 0.0 0.0 0 0 ? S Sep10 0:00 [keventd]
root 3 0.0 0.0 0 0 ? SN Sep10 0:00 [ksoftirqd_CPU0]
root 4 0.0 0.0 0 0 ? S Sep10 0:00 [kswapd]
root 5 0.0 0.0 0 0 ? S Sep10 0:00 [bdflush]
root 6 0.0 0.0 0 0 ? S Sep10 0:00 [kupdated]
root 11 0.0 0.0 0 0 ? S Sep10 0:00 [kreiserfsd]
root 73 0.0 0.2 1632 676 ? Ss Sep10 0:00 /usr/sbin/syslogd
That is among the process that will display itself if you use ps command. Sometimes the list is long (as in my case) but sometimes the list is short. It is depends on what are the process run on your computer.
top is used to display real time information about all process running on your computer. What I mean by real time is that it will display all the necessary information such as number of tasks currently running on your computer, CPU, memory and swap usage and all related information regarding the process. Try it yourself.
$ top
top - 07:48:33 up 10 days, 19:45, 2 users, load average: 0.00, 0.00, 0.00
Tasks: 66 total, 2 running, 56 sleeping, 8 stopped, 0 zombie
Cpu(s): 0.7% user, 0.3% system, 0.0% nice, 99.0% idle
Mem: 239628k total, 232684k used, 6944k free, 38408k buffers
Swap: 996020k total, 8176k used, 987844k free, 59860k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27941 root 16 0 1084 1084 844 R 0.3 0.5 0:00.34 top
1 root 8 0 60 52 32 S 0.0 0.0 0:04.57 init
2 root 9 0 0 0 0 S 0.0 0.0 0:00.02 keventd
3 root 19 19 0 0 0 S 0.0 0.0 0:00.02 ksoftirqd_CPU0
So, as you can see, my computer is currently running 66 taks but only 2 are running and the others are sleeping (maybe because of the 'cold' weather in the laboratory). Anyway, as you can see both list PID for the process. PID is process id and it is very very important when you want to stop the process (if the process is hanging or to your horror you discover that your program is running on infinite loop and can't be stopped using Ctrl + C or Ctrl + Z key functions).
I will not touch chkconfig in here. If you used Fedora Core, CentOS or any other Linux distro that is derived from Red Hat Linux, just type chkconfig --list or you can read the manual of chkconfig using man chkconfig.
11. You, nasty process! Begone!
Beside knowing on how run applications and daemons in Linux environment, you also need to know how to stop nasty apps from terrorizing your computer. If your process is hanging in command environment or terminal, it can be easily stop using Ctrl + C and Ctrl + Z. But sometimes you also want to stop daemons and apps that currently running at the background or if your Firefox freeze. What can you do?
First, you need to find the ID for the process. Type ps command with pipe option like this :
$ ps -aux | grep type_your_process_name_in_here
If you expected that the list will be long, add other pipe options :
$ ps -aux | grep type_your_process_name_in_here | more
For example, just imagine my Firefox is currenly hang right now. So, what can I do. I just type this command :
ps -aux | grep firefox
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root 3961 0.0 0.5 2472 1308 ? S Sep10 0:00 /bin/sh /usr/bin/firefox
root 3972 0.0 0.5 2512 1340 ? S Sep10 0:00 /bin/sh /usr/lib/firefox-1.5.0.7/run-mozilla.sh /usr/lib/firefox-1.5.0.7/firefox-bin
root 3977 0.1 15.2 53812 36536 ? S Sep10 20:23 /usr/lib/firefox-1.5.0.7/firefox-bin
root 3979 0.0 15.2 53812 36536 ? S Sep10 0:00 /usr/lib/firefox-1.5.0.7/firefox-bin
root 3980 0.0 15.2 53812 36536 ? S Sep10 0:00 /usr/lib/firefox-1.5.0.7/firefox-bin
root 3981 0.0 15.2 53812 36536 ? S Sep10 0:00 /usr/lib/firefox-1.5.0.7/firefox-bin
See that the firefox has several PID. So, what can you do? Try to get the earliest process ID (that is true for process or apps that fork itself). In this example, the earliest PID for firefox is 3961. Kill the process using kill PID command.
$ kill 3961
Try to use ps command once again after you finish killing the process. See, the process is now gone.
Too tired to add more. I will add later.
Rocks Cluster : Bad FTP response
When you are trying to install a compute node (its already pass the Kickstart process), if suddenly your compute node returning "Bad FTP Response". Please, don't try too hard trying to figure out where the heck is the ftp daemon in your server (like I do). I spend the entire day to figure out why it is still got the statement. Please do like this (please, don't go look at Rocks Cluster mailing list. Sometimes, they give you lots of things to do before you can solve it. Follow my simple and easier step.
Please see the access.log and error.log in your /var/log/httpd/ directory. Look into the recent ones. Use tail will do.
192.168.0.254 - - [15/Aug/2007:14:17:58 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:17:59 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:00 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:01 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:02 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:03 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:04 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:05 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:06 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:16 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:17 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:18 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:19 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:20 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:21 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:22 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:23 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:24 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
In the access.log you will see that your node already get the file. But do it? Let's see the error.log.
[Wed Aug 15 14:17:58 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:17:59 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:00 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:01 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:02 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:03 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:04 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:05 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:06 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:16 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:17 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:18 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:19 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:20 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:21 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:22 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:23 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:24 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
The same date and time. See that the client is denied by the server. What's the heck is the configuration you may ask. Afraid not my young padawan. It is the httpd configuration. But is it? I spend 10 minutes reading httpd.conf until I read the last line.
include conf.d/rocks.conf
So, the httpd get another set of configuration from conf.d. So, lets see what are the files in conf.d.
-r--r--r-- 1 root root 361 Aug 15 21:51 411.conf
-r--r--r-- 1 root root 1417 Aug 15 21:52 central.conf
-r--r--r-- 1 root root 446 Aug 15 21:52 myadmin.conf
-rw-r--r-- 1 root root 448 Sep 21 2006 php.conf
drwxr-xr-x 2 root root 4096 Jun 27 09:07 RCS
-rw-r--r-- 1 root root 392 Aug 13 2006 README
-r--r--r-- 1 root root 774 Aug 15 21:50 rocks.conf
-r--r--r-- 1 root root 268 Jun 27 09:06 rocks-wordpress.conf
-rw-r--r-- 1 root root 10919 Aug 13 2006 ssl.conf
-rw-r--r-- 1 root root 299 Aug 13 2006 welcome.conf
-rw-r--r-- 1 root root 138 Sep 25 2006 wordpress.conf
You need to change central.conf, myadmin.conf and rocks.conf. Compare your private IP with the configuration file. Make sure the IP in the files is your private IP not your public IP. Try to retrieve the image again. I'm sure you will successfully retrieve the image.
Try it my young padawan. May the force be with you!
Please see the access.log and error.log in your /var/log/httpd/ directory. Look into the recent ones. Use tail will do.
192.168.0.254 - - [15/Aug/2007:14:17:58 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:17:59 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:00 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:01 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:02 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:03 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:04 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:05 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:06 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:16 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:17 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:18 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:19 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:20 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:21 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:22 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:23 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
192.168.0.254 - - [15/Aug/2007:14:18:24 +0800] "GET /install/rocks-dist/lan/i386/RedHat/base/updates.img HTTP/1.0" 403 330 "-" "-"
In the access.log you will see that your node already get the file. But do it? Let's see the error.log.
[Wed Aug 15 14:17:58 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:17:59 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:00 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:01 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:02 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:03 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:04 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:05 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:06 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:16 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:17 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:18 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:19 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:20 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:21 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:22 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:23 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
[Wed Aug 15 14:18:24 2007] [error] [client 192.168.0.254] client denied by server configuration: /var/www/html/install/rocks-dist/lan/i386/RedHat/base/updates.img
The same date and time. See that the client is denied by the server. What's the heck is the configuration you may ask. Afraid not my young padawan. It is the httpd configuration. But is it? I spend 10 minutes reading httpd.conf until I read the last line.
include conf.d/rocks.conf
So, the httpd get another set of configuration from conf.d. So, lets see what are the files in conf.d.
-r--r--r-- 1 root root 361 Aug 15 21:51 411.conf
-r--r--r-- 1 root root 1417 Aug 15 21:52 central.conf
-r--r--r-- 1 root root 446 Aug 15 21:52 myadmin.conf
-rw-r--r-- 1 root root 448 Sep 21 2006 php.conf
drwxr-xr-x 2 root root 4096 Jun 27 09:07 RCS
-rw-r--r-- 1 root root 392 Aug 13 2006 README
-r--r--r-- 1 root root 774 Aug 15 21:50 rocks.conf
-r--r--r-- 1 root root 268 Jun 27 09:06 rocks-wordpress.conf
-rw-r--r-- 1 root root 10919 Aug 13 2006 ssl.conf
-rw-r--r-- 1 root root 299 Aug 13 2006 welcome.conf
-rw-r--r-- 1 root root 138 Sep 25 2006 wordpress.conf
You need to change central.conf, myadmin.conf and rocks.conf. Compare your private IP with the configuration file. Make sure the IP in the files is your private IP not your public IP. Try to retrieve the image again. I'm sure you will successfully retrieve the image.
Try it my young padawan. May the force be with you!
Rocks Cluster : Editing Network Configurations
After installing Rocks, and dirtying your hands playing with the configurations, then to your horror you realize that the setting you put for your eth0 and eth1 is not like you intended. Or you want to edit the IP address for eth0 or eth1 as given by your network administrator. So, what you can do?
In Rocks, the configuration is store in configuration files and mysql database. So, how to edit the network configuration?
First, login into your mysql console.
$ mysql -u root -p
Enter password :
Enter your root password for the machine. For example, if you use 'abcd1234' (don't use this password, it is a weakest password), put in 'abcd1234'.
You can view current databases available in your server.
mysql> show databases;
+-----------+
| Database |
+-----------+
| cluster |
| mysql |
| test |
| wordpress |
+-----------+
4 rows in set (0.00 sec)
You can ignore mysql, test and wordpress unless you want to do something on the 3 databases. For now, we will concentrate on cluster database.
mysql> use cluster;
Database changed
You can use show tables command on the console to list all the tables available in the cluster database. But for now, I will concentrate on network table.
mysql> select * from networks;
+----+------+-------------------+-------------+---------------+---------------+
| ID | Node | MAC | IP | Netmask | Gateway | Name | Device | Module | Options | Comment |
+----+------+-------------------+-------------+---------------+---------------+
| 1 | 1 | theMac1| 192.168.1.3 | 255.255.255.0 | 192.168.1.254 | yourhost.yourdomain | eth0 | 3c59x | NULL | NULL |
| 2 | 1 | theMac2 | 192.168.0.1 | 255.255.255.0 | NULL | yourhost | eth1 | tg3 | NULL | NULL |
+----+------+-------------------+-------------+---------------+---------------+
2 rows in set (0.00 sec)
As you can see from the list, most of the network configuration is in the database. So, let say if you want to change the IP address from local into public IP use by your organization. And lets say the device that will bear the changes fall into eth0. So, do this sql statement.
mysql> update networks set ip='into.your.org.ip' where device='eth0';
Exit from mysql. Then execute this statement.
$ dbreport ifcfg eth0 yourhostname >> /etc/sysconfig/network-scripts/ifcfg-eth0
Restart your network or reboot your system to make sure the changes took effect.
This article is a part to help me in building the cluster and prevent me from digging into the Rocks mailing list. ;)
In Rocks, the configuration is store in configuration files and mysql database. So, how to edit the network configuration?
First, login into your mysql console.
$ mysql -u root -p
Enter password :
Enter your root password for the machine. For example, if you use 'abcd1234' (don't use this password, it is a weakest password), put in 'abcd1234'.
You can view current databases available in your server.
mysql> show databases;
+-----------+
| Database |
+-----------+
| cluster |
| mysql |
| test |
| wordpress |
+-----------+
4 rows in set (0.00 sec)
You can ignore mysql, test and wordpress unless you want to do something on the 3 databases. For now, we will concentrate on cluster database.
mysql> use cluster;
Database changed
You can use show tables command on the console to list all the tables available in the cluster database. But for now, I will concentrate on network table.
mysql> select * from networks;
+----+------+-------------------+-------------+---------------+---------------+
| ID | Node | MAC | IP | Netmask | Gateway | Name | Device | Module | Options | Comment |
+----+------+-------------------+-------------+---------------+---------------+
| 1 | 1 | theMac1| 192.168.1.3 | 255.255.255.0 | 192.168.1.254 | yourhost.yourdomain | eth0 | 3c59x | NULL | NULL |
| 2 | 1 | theMac2 | 192.168.0.1 | 255.255.255.0 | NULL | yourhost | eth1 | tg3 | NULL | NULL |
+----+------+-------------------+-------------+---------------+---------------+
2 rows in set (0.00 sec)
As you can see from the list, most of the network configuration is in the database. So, let say if you want to change the IP address from local into public IP use by your organization. And lets say the device that will bear the changes fall into eth0. So, do this sql statement.
mysql> update networks set ip='into.your.org.ip' where device='eth0';
Exit from mysql. Then execute this statement.
$ dbreport ifcfg eth0 yourhostname >> /etc/sysconfig/network-scripts/ifcfg-eth0
Restart your network or reboot your system to make sure the changes took effect.
This article is a part to help me in building the cluster and prevent me from digging into the Rocks mailing list. ;)
Installing Rocks 4.2.1 - for frontend
This entry is to guide me on how to install Rocks into my cluster. It is for me only but you can read it also. I'm tired searching the Rocks mailing list so, I've decided to put the solution (that I found) here in this blog.
When at first I install Rocks, it never get pass to the X-Window (Graphical User Interface - GUI) of Rocks. The problem is like this :
Attempting to start native X Server
Waiting for X Server to start....log located in /tmp/X.log
1..2..3..4..5.. X Server started successfully
Starting graphical installation...
The application 'mini-wm' lost its conection to the display :1.0
Most likely X server was shut down or you killed/destroyed the application
Terminated
Sending termination signals ....done
Sending kill signals ...done
disabling swap...
unmounting filesystem...
/mt/runtime umount failed (16)
disabling /dev/loop2 LOOP_CLR_FD failed : 16
/proc/bus/usb done
/proc umount failed (16)
/dev/pts done
/sys done
/tmp/ramfs umount failed (16)
/mnt/cdrom done
/export done
rebooting system
kernel panic - not syncing : VFS : Unable to mount root fs on unknown block (8,3)
So, I search the mailing list for the problem. It has 2 solutions. The first solution, make sure your frontend (or master node) has 1 GB of RAM. Less than that, you may encounter the problem. The other solution is by doing this (I've got this from here) :
In the ks.cfg file in the Kernel CD, the following commands for Anaconda are given:
dispatch.skipStep("handleX11pkgs", permanent = 1)
dispatch.skipStep("videocard", permanent = 1)
dispatch.skipStep("monitor", permanent = 1)
dispatch.skipStep("xcustom", permanent = 1)
As a result, Anaconda does not bother detecting the video card and just runs. This was the source of the problem for the failure to load X. As such, the solution is to download the .iso, mount the .iso and copy the contents into another directory for modification:
mkdir /tmp/kernel-iso
mount -o loop kernel-4.2.1-0.x86_64.disk1.iso /tmp/kernel-iso
cp -av /tmp/kernel-iso /tmp/kernel-iso-new
modify these lines in the ks.cfg file as follows:
dispatch.skipStep("handleX11pkgs", skip = 0)
dispatch.skipStep("videocard", skip = 0)
dispatch.skipStep("monitor", skip = 0)
dispatch.skipStep("xcustom", skip = 0)
remake the .iso:
mkisofs -o /tmp/kernel-4.2.1-new.iso -b isolinux/isolinux.bin \
-c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
-boot-info-table -J -R -V 'kernel disk1' .
burn it and run again.
Now, I managed to get until partitioning my hard disk. After I had set on how to partition the hard disk, Anaconda ask for Core Roll CD (that contains Area 51, Ganglia, SGE and etc). When I clicked next, this error was displayed :
Traceback (most recent call last) :
File "/var/tmp/anaconda-10.1.1.46//usr/lib/anaconda/gui.py", line 1074, in handleRenderCallback self.currentWindow.renderCallback()
File "/tmp/updates/usr/lib/anaconda/progress-gui.py", line 249 in renderCallback self.intf.icw.nextClicked()
File "/var/tmp/anaconda-10.1.1.46//usr/lib/anaconda/gui.py", line 789 in nextClicked self.dispatch.gotoNext()
File "/var/tmp/anaconda-10.1.1.46//usr/lib/anaconda/dispatch.py", line 171 in gotoNext self.moveStep()
File "/var/tmp/anaconda-10.1.1.46//usr/lib/anaconda/dispatch.py", line 239 in moveStep rc=apply(func, self.bindArgs(args))
File "/tmp/ksclass.py", line 1409 in RocksPreInstall
File "/tmp/ksclass.py", line 1397 in RocksReadComps
File "/tmp/ksclass.py", line 1332 in RocksGetRools
File "/tmp/ksclass.py", lone 1269 in downloadRoll
OSError:[Errno 2] No such file or directory :
"/mnt/sysimage/export/home/install/rolls/area51/4.2.1/i386"
My team managed to install the frontend node today. It is because we need to install automatic partitioning. I don't like automatic partitioning but I think I can endure it. But now the screen is hang. Let see if it can managed to load all of it. I'll post another updates later.
When at first I install Rocks, it never get pass to the X-Window (Graphical User Interface - GUI) of Rocks. The problem is like this :
Attempting to start native X Server
Waiting for X Server to start....log located in /tmp/X.log
1..2..3..4..5.. X Server started successfully
Starting graphical installation...
The application 'mini-wm' lost its conection to the display :1.0
Most likely X server was shut down or you killed/destroyed the application
Terminated
Sending termination signals ....done
Sending kill signals ...done
disabling swap...
unmounting filesystem...
/mt/runtime umount failed (16)
disabling /dev/loop2 LOOP_CLR_FD failed : 16
/proc/bus/usb done
/proc umount failed (16)
/dev/pts done
/sys done
/tmp/ramfs umount failed (16)
/mnt/cdrom done
/export done
rebooting system
kernel panic - not syncing : VFS : Unable to mount root fs on unknown block (8,3)
So, I search the mailing list for the problem. It has 2 solutions. The first solution, make sure your frontend (or master node) has 1 GB of RAM. Less than that, you may encounter the problem. The other solution is by doing this (I've got this from here) :
In the ks.cfg file in the Kernel CD, the following commands for Anaconda are given:
dispatch.skipStep("handleX11pkgs", permanent = 1)
dispatch.skipStep("videocard", permanent = 1)
dispatch.skipStep("monitor", permanent = 1)
dispatch.skipStep("xcustom", permanent = 1)
As a result, Anaconda does not bother detecting the video card and just runs. This was the source of the problem for the failure to load X. As such, the solution is to download the .iso, mount the .iso and copy the contents into another directory for modification:
mkdir /tmp/kernel-iso
mount -o loop kernel-4.2.1-0.x86_64.disk1.iso /tmp/kernel-iso
cp -av /tmp/kernel-iso /tmp/kernel-iso-new
modify these lines in the ks.cfg file as follows:
dispatch.skipStep("handleX11pkgs", skip = 0)
dispatch.skipStep("videocard", skip = 0)
dispatch.skipStep("monitor", skip = 0)
dispatch.skipStep("xcustom", skip = 0)
remake the .iso:
mkisofs -o /tmp/kernel-4.2.1-new.iso -b isolinux/isolinux.bin \
-c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
-boot-info-table -J -R -V 'kernel disk1' .
burn it and run again.
Now, I managed to get until partitioning my hard disk. After I had set on how to partition the hard disk, Anaconda ask for Core Roll CD (that contains Area 51, Ganglia, SGE and etc). When I clicked next, this error was displayed :
Traceback (most recent call last) :
File "/var/tmp/anaconda-10.1.1.46//usr/lib/anaconda/gui.py", line 1074, in handleRenderCallback self.currentWindow.renderCallback()
File "/tmp/updates/usr/lib/anaconda/progress-gui.py", line 249 in renderCallback self.intf.icw.nextClicked()
File "/var/tmp/anaconda-10.1.1.46//usr/lib/anaconda/gui.py", line 789 in nextClicked self.dispatch.gotoNext()
File "/var/tmp/anaconda-10.1.1.46//usr/lib/anaconda/dispatch.py", line 171 in gotoNext self.moveStep()
File "/var/tmp/anaconda-10.1.1.46//usr/lib/anaconda/dispatch.py", line 239 in moveStep rc=apply(func, self.bindArgs(args))
File "/tmp/ksclass.py", line 1409 in RocksPreInstall
File "/tmp/ksclass.py", line 1397 in RocksReadComps
File "/tmp/ksclass.py", line 1332 in RocksGetRools
File "/tmp/ksclass.py", lone 1269 in downloadRoll
OSError:[Errno 2] No such file or directory :
"/mnt/sysimage/export/home/install/rolls/area51/4.2.1/i386"
My team managed to install the frontend node today. It is because we need to install automatic partitioning. I don't like automatic partitioning but I think I can endure it. But now the screen is hang. Let see if it can managed to load all of it. I'll post another updates later.
Subscribe to:
Posts (Atom)