Tuesday, January 5, 2010

FTP server

[1] Build FTP server to transfer files. Install and configure vsftpd for it.
[rajat@rajat ~]#
yum -y install vsftpd

Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for vsftpd to pack into transaction set.
vsftpd-2.0.5-10.el5.i386. 100% |========================| 16 kB 00:00
---> Package vsftpd.i386 0:2.0.5-10.el5 set to be updated
--> Running transaction check

Dependencies Resolved

===========================================================
Package
Arch
Version
Repository
Size

===========================================================
Installing:
vsftpd
i386
2.0.5-10.el5
base
137 k


Transaction Summary
===========================================================
Install
1 Package(s)

Update
0 Package(s)

Remove
0 Package(s)


Total download size: 137 k
Downloading Packages:
(1/1): vsftpd-2.0.5-10.el
100% |====================| 137 k 00:00

Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: vsftpd
#################################### [1/1]


Installed: vsftpd.i386 0:2.0.5-10.el5
Complete!
[rajat@rajat ~]#
vi /etc/vsftpd/vsftpd.conf


anonymous_enable=
NO
// line 12: no anonymous


ascii_upload_enable=YES
// line 79: make valid

ascii_download_enable=YES
(permit ascii mode transfer)


chroot_list_enable=YES
// line 94: make valid


(enable chroot list)

chroot_list_file=/etc/vsftpd/chroot_list
// line 96: make valid


(chroot list file)

ls_recurse_enable=YES
// line 102: make valid


chroot_local_user=YES
// bottom: enable chroot

local_root=public_html
// root directory

use_localtime=YES
// use local time


[root@www ~]#
vi /etc/vsftpd/chroot_list


fedora
// write users you permit


[root@www ~]#
/etc/rc.d/init.d/vsftpd start

Starting vsftpd for vsftpd:
[ OK ]

Thursday, December 17, 2009

Identifying Linux Bottlenecks

How Do I Install sar?

Type the following command:
# yum install sysstat -y

Configuration Files

Edit /etc/sysconfig/sysstat file specify how long to keep log files in days, maximum is a month:
# vi /etc/sysconfig/sysstat
Sample outputs:

# keep log for 28 days
# the default is 7
HISTORY=28

# chkconfig sysstat on
# service sysstat start

$ wget http://ksar.atomique.net/kSar/kSar-5.0.6.zip

or Download

http://ksar.atomique.net/kSar/kSar-5.0.6.zip

$ unzip kSar-5.0.6.zip

$ cd kSar-5.0.6/
$ sh run.sh

How Do I Generate sar Graphs Using kSar?

First, you need to grab sar command statistics. Type the following command to get stats, enter (type it on your server):

[server1 ]# LC_ALL=C sar -A > /tmp/hostname-sar.data.txt

Thursday, December 10, 2009

Etisalat DC

 
 
 
Posted by Picasa
 
 
 
 
Posted by Picasa
 
 
 
 
Posted by Picasa
 
 
 
 
Posted by Picasa

Thursday, November 12, 2009

RHEL Installing Apache2 With PHP5 And MySQL Support LAMP Server

LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on a Fedora 11 server with PHP5 support (mod_php) and MySQL support.

Step 1
#yum install mysql mysql-server httpd php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc phpmyadmin



Step 2
In this tutorial I use the hostname rajat.yeswedeal.com with the IP address 192.168.1.110 These settings might differ for you, so you have to replace them where appropriate.

Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:

chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start

Run

mysqladmin -u root password yourrootsqlpassword
mysqladmin -h rajat.yeswedeal.com -u root password yourrootsqlpassword

to set a password for the user root (otherwise anybody can access your MySQL database!).


Apache2 is available as a RHEL package, therefore we can install it like this:

Now configure your system to start Apache at boot time...

chkconfig --levels 235 httpd on

... and start Apache:

/etc/init.d/httpd start

Now direct your browser to http://192.168.1.110, and you should see the Apache2 placeholder

Apache's default document root is /var/www/html on Fedora, and the configuration file is /etc/httpd/conf/httpd.conf. Additional configurations are stored in the /etc/httpd/conf.d/ directory.

We must restart Apache afterwards:

/etc/init.d/httpd restart


Testing PHP5 / Getting Details About Your PHP5 Installation

The document root of the default web site is /var/www/html. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.

vi /var/www/html/info.php



Now we call that file in a browser (e.g. http://192.168.1.110/info.php):

As you see, PHP5 is working, and it's working through the Apache 2.0 Handler, as shown in the Server API line. If you scroll further down, you will see all modules that are already enabled in PHP5. MySQL is not listed there which means we don't have MySQL support in PHP5 yet.

Now restart Apache2:

/etc/init.d/httpd restart

Now reload http://192.168.1.110/info.php in your browser and scroll down to the modules section again. You should now find lots of new modules there, including the MySQL module:

Now we configure phpMyAdmin. We change the Apache configuration so that phpMyAdmin allows connections not just from localhost (by commenting out the stanza):

vi /etc/httpd/conf.d/phpMyAdmin.conf

# phpMyAdmin - Web based MySQL browser written in php
#
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
#
# order deny,allow
# deny from all
# allow from 127.0.0.1
# allow from ::1
#


# This directory does not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#

Order Deny,Allow
Deny from All
Allow from None


# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc. This may break your mod_security implementation.
#
#
#
# SecRuleInheritance Off
#

#


Restart Apache:

/etc/init.d/httpd restart

Afterwards, you can access phpMyAdmin under http://192.168.1.110/phpmyadmin/: