Google

Thursday, February 28, 2008

Installing vsftpd on RHEL (CentOS)

Check to see if vsftpd is installed:
[root@ftp ~]# rpm -q vsftpd
vsftpd-2.0.5-10.el5

If not just type “yum install vsftpd” and when the install is done, start vsftpd:

[root@rhel5 ~]# service vsftpd start
Starting vsftpd for vsftpd: [ OK ]

Note: The default anonymous ftp user home is “/var/ftp/”.

Monday, February 18, 2008

Advance Linux Commands

vi editor- it is use to edit a file. syntax: vi filename Some useful edit Commands in vi editor Esc i-make the file editable Esc w!- Save file Esc q!-quit without saving any changes in the file Esc wq!- quit and saving any changes in the file
Ex.


grep- it searches for a string in any file. This command is usually use in combination with other commands in order to search for a specific string .
Ex. Show all messages containing pbv


du- prints a summary of the amount of information you have stored in your directories on the mounted disks.syntax: du [options] path
Options: -s print the sum of bytes in your directories -a print a
line for each file in your directory
Ex.



tail- shows the end of a text file and allow you to view parts of a text file.
Ex. Show last line from /var/log/maillog



head- shows the beginning of a text file and allow you to view parts of a text file.
Ex. Show first 5 lines from /var/log/maillog




locate -to find out where on your Linux server a particular file resides.
Ex. locate folder pbv



More Advance linux commands .soon!!!!

Tuesday, February 12, 2008

LAMP Server configuration on Centos

Installing LAMP Server on Centos

1).Check /etc/hosts and make sure the host name is setup
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
10.10.10.1 www.example.com

2).Now install all the packages required to have a LAMP server.

yum install perl-DBD-MySQL mysql-server mysql php-mysql mod_auth_mysql openssl mod_ssl php

httpd perl-CPAN

3.After installation, we will want to make the all the programs start for future reboots and

start them right now ... to do that, use the following commands:

chkconfig httpd on
chkconfig mysqld on

Here is how to start them now ....

/etc/init.d/mysqld start
/etc/init.d/httpd start

4).Now test the server if its working by adding a page called info.php to the root directory of my site to make sure everything is working. Edit a file named /var/www/html/info.php and write php code inside the file or type phpinfo() inside the php tags:

5).Now open a web browser and go to your website via either it's name or ip address,

http://www.example.com/info.php

or

http://10.10.10.1/info.php

6).Add this to http.conf

/etc/httpd/conf/httpd.conf


Find the AddType section and uncomment these lines:

AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Now find the DirectoryIndex section and add some info for php. It should look like this:

DirectoryIndex index.html index.phtml index.php index.phps

That should do it. Now restart the Apache http daemon:

killall -HUP httpd

Basic Linux commands

On this tutorial, you will learn the basic commands in Linux CLI specially for those who are new in Linux.

ls
- display all files in the directory.
ls -l
- display file(s) with details,such as permission,owner of the file,date and time created,etc.









cd
- similar in DOS command. Change the directory you are working









pwd- (present working directory) Check on what directory your are currently in.









cp-
copy file fro
m one directory to other or same directory. If you want to copy file1 to file2 type cp file1(source) file2(destination). But if you want to copy in other directory, simply type cp file1 /dir/file2(or /dir if same file name)









rm-
same as del in DOS command. Type rm followed by the filename you wish to delete . You can use rm -f(force) to delete the file without asking confirmation.This is advantage specially you are deleting more files. Type rm -r to delete the entire folder. To delete multiple files with common extension type rm -f *.(txt,zip etc).











mv
- same as move in DOS command. Type mv file1(source) /dir(destination). There's no renaming command in linux CLI but you can rename by using this command, mv file1 file2(same or other directory) then the source file will be deleted









mkdir
- create new directory. Type mkdir newdirectory.
rmdir - delete a directory. Type rmdir existingdirectory.









man- display information of a linux command. Type the command man followed the by linux command you wish to know more about the use of that command.
Ex: show all information about cat











clear-
clean up the command prompt window.
cat-displaying the content of selected file without pausing the screen until it reaches the end of the file.







more-
same way as cat but it will display the file content per page by hitting the space and per line by hitting the Enter button.













less-
more useful than cat and more command. The same way with more but you can scroll up and down the content by hitting arrows and space bar.