linux inode consume 100 percent solution

What is the inode?

Files stored on the hard disk,HDD minimum storage units called "sectors" (Sector)。Store 512 bytes per sector (equivalent 0.5KB)。
Operating system hard to read when,Not read a sector,Such efficiency is too low,But sequential read more sectors at once,That is a one-time read "block" (block)。This from a plurality of sectors "chunks",It is the smallest unit file access。Size "chunks",The most common is 4KB,That is a block consisting of eight consecutive sector。
Data files are stored in the "block" in the,Then it is clear,We must also find a place to store meta-information file,For example, the creator of the file、File creation date、File size, etc.。This storage area file meta information is called inode,Chinese translation for "inode"。
Each file has a corresponding inode,Which contains some information and documents relating to the。

How to view innode occupancy System

df -ih

How do I find that most catalog file

First cut to the root directory /

cd /

And then do

for i in /*; do echo $i; find $i | wc -l; done

or

for i in `ls -1A | grep -v "\.\./" | grep -v "\./"`; do echo "`find $i | sort -u | wc -l` $i"; done | sort -rn | head -10

This will in turn return/Most files under directory,Into this directory,And then execute the above command,In this way layers of depth is up to finalize the directory file

How do I delete all the files in that directory

Under normal circumstances,If there should be millions of files in this directory,If you directly rm -rf 目录名 If inefficient,You can use the following method

find 目录 -type f -name '*' -print0 | xargs -0 rm

Time may be relatively long,So you'd better open a screen to handle

You may be experiencing the following circumstances

/var / spool / postfix / maildrop below many files
in order to avoid,You can perform crontab -e
At the beginning of the most added MAILTO='"' Save,then server crond restart Restart crond

Comments

The method of Linux release the disk space occupied

1、Check with df find / root directory of free space 0

[root@/]#df -h

2、Check each directory found with du occupies very little space,About 3G space somehow lost。

[root@/]# du -m –max-depth=1 |sort -gr

3、Check with lsof after the discovery of reason,There files are deleted,And the process is still alive,Resulting phenomenon also takes up space

[root@/]# lsof |grep delete

According to numbers listed in the process lsof,After these processes kill,Space is released out

Comments

Linux how to modify the default port number of SSH?

In the installed linux,By default ssh is open,Vulnerable to hacker attacks,simple,Effective action is to modify one of the default port number
Such as the following,We modify my 22 2501
It is to modify / etc / ssh / sshd_config // note,Easy and ssh_config mixed
step one
[root@localhost ssh]# more sshd_config
# $OpenBSD: sshd_config,v 1.69 2004/05/23 23:59:53 dtucker Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
#Port 22 //Comment out the first 22
port 2501 //Add a new port
#Protocol 2,1
Step Two
[root@localhost ~]# service sshd restart
Stopping sshd:[ OK ]
Starting sshd:[ OK ]
Step Three
Testing with SecureCRT

Comments

Linux Firewall Configuration,Open port 80、3306port

vi /etc/sysconfig/iptables

-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT (allow 80 port through the firewall)
-A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT (allow port 3306 through the firewall)
Special Note:Many users add these two rules to the last line of firewall configuration,Cause the firewall fails to start,Right should be added to the default port 22. This rule below
After adding a good firewall rules are as follows:

######################################
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT
-A INPUT -j REJECT –reject-with icmp-host-prohibited
-A FORWARD -j REJECT –reject-with icmp-host-prohibited
COMMIT
#####################################

/etc/init.d/iptables restart
#Finally, reboot the firewall configuration to take effect

Comments

PHP Mcrypt on CentOS 6

Yay, CentOS 6 still doesn’t by default include mcrypt in it’s distribution on repositories.

There is hope, EPEL to the rescue again:

 

1
2

 

You should see EPEL listed as the repos, then:

1
yum install php-mcrypt

Also a few of you have mentioned you need to restart Apache. To do this:

1
service httpd restart

Done.

If you want to do the same for CentOS 7 then simply use this instead:

**Please note the above download is for CentOS 6 x86_64 **

UPDATE 12/02/2013: Updated to Latest Link for EPEL 6.8
UPDATE 05/01/2015: Added the link for CentOS 7/EPEL 7.5

Comments

Linux system to mount、Uninstall the new hard disk method

VMware virtual machine,Linux system to mount、Uninstall the new hard disk method
load:

1、Start vm,Select vm->Settings,Follow the wizard to add a SCSI disk。Into the Linux system。
2、 fdisk -l will see a new set,If you previously have a hard drive(sda1, sda3…),This should be added the new(/dev / sdb)。 (If you add a second hard drive is IDE hard disk,You should see hdb,If the SCSI hard disk,See is what should sdb)
[root@localhost ~]# fdisk -l

Disk / dev / sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev / sda1 * 1 13 104391 83 Linux
/dev / sda3 14 1044 8281507+ 83 Linux

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn’t contain a valid partition table

3、Partition:
[root@localhost ~]# fdisk / dev / sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.

The number of cylinders for this disk is set to 1044.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS / 2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): m ## m press here ,Output will help;
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition ## which is to delete a partition action;
l list known partition types ##:l is to list the partition type,We set the type for the corresponding partition;
m print this menu
n add a new partition ## to add a partition;
o create a new empty DOS partition table
p print the partition table ## p listed in the partition table;
q quit without saving changes ##不保存退出;
s create a new empty Sun disklabel
t change a partition's system id ## t to change the partition type;
u change display/entry units
v verify the partition table
w write table to disk and exit ## of the partition table is written to disk and exit;
x extra functionality (experts only) ##Extended Application,Expert Features;

Command (m for help): n
Command action
e extended ## extended partition
p primary partition (1-4) ##Built selected p primary partition
p
Partition number (1-4): 1
First cylinder (1-17849, default 1): ##Note:This is the Start value partition;Here the best press enter,If you enter a non-default number,It will result in wasted space;
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-17849, default 17849): 8920
Using default value 500
##This is the definition of the size of the partition,+200M is the size of 200M ;Of course, you can also according to the size of the tip above the cylinder unit to count,Then specify the value End,In fdisk -l command can be seen in Units = cylinders of 16065 * 512 = 8225280 bytes,This unit is the size of the cylinder,I am here to choose the End value is 8920,Exactly half the total size,71G about

##Then come to build a primary partition
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (8921-17849, default 8921):8921
Using default value 8921
Last cylinder or +size or +sizeM or +sizeK (8921-17849, default 17849):17849
Using default value 17849
##Finally, save and exit,Remember,Be sure to save,Or will not take effect。
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
##Use fdisk -l command to view disk status:
[root@localhost ~]# fdisk -l

Disk / dev / sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev / sda1 * 1 13 104391 83 Linux
/dev / sda3 14 1044 8281507+ 83 Linux

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 8920 71649868+ 83 Linux
/dev/sdb2 8921 17849 71722192+ 83 Linux
##Disk / dev / sdb has been divided into two partitions,Each partition size is probably around 71G。

##Prior to mount the file system,You need to be / dev / sdb1 and / dev / sdb2 re-use mkfs -t ext3 formatted commands about,Otherwise the mount will complain。
4、Format the partition:Use mkfs.ext3 / dev / sdb command to format the disk Note:You can also use the mkfs -t ext3 / dev / sdb command
[root@localhost ~]# mkfs -t ext3 / dev / sdb1 ## refers to the disk formatted to ext3 file system
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1048576 inodes, 2096474 blocks
104823 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2147483648
64 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

supplement:Mounting
Mounting File Systems,There are two methods:
First, through the mount to mount,Use mount mount system,Once the system is restarted will need to be remounted。
Second, through the / etc / fstab file to automatically mount the boot。
I put the / dev / sdb1 mount / test next
[root@localhost ~]# mkdir /test ## Firstly mounted directory test
(or[root@localhost ~]# cd /
[root@localhost ~]# mkdir test
)
[root@localhost ~]# df -h ## mounted in front of the partition
Filesystem Size Used Avail Use% Mounted on
/dev / mapper / VolGroup00-LogVol00
6.7G 5.8G 576M 92% /
/dev/sda1 99M 12M 82M 13% /boot
tmpfs 233M 0 233M 0% /dev/shm
[root@localhost ~]# mount /dev/sdb1 /test
[root@localhost ~]# Partition df -h ## mounted after
Filesystem Size Used Avail Use% Mounted on
/dev / mapper / VolGroup00-LogVol00
6.7G 5.8G 576M 92% /
/dev/sda1 99M 12M 82M 13% /boot
tmpfs 233M 0 233M 0% /dev/shm
/dev / sdb1 7.9G 147M 7.4G 2% /test
6、Via / etc / fstab file to automatically mount the boot(Otherwise, the system will not be saved after restart the computer before the mount operation):
[root@localhost ~]# vi / etc / fstab
/dev / VolGroup00 / LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
/dev/sdb1 /test ext3 defaults 1 1
/dev/sdb2 /test ext3 defaults 1 1
# Beginning of the block added by the VMware software
.host:/ /mnt/hgfs vmhgfs defaults,ttl=5 0 0
# End of the block added by the VMware software
The first field:Equipment name,Here is the file system representation; Sometimes we mount a file system is also said to mount the partition;
The second field:File system mount point;
The third field:File System Types;
Fourth field:Mount command options,And the mount -o empathy;These options include defaults rw, south, dev, exec, auto, nouser, async;
Fifth field:Need to dump the file system backup,1Need,0 It is not required;
Sixth field: Whether at system startup,By fsck to check the file system disk detection tools,1Need,0It is not required,2Skip;

Uninstall:
[root@localhost ~]# umount /dev/sdb1
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev / mapper / VolGroup00-LogVol00
6.7G 5.8G 576M 92% /
/dev/sda1 99M 12M 82M 13% /boot
tmpfs 233M 0 233M 0% /dev/shm

 

Additional knowledge:
1. What can be used to mount the mount:
Different operating systems use different file system format。MS-DOS supports the FAT16 file system,Windows98 supports FAT16、FAT32 file system,WindowsNT支持FAT16、NTFS file system,Windows2000 supports FAT16、FAT32、NTFS three file system formats,Now xp supports FAT32, NTFS,The latest version now windows 7 It introduces a new WinFS file system。 The Linux support almost all file system format,But generally use ext2 or ext3 file system。Many users are using the windows operating system,If you want to access other file system resources to run under Linux if,We will use Linux mount command to achieve。
2. mount use format:
mount命令[-parameter] [Device Name] [Mount points]
Explanation:
[Mount points]It must be an existing directory,This directory can not be empty,But the latter mount the directory contents will not be available before,umount will return to normal after。
[Device Name] It can be a partition,A usb device,CD-ROM,floppy disk,Network sharing。
Common Parameter Description:
Mount Mount File System Help
Parameter Description
To mount the specified device type:adfs, affs, autofs, coda, coherent, cramfs,

devpts, efs, ext, ext2, ext3, hfs, hpfs, ISO9660, jfs, minix,

msdos, ncpfs, nfs, nfs4, ntfs, proc, qnx4, ramfs, reiserfs,

romfs, smbfs, sysv, tmpfs, perform, ufs, umsdos, vfat, xenix, xfs,

xiafs

General File Types,May not need to specify the same can be automatically detected (adfs, bfs,

cramfs, ext, ext2, ext3, hfs, hpfs, ISO9660, jfs, minix, ntfs,

qnx4, reiserfs, romfs, perform, ufs, vxfs, xfs, xiafs file system, etc.),Such as

If the probe fails,Will visit the / etc / filesystems ,Probe to the specified file system。Say

Bright:If you know the file system,Better to specify particular types。The catastrophic error detection

of。
Multiple file system can be used ","Splitting off.

-t vfstype mount -a -t nomsdos,ext
Fstab file will mount all file systems specified,In addition to the type msdos and ext

That some of。
Common file types
1. ext2 linux file system currently used
2. msdos MS-DOS的fat,It is fat16 vfat
3. windows98 common fat32
4. nfs Network File System
5. smbfs windows sharing system
6. iso9660 CD-ROM disc standard file system
7. ntfs windows NT / 2000 / XP file system
8. auto automatic detection of the file system
Specifies the mount system options:Multiple options can be used”,”Segmentation. Some options only appear in the file / etc / fstab the only meaningful。The following options can be used to mount any file system(But not all file systems are concerned they,E.g,Today only option to sync ext2,ext3 and ufs effective)
Option Description
async all file system I / O operations must be done asynchronously。
Atime Update inode access times at each access。This is the default option。
auto can be mounted when using the -a option。
defaults contains the following options:rw, south, dev, exec, auto, nouser,async.
dev file system parsing character or block devices。
exec allow execution of binaries
_netdev file system residing on the need for network-connected devices,Avoid disconnection under,Consumption of resources continues to mount
noatime Do not update inode access time of the file system(Enhance the speed of the news server)
noauto only be explicitly mount,-You can not mount a
nodev not parse the file system of character or block devices
noexec not allowed to be loaded in the file system any binary file
nosuid Do not allow set-user-identifier or set-group-identifier bits to work
nouser prohibited ordinary mount a file system(default)
remount attempt to remount an already-mounted file system。Tag is used to change the mount,As indicated by the read-only mount into a read-write。
ro mounted read-only
rw mounted read-write
suid Allow set-user-identifier or set-group-identifier bits to work
-o options sync in a synchronized manner for I / O operations,A sudden power failure will not be lost data,But heavier burden disk
dirsync All directory updates within the file system should be done synchronously,Affects the following system calls:creat,link, unlink, symlink, mkdir, rmdir, mknod 以及 rename
user Allow an ordinary user to mount the file system,Mount's user name is written to mtab,So that he can unmount the file system again。This option implies the options noexec,nosuid, And nodev.
users allows each user to mount unmount the file system
codepage codepage = XXX code page
iocharset iocharset = XXX character set
loop maneuver mount devices are often used to mount iso file
username username = user access device user name
Password password password = pass access device
The following parameters are only useful for special file system:
uid / gid uid = value and gid = value to specific users and groups to mount system
Permissions mask ownmask ownmask = value owner rights
Permissions mask othmask othmask = value othmask rights
Different file systems supported by the system do not necessarily attribute。You can find relevant information
-a search / etc / fstab file in the file system to meet the conditions,Be mounted operation。
format: mount -a -t type -o options do not need to specify a device / directory
-f test mount system,Only check device and directory,Not really mount a file system
-n not to mount record,Recorded in the / etc / mtab file
-r The file system is mounted as read only,with(-a ro)
-w file systems mounted for read and write,with(-about rw)
-L label Mount the partition that has the specified label in the label
-w file systems mounted for read and write,with(-about rw)
-v display detailed progress mount
-l List system has a list of all mounted file

–bind the part of the file hierarchy remounted elsewhere. Only a single file system mount,
If there are other file system directory,Will not mount。If you need to mount all,Can use:–rbind parameters。
mount –bind olddir newdir 2 can access the system directory content
–move a directory moved to another place,mount –move olddir newdir
-h Display help
-V Display version

3. Common partition load method:
mount mount iso file:
#mkdir /mnt/iso1
#mount –o loop linuxsetup.iso /mnt/iso1
In linux virtual drive is not required,You can read the iso file directly。
mount to mount the CD system
Generally CDROM device file is / dev / hdc,how to use:
#mkdir /mnt/cdrom
#mount /dev/hdc /mnt/cdrom –o iocharset=cp936
The default does not specify the drive system,You can get automatic search,The coding is specified as Chinese
mount mount Floppy Drive
# mkdir /mnt/floppy
# mount /dev/fd0 /mnt/floppy
The default does not specify a file system,You can get automatic search
mount mount windows shared files(samba)
#mkdir /mnt/winshare
#mount -t smbfs -o username=w,password=w,codepage=936,iocharset=gb2312 //192.168.0.101/share /mnt/winshare
Specifies the user name to access the shared,password,codepage specifies the encoding and iocharset same meaning。Here windows system is Chinese Simplified。
codepage specifies the file system code page,Simplified Chinese Chinese code 936;iocharset specify the character set,Simplified Chinese ships with cp936 or gb2312
mount mount u disk
If your computer is under no other SCSI devices and peripherals usb case,Insert U disk device path is / dev / sda1,Command:
#mkdir / mnt / overlay
#mount / dev / sda1 / mnt / overlay
To mount。
mount nfs mount system
Connection windows share similar。We need to configure the nfs server service。Then the client:showmount -e 192.168.0.30 You can view the connection。
mount -t nfs 192.168.0.30:/tmp /mnt/nfs
umount unmount the file system
umount dir
As described above: umout / mnt / upan or umount / dev / sdb1

Comments

XenServer create and mount the local SR ISO file storage

SSH login Xenserver。

1) Check the volume group information:
# vgdisplay

2) Write down VGname:
VG_XenStorage-a009e816-aa69-b507-71bf-b89409c63793

3) Create a logical volume allocation size and naming and formatting:
# lvcreate -L 20G -n iso VG_XenStorage-a009e816-aa69-b507-71bf-b89409c63793
# mkfs.ext3 /dev/VG_XenStorage-a009e816-aa69-b507-71bf-b89409c63793/iso

5) Create a local mount directory
# mkdir /iso

6) Edit / etc / fstab settings automatically mount the logical volume
# vi / etc / fstab

Add the following
/dev/VG_XenStorage-a009e816-aa69-b507-71bf-b89409c63793/iso /iso ext3 defaults 0 0

7) Mount the logical volume
# mount /iso

8) Create iso xenserver local library(SR store)
# xe sr-create name-label=iso type=iso device-config:location=/iso device-config:legacy_mode=true contente-type=iso

9) Xenserver mount iso
# xe-mount-iso-sr /iso -o bind

This process is completed,cd / iso wegt ISO file system,
After creating a virtual machine(VM)Time,In the process of installation media that you can choose to install to the corresponding mount iso。

#xe-toolstack-restart

Comments

cpanel apache re-established

/scripts/rebuildhttpdconf

Comments

Protected: ssssssss 使用方法

This content is password protected. To view it please enter your password below:

Enter your password to view comments.

Delete all messages Exim mail queue

Excuting an order:
# exim -bp | exiqgrep -i | xargs exim -Mrm
就可以删除 Exim 的邮件队列的所有邮件

查看所有邮件可使用命令:
# exim -bp

Panel cPanel server can also view and delete mail ConfigServer Mail Queues,More intuitive,But not as good as the high command when a large number of messages when efficiency。

Comments

Web hosting and domain names bound pseudo-static rule 301 Jump .htaccess 301 redirect

.htaccess apache This module is regarded as one called it expanded to show the template,To make it possible to run must RewriteEngine:Let's rewrite the following features on or off。on open;is closed off,Possible。

Redirect Old domain name .com to www. New domain name .com.

 

Code is as followsCopy the code

RewriteEngine On
RewriteCond %{HTTP_HOST} !Old domain name .com $ [NC]
RewriteRule ^(.*)$ http://www. new domain name .com / $ 1 [L,R=301]

Redirect Old domain name .com to the new domain name .com

Code is as followsCopy the code

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !Old domain name .com $ [NC]
RewriteRule ^(.*)$ http://The new domain name .com / $ 1 [L,R=301]

重定向domain.com/file/file.php 到 otherdomain.com/otherfile/other.php

Code is as followsCopy the code

RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^file/file.php$ http://www.otherdomain.com/otherfile/other.php [R = 301, L]

RewriteBase /news
RewriteCond %{HTTP_HOST} ^www.111cn.net [NC]
RewriteRule com(.*)$ http://www.111cn.net$1 [L,R=301]

#Not slash the requested address is /wwwroot/www.111cn.net/news/

Code is as followsCopy the code

RewriteCond %{HTTP_HOST} ^www.111cn.net [NC]
RewriteRule (.*)$ http://www.111cn.net/news/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^124.173.133.154 [NC]
RewriteRule com(.*)$ http://www.111cn.net$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^124.173.133.154 [NC]
RewriteRule (.*)$ http://www.111cn.net/news/$1 [L,R=301]

# Modify the following statement / discuz address for your Groups directory,If the program is placed in the root directory,Please / discuz modify /
RewriteBase /

# Rewrite rules do not modify the system

Code is as followsCopy the code

RewriteCond %{HTTP_HOST} !^www.111cn.net$ [NC]
RewriteRule ^(.*)$ http://www.111cn.net/$1 [L,R=301]
RewriteRule ^archiver/((in|time)-[w-]+.html)$ archiver/index.php?$1
RewriteRule ^forum-([0-9]+)-([0-9]+).html $ forumdisplay.php?at $ 1 =&page=$2
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+).html $ viewthread.php?Time = $ 1&extra=page=$3&page=$2
RewriteRule ^space-(username|uid)-(.+).html$ space.php?$1=$2
RewriteRule ^tag-(.+).html$ tag.php?name=$1

[NC]:no case of abbreviations。Means ignore case,a-z and A-Z is no difference。
[NC,OR]:OR=AND。It meant to be followed under a grammatical sentence。
[R = 301, L]:R=301:redirect Abbreviation。It means using the 301 permanent steering (when the URL in the list above,Automatically redirected to the URL you specify);L:Last Abbreviation,Meaning that the last sentence。

Comments

Linux uses parted partitioning tool at greater than 2T hard disk partition

purpose:In centos 5.4 system,Parted with the partition function 12T hard drive and formatted into ext4,12T divided into two partitions,A 7.5T,Another 4.5T.
In linux large disk partitions can not use the fdisk,2T only support MBR partition table disk,So more than 2T disk must use the GPT partition table。The following describes specific steps:
1.It is divided into two primary partitions

 

[root@localhost ~]# parted /dev/sdb # Using parted to GPT disks operation,Enter the interactive mode
GNU Parted 1.8.1 Using /dev/sdb Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) mklabel gpt # The MBR disk to GPT format
(parted) print # print the current partition
(parted) mkpart primary 0 4.5TB # Points a 4.5T primary partition
(parted) mkpart primary 4.5TB 12TB # Points a 7.5T primary partition
(parted) print # print the current partition
(parted) quit 退出
Information: Don’t forget to update /etc/fstab, if necessary.

 

2.Then formatted into ext4,You need to install the package e4fsprogs.x86_64(yum install e4fsprogs.x86_64)To

[root@localhost ~]# mkfs.ext4 /dev/sdb1
[root@localhost ~]# mkfs.ext4 /dev/sdb2

 

3.Then mount the partition with the mount

[root@localhost]# mount -t ext4 /dev/sdb1 /bk
[root@localhost]# mount -t ext4 /dev/sdb2 /mail
[root@localhost ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev / sda6 ext3 39G 9.4G 28G 26% /
/dev/sda1 ext3 122M 13M 103M 12% /boot
none tmpfs 1004M 0 1004M 0% /dev/shm
/dev/sdb1 ext4 4.1T 194M 3.9T 1% /bk
/dev / sdb2 ext4 6.8T 179M 6.4T 1% /mail

 

4.Last modified / etc / fstab,Add the following two lines,Let it boot automatically mount.

/dev/sdb1 /bk ext4 defaults,noatime 1 2
/dev/sdb2 /mail ext4 defaults,noatime 1 2

 

Comments

whm / cpanel disable sslv3

登陆WHM » Service Configuration » Apache Configuration » Include Editor » Pre Main Include

 

 

Code:
SSLProtocol All -SSLv2 -SSLv3
SSLCipherSuite EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH +
SSLHonorCipherOrder on

This will work with Apache and also LiteSpeed, if you have this installed on your server.

 

testhttp://foundeo.com/products/iis-weak-ssl-ciphers/test.cfm

 

 

or

Home » Service Configuration » Apache Configuration » Include Editor » Pre Main Include (pre_main_global.conf)

Enter:
SSLProtocol ALL -SSLv2 -SSLv3

Save and restart Apache to complete.

Comments

SSLv3 broke again Vulnerability

SSLv3 Vulnerability broke again,Google's new draft TLS_FALLBACK_SCSV Under yet unclear circumstances,SSLv3 is currently disabled Does not consider IE6 The workaround。

1
2
3
4
5
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHERSAAES256SHA384:AES256SHA256:RC4:HIGH:!MD5:!Anull:!eNULL:!NULL:!DH:!EDH:!AESGCM;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;

 

sslv3 testhttp://foundeo.com/products/iis-weak-ssl-ciphers/test.cfm

Comments

linux under the shell displays -bash-4.1 # does not display the path Solution

It does not show in the path in linux shell,Appears as -bash-4.1 # inconvenient to use them。

How to show the path of the shell it?

Proceed as follows:

vim ~/.bash_profile

(Do not bother .bash_profile This file has several,Their new one is also possible)

Add the final
export PS1='[\u@h W]\$’

And then do
source ~/.bash_profile

So you can show the path of the shell。

Comments

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »