Friday, 29 November 2013

mail_queue_enter: create file maildrop/xxxxxx.xxxx: Permission denied

Yesterday i tried to delete postfix queue mail but i can't delete that. I got below error

[root@server]# postsuper -d ALL

postsuper: fatal: remove file defer/1/13A7B62058F: Permission denied

After i checked following things,

[root@server]# tail /var/log/maillog

Nov 28 18:59:14 server postfix/postdrop[7269]: warning: mail_queue_enter: create file maildrop/913395.7269: Permission denied
Nov 28 18:59:17 server postfix/postdrop[7785]: warning: mail_queue_enter: create file maildrop/960660.7785: Permission denied
Nov 28 18:59:24 server postfix/postdrop[7269]: warning: mail_queue_enter: create file maildrop/913567.7269: Permission denied
Nov 28 18:59:27 server postfix/postdrop[7785]: warning: mail_queue_enter: create file maildrop/960808.7785: Permission denied



[root@server ]# postfix check

postfix/postfix-script: warning: group or other writable: /var/spool/postfix
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/4
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/F
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/5
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/6
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/C
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/0
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/9
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/3
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/7
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/B
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/8
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/E
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/D
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/1
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/1/13A7B62058F
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/A
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/2
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/defer/2/2F356620591
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/4
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/F
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/5
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/6
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/C
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/0
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/9
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/3
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/7
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/B
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/8
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/E
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/D
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/1
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/1/13A7B62058F
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/A
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/2
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/deferred/2/2F356620591
postfix/postfix-script: warning: not set-gid or not owner+group+world executable: /usr/sbin/postqueue
postfix/postfix-script: warning: not set-gid or not owner+group+world executable: /usr/sbin/postdrop
[root@server ]#



The above error is giving the permission error . So i restored default permission for postfix using below command

[root@server]# postfix set-permissions

After i  run "postfix check" command. It is not showing any error.

Again i tried to clear the queue mail but i can't. So i stopped the postfix service

[root@server]# service postfix stop

Shutting down postfix:                                     [  OK  ]

After I checked postdrop process using below command

[root@server]# pgrep postdrop

7269
7785

I killed all the postdrop process 

[root@server]# killall postdrop
I restarted the posfix service

[root@server]# service postfix restart 

Shutting down postfix:                                     [FAILED]
Starting postfix:                                          [  OK  ]
 

Now i can able to remove my queue mail.....

Thursday, 21 November 2013

How to install nginx on Centos 6.3 x86_64


First you need to install EPEL repo.Already you installed EPEL then  move to next steps otherwise you will install the EPEL repo from this link.

Now i am going to install nginx using yum command
 
[root@localhost ~]# yum install nginx

Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
epel/metalink                                                                                                                                    | 5.0 kB     00:00    
 * base: mirror.linux.duke.edu
 * epel: ftp.kddilabs.jp
 * extras: mirror.linux.duke.edu
 * rpmforge: ftp.cc.uoc.gr
 * updates: centosq4.centos.org
base                                                                                                                                             | 3.7 kB     00:00    
epel                                                                                                                                             | 4.2 kB     00:00    
epel/primary_db                                                                                                                                  | 5.7 MB     00:15    
extras                                                                                                                                           | 3.4 kB     00:00    
linuxtech-release                                                                                                                                | 2.6 kB     00:00    
rpmforge                                                                                                                                         | 1.9 kB     00:00    
updates                                                                                                                                          | 3.4 kB     00:00    
updates/primary_db                                                                                                                               | 5.1 MB     00:20    
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 0:1.0.15-5.el6 will be installed
--> Processing Dependency: gd for package: nginx-1.0.15-5.el6.x86_64
--> Processing Dependency: GeoIP for package: nginx-1.0.15-5.el6.x86_64
--> Processing Dependency: libgd.so.2()(64bit) for package: nginx-1.0.15-5.el6.x86_64
--> Processing Dependency: libGeoIP.so.1()(64bit) for package: nginx-1.0.15-5.el6.x86_64
--> Running transaction check
---> Package GeoIP.x86_64 0:1.4.8-3.el6 will be installed
---> Package gd.x86_64 0:2.0.35-11.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                            Arch                                Version                                    Repository                                      Size
========================================================================================================================================================================
Installing:
 nginx                              x86_64                              1.0.15-5.el6                               epel                                           397 k
Installing for dependencies:
 GeoIP                              x86_64                              1.4.8-3.el6                                linuxtech-release                              618 k
 gd                                 x86_64                              2.0.35-11.el6                              base                                           142 k

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

Total download size: 1.1 M
Installed size: 3.1 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): GeoIP-1.4.8-3.el6.x86_64.rpm                                                                                                              | 618 kB     00:01    
(2/3): gd-2.0.35-11.el6.x86_64.rpm                                                                                                               | 142 kB     00:01    
(3/3): nginx-1.0.15-5.el6.x86_64.rpm                                                                                                             | 397 kB     00:01    
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                   218 kB/s | 1.1 MB     00:05    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : gd-2.0.35-11.el6.x86_64                                                                                                                              1/3
  Installing : GeoIP-1.4.8-3.el6.x86_64                                                                                                                             2/3
  Installing : nginx-1.0.15-5.el6.x86_64                                                                                                                            3/3
  Verifying  : GeoIP-1.4.8-3.el6.x86_64                                                                                                                             1/3
  Verifying  : nginx-1.0.15-5.el6.x86_64                                                                                                                            2/3
  Verifying  : gd-2.0.35-11.el6.x86_64                                                                                                                              3/3

Installed:
  nginx.x86_64 0:1.0.15-5.el6                                                                                                                                          

Dependency Installed:
  GeoIP.x86_64 0:1.4.8-3.el6                                                          gd.x86_64 0:2.0.35-11.el6                                                        

Complete!
[root@localhost ~]#


Next we need to start the nginx service


[root@localhost ~]# /etc/init.d/nginx start

Starting nginx:                                            [  OK  ]
[root@localhost ~]#



If you want to know about nginx file location then you can use below command

[root@localhost ~]# rpm -ql nginx

/etc/logrotate.d/nginx
/etc/nginx
/etc/nginx/conf.d
/etc/nginx/conf.d/default.conf
/etc/nginx/conf.d/ssl.conf
/etc/nginx/conf.d/virtual.conf
/etc/nginx/fastcgi.conf
/etc/nginx/fastcgi.conf.default
/etc/nginx/fastcgi_params
/etc/nginx/fastcgi_params.default
/etc/nginx/koi-utf
/etc/nginx/koi-win
/etc/nginx/mime.types
/etc/nginx/mime.types.default
/etc/nginx/nginx.conf
/etc/nginx/nginx.conf.default
/etc/nginx/scgi_params
/etc/nginx/scgi_params.default
/etc/nginx/uwsgi_params
/etc/nginx/uwsgi_params.default
/etc/nginx/win-utf
/etc/rc.d/init.d/nginx
/etc/sysconfig/nginx
/usr/lib64/perl5/vendor_perl/auto/nginx
/usr/lib64/perl5/vendor_perl/auto/nginx/nginx.so
/usr/lib64/perl5/vendor_perl/nginx.pm
/usr/sbin/nginx
/usr/share/doc/nginx-1.0.15
/usr/share/doc/nginx-1.0.15/CHANGES
/usr/share/doc/nginx-1.0.15/LICENSE
/usr/share/doc/nginx-1.0.15/README
/usr/share/man/man3/nginx.3pm.gz
/usr/share/man/man8/nginx.8.gz
/usr/share/nginx
/usr/share/nginx/html
/usr/share/nginx/html/404.html
/usr/share/nginx/html/50x.html
/usr/share/nginx/html/index.html
/usr/share/nginx/html/nginx-logo.png
/usr/share/nginx/html/poweredby.png
/var/lib/nginx
/var/lib/nginx/tmp
/var/log/nginx
[root@localhost ~]#

Now you can able to access the nginx default page. Go to web browser and type your machine ip address or localhost. In my case ip address 10.118.248.52


It's working...

Tuesday, 19 November 2013

Install Thunderbird on Centos 6.3 x86_64

First you need to install EPEL repo.Already you installed EPEL then  move to next steps otherwise you will install the EPEL repo from this link.

After installing the EPEL repo you will check availability of thunderbird use the following command

[root@manivel ~]# yum list thunderbird
 

Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
epel/metalink                                                                                    | 5.5 kB     00:00    
 * base: mirrors.digipower.vn
 * epel: mirror.neu.edu.cn
 * extras: mirror.vietoss.com
 * updates: 
mirror.vietoss.com
base                                                                                                   | 3.7 kB     00:00   
extras                                                                                                 | 3.4 kB     00:00   
google-chrome                                                                                   |  951 B     00:00   
linuxtech-release                                                                                | 2.6 kB     00:00   
updates                                                                                              | 3.4 kB     00:00   
Available Packages
thunderbird.x86_64           17.0.10-1.el6.centos                                updates
 

Install Thunderbird using below command

[root@manivel ~]# yum install thunderbird
 

Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: centos-hn.viettelidc.com.vn
 * epel: mirror.neu.edu.cn
 * extras: mirror.vietoss.com
 * updates: mirror.vietoss.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package thunderbird.x86_64 0:17.0.10-1.el6.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

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

Installing:
 thunderbird      x86_64                17.0.10-1.el6.centos       updates              38 M

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

Total download size: 38 M
Installed size: 71 M
Is this ok [y/N]: y
Downloading Packages:
http://mirror.vietoss.com/CentOS/6.4/updates/x86_64/Packages/thunderbird-17.0.10-1.el6.centos.x86_64.rpm: [Errno 12] Timeout on http://mirror.vietoss.com/CentOS/6.4/updates/x86_64/Packages/thunderbird-17.0.10-1.el6.centos.x86_64.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.
thunderbird-17.0.10-1.el6.centos.x86_64.rpm                                                                                                      |  38 MB     01:25   
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : thunderbird-17.0.10-1.el6.centos.x86_64                                                                                                              1/1
  Verifying  : thunderbird-17.0.10-1.el6.centos.x86_64                                                                                                              1/1

Installed:
  thunderbird.x86_64 0:17.0.10-1.el6.centos                                                                                                                           

Complete!


Now you can open the thunderbird via command line


[root@manivel ~]# thunderbird 



If you want to open through graphical then Go to Applications ---> Internet ----> Thunderbird Email

Monday, 18 November 2013

tail: cannot watch `/var/log/httpd/access_log': No space left on device

Yesterday  suddenly I checked my apache log using following command 

[root@localhost ~]# tailf /var/log/httpd/access_log

but above command was showing error. It is like below

tail: cannot watch `/var/log/httpd/access_log': No space left on device

 After i searched google and found solution.


Solution: 


             I need to increase inotify value. I checked my default inotify value in below path
" /proc/sys/fs/inotify/max_user_watches " after that i changed that value 8192 to 16384.
This above value depends upon your needs.

         [root@localhost ~]# cat /proc/sys/fs/inotify/max_user_watches 
         8192

         [root@localhost ~]# echo 16384 > /proc/sys/fs/inotify/max_user_watches
 

Issue resolved....

Friday, 1 November 2013

How to check Hardware Information using "dmidecode" on Linux

dmidecode  is a tool for dumping a computer’s DMI  table contents in a human-readable format. This table contains a description of the system’s hardware components.

Type the dmidecode command in command line and you will get long output.It's like below (here i showed little bit)

[root@manivel ~]# dmidecode
 
# dmidecode 2.11
SMBIOS 2.7 present.
25 structures occupying 1180 bytes.
Table at 0x000E6860.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
    Vendor: INSYDE
    Version: 1.20
    Release Date: 08/01/2011
    Address: 0xF0000
    Runtime Size: 64 kB
    ROM Size: 4096 kB
    Characteristics:
        PCI is supported
        PNP is supported

If You could like to find specific hareware information, then you can use dmidecode command with "String keywords (-s) " or "Type keywords (-t) ". You can get both keyword from man page.
( man dmidecode)

String keywords :

  bios-vendor
  bios-version
  bios-release-date
  system-manufacturer
  system-product-name
  system-version
  system-serial-number
  system-uuid
  baseboard-manufacturer
  baseboard-product-name
  baseboard-version
  baseboard-serial-number
  baseboard-asset-tag
  chassis-manufacturer
  chassis-type
  chassis-version
  chassis-serial-number
  chassis-asset-tag
  processor-family
  processor-manufacturer
  processor-version
  processor-frequency
  

Type keywords


  bios
  system
  baseboard
  chassis
  processor
  memory
  cache
  connector
  slot

 
Here i am going to show you how to use above option. 

For example if you want to know the bios-version only then you can use string keyword. Open your terminal with root user.

[root@manivel ~]# dmidecode -s bios-version
 
1.20
 
If you want  to know the processor-version then type below command

[root@manivel ~]# dmidecode -s processor-version
 
Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz
 
If you want to know BIOS full details then you can use below command

[root@manivel ~]# dmidecode -t bios
 
# dmidecode 2.11
SMBIOS 2.7 present.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
    Vendor: INSYDE
    Version: 1.20
    Release Date: 08/01/2011
    Address: 0xF0000
    Runtime Size: 64 kB
    ROM Size: 4096 kB
    Characteristics:
        PCI is supported
        PNP is supported
        BIOS is upgradeable
        BIOS shadowing is allowed
        Boot from CD is supported
        Selectable boot is supported
        EDD is supported
        8042 keyboard services are supported (int 9h)
        CGA/mono video services are supported (int 10h)
        ACPI is supported
        USB legacy is supported
        AGP is supported
        Smart battery is supported
        BIOS boot specification is supported
        Function key-initiated network boot is supported
        Targeted content distribution is supported
    BIOS Revision: 1.20
    Firmware Revision: 1.40

 If you want to know about System product name and serial number then you can use below command.

[root@manivel ~]# dmidecode -t system
 
# dmidecode 2.11
SMBIOS 2.7 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
    Manufacturer: TOSHIBA
    Product Name: Satellite C640
    Version: PSC2UG-014001
    Serial Number: YB112847Q

    UUID: C04687AB-720C-E111-AA37-00266CE6425D
    Wake-up Type: Power Switch
    SKU Number: PSC2UG-014001
    Family: 

Handle 0x0005, DMI type 12, 5 bytes
System Configuration Options
    Option 1: NVR:00707902
    Option 2: DSN: X197S1O3S         
    Option 3: DSN:TSB1333D3S9SR8/2G471A397D
    Option 4: 

Handle 0x0007, DMI type 32, 20 bytes
System Boot Information
    Status: No errors detected

If you want to know about Memory information then type below command.The below command will show Total RAM slot, Maximum RAM capacity and Total RAM Memory etc...

[root@manivel ~]# dmidecode -t memory
 
# dmidecode 2.11
SMBIOS 2.7 present.

Handle 0x0008, DMI type 16, 15 bytes
Physical Memory Array
    Location: System Board Or Motherboard
    Use: System Memory
    Error Correction Type: None
    Maximum Capacity: 32 GB
    Error Information Handle: 0x0011
    Number Of Devices: 2

Handle 0x0009, DMI type 17, 34 bytes
Memory Device
    Array Handle: 0x0008
    Error Information Handle: 0x000B
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 2048 MB
    Form Factor: SODIMM
    Set: None
    Locator: DIMM0
    Bank Locator: BANK 0
    Type: DDR3
    Type Detail: Synchronous
    Speed: 1333 MHz
    Manufacturer: Kingston
    Serial Number: 471A397D
    Asset Tag: 0123456789
    Part Number: TSB1333D3S9SR8/2G
    Rank: Unknown
    Configured Clock Speed: 1333 MHz

Handle 0x000A, DMI type 6, 11 bytes
Memory Module Information

Handle 0x000D, DMI type 17, 34 bytes
Memory Device
    Array Handle: 0x0008
    Error Information Handle: 0x000F
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 2048 MB
    Form Factor: SODIMM
    Set: None
    Locator: DIMM1
    Bank Locator: BANK 2
    Type: DDR3
    Type Detail: Synchronous
    Speed: 1333 MHz
    Manufacturer: Transcend Information
    Serial Number: 00096FF6
    Asset Tag: 0123456789
    Part Number: JM1333KSN-2G    
    Rank: Unknown
    Configured Clock Speed: 1333 MHz

Handle 0x000E, DMI type 6, 11 bytes
Memory Module Information

Handle 0x0013, DMI type 5, 20 bytes
Memory Controller Information
    Error Detecting Method: None
    Error Correcting Capabilities:
        Unknown
        None
    Supported Interleave: One-way Interleave
    Current Interleave: One-way Interleave
    Maximum Memory Module Size: 8192 MB
    Maximum Total Memory Size: 16384 MB
    Supported Speeds:
        Other
    Supported Memory Types:
        Other
    Memory Module Voltage: Unknown
    Associated Memory Slots: 2
        0x000A
        0x000E
    Enabled Error Correcting Capabilities:
        None
 
 If you want to know about Procssor details, then you can use below command

[root@manivel ~]# dmidecode -t processor
 
# dmidecode 2.11
SMBIOS 2.7 present.

Handle 0x0014, DMI type 4, 42 bytes
Processor Information
    Socket Designation: CPU
    Type: Central Processor
    Family: Core i5
    Manufacturer: Intel(R) Corporation

    ID: A7 06 02 00 FF FB EB BF
    Signature: Type 0, Family 6, Model 42, Stepping 7
    Flags:
        FPU (Floating-point unit on-chip)
        VME (Virtual mode extension)
        DE (Debugging extension)
        PSE (Page size extension)
        TSC (Time stamp counter)
        MSR (Model specific registers)
        PAE (Physical address extension)
        MCE (Machine check exception)
        CX8 (CMPXCHG8 instruction supported)
        APIC (On-chip APIC hardware supported)
        SEP (Fast system call)
        MTRR (Memory type range registers)
        PGE (Page global enable)
        MCA (Machine check architecture)
        CMOV (Conditional move instruction supported)
        PAT (Page attribute table)
        PSE-36 (36-bit page size extension)
        CLFSH (CLFLUSH instruction supported)
        DS (Debug store)
        ACPI (ACPI supported)
        MMX (MMX technology supported)
        FXSR (FXSAVE and FXSTOR instructions supported)
        SSE (Streaming SIMD extensions)
        SSE2 (Streaming SIMD extensions 2)
        SS (Self-snoop)
        HTT (Multi-threading)
        TM (Thermal monitor supported)
        PBE (Pending break enabled)
    Version: Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz
    Voltage: 1.3 V
    External Clock: 1333 MHz
    Max Speed: 4000 MHz
    Current Speed: 2400 MHz

    Status: Populated, Enabled
    Upgrade: ZIF Socket
    L1 Cache Handle: 0x0015
    L2 Cache Handle: 0x0016
    L3 Cache Handle: 0x0017
    Serial Number: Not Specified
    Asset Tag: FFFF
    Part Number: Not Specified
    Core Count: 2
    Core Enabled: 2
    Thread Count: 4
    Characteristics:
        64-bit capable

I hope, you get some ideas from here...