Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common commands in hashlinux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces what hashlinux commands are commonly used, the article is very detailed, has a certain reference value, interested friends must read it!

-

1 document management

-

Create a blank file

Touch

Do not prompt to delete a non-empty directory

Rm-rf directory name

(- r: recursively delete-f force)

# #

Restore rm deleted files (ext3)

View disk partition format

Df-T

Unmount

Umount / data/

Ext3grep / dev/sdb1-ls-inode 2

Record information continue to find inode information of files in the directory

Ext3grep / dev/sdb1-- ls-- inode 131081 # this is inode

Record the inode information and start the recovery directory

Ext3grep / dev/sdb1-restore-inode 49153

# #

Windows text to linux text

Dos2unix

Linux text to windows text

Unix2dos

Transcoding

Iconv-f gbk-tutf8 original .txt > new .txt

View md5 valu

Md5sum

Hard link

Ln

Symbolic connection

Ln-s

View the page up and down and display the line number

Cat? | nl | less

Q exit

End statu

Ctrl+z

View the beginning of the file

Head

View the end of the file

Tail-f # monitoring log files

Check the file type

File

Rename

Rename

Rename source_pattern target_pattern source_files

Change default permissions

Umask

Sort by number

Sort-n

Flashback by number

Sort-nr

Filter duplicate rows

Sort-u

Delete duplicate lines

Uniq

Number of repeated row occurrences

Uniq-c

Show only lines that do not repeat

Uniq-u

Merge two files and separate them with tab key

Paste a b

Merge two files and separate the specified'+ 'symbol.

Paste-dudes'a b

Merge multiple rows of data into one row and separate them with the tab key

Paste-s a

Set hidden properties

Chattr [+-=] [ASacdistu] file or directory

Downward splitter

More

Search

Locate string

View number of rows

Wc-l

View the newly changed files in a directory in real time

Watch-dmurn 1 'df; ls-FlAt / path'

Quickly back up a file

Cp filename {, .bak}

# #

Configuration Editor

Gconf-editor

Vi profile

Vi / etc/vimrc

Edit a file

Vim

Open the line number

: set nu

Cancel the line number

: set nonu

Jump to 200

200G

Unhighlight

: nohl

Set automatic indentation

: set autoindent

View text formatting

Set ff

Change to unix format

Set binary

Turn the page forward

Ctrl+ U

Turn the page backwards

Ctrl+ D

Replace all

G / character 1/s// character 2Universe g

% s / character 1 / character 2Unig

# ordinary users cannot save documents when they open them

# tee is a gadget that saves stdin to a file, and%, which is the name of a read-only register in vim, is always saved when

Edit the file path of the file before

W! sudotee%

# #

Find by file name

Find / etc-name http

Find a certain type of file

Find. -type f

Find by file permissions

Find /-perm

Search according to the file owner

Find /-user

Find the file by the group to which the file belongs

Find /-group

The use time of the file is within N days

Find /-atime-n

The file usage time is N days ago.

Find /-atime + n

The change time of the file content is less than N days.

Find /-mtime-n

The file content was changed N days ago.

Find /-mtime + n

The file status was changed N days ago.

Find /-ctime + n

File status change time within N days

Find /-ctime-n

# linux file has no creation time

# Access usage time

# Modify content modification time

# Change status change time (permission, owner)

Find files with a file length greater than 1m bytes

Find /-size + 1000000c-print

Find the file by name and pass the command to-exec

Find / etc-name "passwd*"-exec grep "hashlinux" {}\

Find the file name, not the path

Find. -name'tasking'- exec basename {}\

# #

=

-

2 Software management

-

Unpack tar

Tar xvf 1.tar-C directory

Package tar

Tar-cvf 1.tar *

View tar

Tar tvf 1.tar

Append files to tar

Tar-rvf 1.tar file name

Unpack gz

Tar zxvpf gz.tar.gz

Package gz

Tar zcvpf gz.tar.gz

View gz

Tar ztvpf gz.tar.gz

Decompress bzip2

Bzip2-dv 1.tar.bz2

Extract gzip to tar

Gzip-dv 1.tar.gz

Compress tar to gz

Gzip-v 1.tar

Bzip2 compression

Bzip2-v 1.tar

View bzip2

Bzcat

Rpm installation

Rpm-ivh

Unloading

Rpm-e lynx

Forced unloading

Rpm-e lynx-- nodeps

test

Rpm-test lynx

View all installed rpm packages

Rpm-qa

Find out if the package is installed

Rpm-qa | grep http

Decompress zip

Unzip zip.zip

Compressed zip

Zip zip.zip *

Rar3.6 download address

Https://cache.yisu.com/upload/information/20200310/34/104726.jpg

Extract the rar package

Unrar x rar.rar

7z compression

7z a 7z.7z *

7z decompression

7z e 7z.7z

View character lines

Zgrep character 1.gz

Package / home, / etc, but exclude / home/dmtsai

Tar-- exclude / home/dmtsai-zcvf myfile.tar.gz / home} # remove the first / and the string to its left: dir1/dir2/dir3/my.file.txt

${file##*/} # remove the last / and the string to its left: my.file.txt

${file#*.} # remove the first one. And the string to the left: file.txt

${file##*.} # remove the last one. And the string to the left: txt

${file%/p} "

Delete the line that contains the key

Sed-I "/ ^ $fplink d" a

Replace the text directly

Sed-I "sCompact racer /" c

Find the beginning of pearls and add jcui at the end of the line

Sed-I "/ ^ pearls/s/$/jcui/" ab.txt

Tag (save\ (mar\) as label 1)

Sed-n's /\ (mar\) got/\ 1iannemp p' file

Echo "margot" | sed-n's /\ (mar\). *\ (t\) /\ 1\ 2binp'

Sed-e's / ^\ ([a-zA-Z]\ +\)\ ([a-zA-Z]\ +\)\ (.*\) /\ 2\ 1\ 3Greg'file

Add 5 after the line ending in [0-9] [0-9]

Sed's / [0-9] [0-9] $/ & 5' file

Print all lines from line 5 to the line starting with no

Sed-n '5authoring / ^ no/p' file

Modify all lines between west and east, adding * VACA* at the end

Sed'/ west/,/east/s/$' file

Multiple edits (delete 1-3 lines first, replace 1 with 2)

Sed-e '1jue 3d'-eworlsUniverse'Universe 'file'

Find the line with suan and add the contents of the read file at the end

Sed'/ suan/r read file 'file

Find the line with no and write it to the specified file

Sed-n'/ no/w writes to the file 'file

Take out the first set of numbers and ignore the first zero

Sed's / [^ 1-9] *\ ([0-9]\ +\). * /\ 1Compact'

Print lines between 1 and 3

Sed'/ 1 Charpy 3gamma p' file

Take out the specified line

Sed-n '1p' file

Insert a row before line 5

Sed'5i\ aaa'file

Draw the line after line 5

Sed'5a\ aaa' file

Insert a row before the matching row

Echo a | sed-e'/ sed I\ b'

Insert a row after the matching row

Echo a | sed-e'/ gamma a\ b'

Echo a | sed's Universe &\ nb/g'

Reference external variables

Sed-n''$astatine 10p'

Sed-n "" $a ", 10p"

Take the user's home directory (match characters that are not / and match: delete all characters to the end)

Sed-n'{s / ^ [^\ /] * / /; s /\:. * / /; p}'/ etc/passwd

Convert newline characters to newline

Echo abcd\\ nabcde | sed's /\\ nUniverse Universe G' | tr'@'\ n'

Delete all characters and blank lines after @

Sed-e's Compact. Hammer Compact G'-e'/ ^ $/ d'

Merge several lines into one line

Echo $(cat file) | sed's / g'

Take a column of maximum values

Cat tmp | awk'{print $1}'| sort-n | sed-n'$p'

Find documents whose sovereignty is limited to 7

Ls-l | sed-n'/ ^ .rwx. * / p'

Precede a with a number

Echo a | sed-e's Universe

# #

Graphic dialog

Multi-selection interface [square brackets]

Dialog-- title "Check me"-- checklist "Pick Numbers" 15 25 3 1 "one", off "2" two "on" 3 "three"

"off" 2 > tmp

Multi-selection interface (parentheses)

Dialog-title "title"-radiolist "checklist" 20 60 14 tag1 "item1" on tag2 "item2" off 2 > tmp

Radio interface

Dialog-title "title"-menu "MENU" 20 60 14 tag1 "item1" tag2 "item2" 2 > tmp

Progress bar

Dialog-title "Installation"-backtitle "Star Linux"-gauge "Linux Kernel" 10 60 50

Select yes/no

Dialog-- title "title"-- backtitle "Dialog"-- yesno "description" 2060

Announcement

Dialog-- title "announcement title"-- backtitle "Dialog"-- msgbox "content" 20 60

Leave as soon as the message is displayed

Dialog-title "hey"-backtitle "Dialog"-infobox "Is everything okay?" 10 60

Input dialog box

Dialog-title "hey"-backtitle "Dialog"-inputbox "Is okay?" 10 60 "yes"

Show document content

Dialog-title "Array 30"-backtitle "All"-textbox / root/txt 20 75

Multiple input dialog boxes

Dialog-- title "Add a user"-- form "Add a user" 1240 4 "Username:" 1 1 "" 1 15 15 0 "Full

Name: "2 1"2 15 15 0 2 > tmp

Asterisk display input-insecure

Dialog-- title "Password"-- insecure-- passwordbox "Please enter the password" 10 35

Select date

Dialog-- stdout-- title "Calendar"-- calendar "Please select" 0 0 9 1 2010

# #

Script header # sh is the default shell of the current system, and can be specified as bash, etc.

#! / bin/sh

Temporary file definition

Errtmp=/tmp/$$ `date +% s% N`.errtmp

Outtmp=/tmp/$$ `date +% s% N`.outtmp

True > $outtmp

Random number

$RANDOM

Process number

$

Nanosecond

Date +% N

Read and execute commands in FileName in the current bash environment

Sourcefile-name # is equivalent. FileName

Sleep at intervals of 5 seconds

Sleep 5

The action to be taken after receiving the signal

Trap

Current directory

$PWD

The path to the previous directory

$OLDPWD

Return to the previous directory path

Cd-

Repeat printing

Yes

Automatically answer y or other

Yes | rm-i*

View all folders in the directory

Ls-p/home

View the matching full path

Ls-d/home/

Command to replace xargs

# take the previous content as the parameter of the later command

Find /-perm + 7000 | xargs ls-l

Execute the next sentence without line wrapping.

Echo-n aa;echo bb

To give effect to an escape

Echo-e "s\ tss\ n\ n"

Fetch characters in a string

Echo $a | cut-c2-6

Arrangement and combination (one element in parentheses is combined with other elements in parentheses)

Echo {a,b,c} {a,b,c} {a,b,c}

Returns the directory name

Pwd | awk-F /'{print "directory name:", $2}'

Replace (foo) a phrase (bar) in the previous command

^ Foo ^ bar^

!!: s/foo/bar/

!!: gs/foo/bar

# #

Shell example

Determine whether the parameter is empty-empty exit and print null

#! / bin/sh

Echo $1

Name=$ {1? "null"}

Echo $name

# #

Cyclic array

For ((iTuno temp.txt)

Sed-I "sswab / = /" temp.txt

W = `awk-F "='{print $1} 'temp.txt`

For d in $w

Do

Grep-w $d svnpassword > / dev/null

If [$?-eq 0]

Then

Sed-I "/ ^ $dbank d" svnpassword

Grep "^ $d" temp.txt > > svnpassword

# there is a problem when it is replaced to escape

# sed-I "/ ^ $dmax c $(grep" ^ $d "temp.txt)" svnpassword

Fi

Done

Rm temp.txt

# #

Multi-line merge

Merge two lines into one line (remove line breaks)

Sed'{Ninterns` /\ nAccord /} 'file

Merge 4 lines into one line (expandable)

Awk'{if (NR%4==0) {print $0} else {printf "s", $0}} 'file

Merge all rows

Awk'{printf's', $0}'

# #

Shift usage

. / cs.sh 1 2 3

#! / bin/sh

Until [$#-eq 0]

Do

Echo "the first parameter is: $1. The number of parameters is: $#"

# the value of the variable $1 before shift command execution is not available after shift command execution

Shift

Done

# #

Add a parameter getopts to the script

#! / bin/sh

While getopts: ab: name

Do

Case $name in

A) aflag=1

B) bflag=1

Bval=$OPTARG

\?) Echo "USAGE: `basename $0` [- a] [- b value]"

Exit 1

Esac

Done

If [!-z $aflag]; then

Echo "option-a specified"

Echo "$aflag"

Echo "$OPTIND"

Fi

If [!-z $bflag]; then

Echo "option-b specified"

Echo "$bflag"

Echo "$bval"

Echo "$OPTIND"

Fi

Echo "here $OPTIND"

Shift $(($OPTIND-1))

Echo "$OPTIND"

Echo "`shift $(($OPTIND-1)) `"

# #

Determine whether the script parameters are correct

. / test.sh-p123-P 3306-h 127.0.0.1-u root

#! / bin/sh

If [$#-ne 8]; then

Echo "USAGE: $0-u user-p passwd-P port-h host"

Exit 1

Fi

While getopts: u:p:P:h: name

Do

Case $name in

u)

Mysql_user=$OPTARG

p)

Mysql_passwd=$OPTARG

p)

Mysql_port=$OPTARG

h)

Mysql_host=$OPTARG

*)

Echo "USAGE: $0-u user-p passwd-P port-h host"

Exit 1

Esac

Done

If [- z $mysql_user] | | [- z $mysql_passwd] | | [- z $mysql_port] | | [- z $mysql_host]

Then

Echo "USAGE: $0-u user-p passwd-P port-h host"

Exit 1

Fi

Echo $mysql_user $mysql_passwd $mysql_port $mysql_host

# result root123 3306127.0.0.1

# #

Dialog takes a value to exit

Outtmp=/tmp/outtmp

Dialog-- no-shadow-- backtitle "hashlinux production"-- title "Please select"-- ok-label "submit"-- cancel-label "cancel"

-- menu "Please select" 10600\

1 "[directory]"\

Q "[exit]"\

2 > $outtmp

# determine the cancellation of submission

If [$? = "1"]

Then

Break

# continue

Fi

# only judge exit

Pt= `awk'{print}'$outtmp`

If [$pt = = Q]

Then

Break

Fi

# judging operation

Case $pt in

1)

# Operation

q)

Exit # break

Esac

# #

Dialog input dialog box plus judgment

While:

Do

Outtmp=/tmp/outtmp

Dialog-- title "hashlinux production"-- form "Please enter" 20 60 10 "user:" 1 2 "" 1 15 350 "ID:" 2 2 "" 2

The input format of "15 350"6 2"6 000" is as follows: "7 2"7 000" indicates "8 2"8 000"

0 2 > $outtmp

Yh= `sed-n '1p' $outtmp`

Id= `sed-n '2p' $outtmp`

Ifecho $yh | grep-e'^ [1-9] [0-9]\ {0jue 2\}'> / dev/null 2 > & 1

Then

If echo $id | grep-e'^ [1-9] [0-9]\ {0Magne 12\}'> / dev/null 2 > & 1

Then

Break

Else

Echo "what you entered is illegal, please re-enter it!"

Fi

Else

Echo "what you entered is illegal, please re-enter it!"

Fi

Done

# #

Print a form

#! / bin/sh

Clear

Awk 'BEGIN {

Print "+-+-+"

Printf "|%-20s |%-20s |\ n", "Name", "Number"

Print "+-+-+"

}'

A = `grep "^ [Amurz]" a.txt | sort + 1-n | awk'{print $1 ":" $2}'`

# cat a.txt | sort + 1-n | while read list

For list in $a

Do

Name= `echo $list | awk-F:'{print $1}'`

Number= `echo $list | awk-F:'{print $2}'`

Awk 'BEGIN {printf "|%-20s |%-20s |\ n", "" $name "", "$number"

Print "+-+-+"

}'

Done

Awk 'BEGIN {

Print "* * The End * *"

Print ""

}'

# #

Judge whether the date is legal or not

#! / bin/sh

While read a

Do

If echo$a | grep-Q "-" & & date-d $a +% Y%m%d > / dev/null 2 > & 1

Then

If echo $a | grep-e'^ [0-9]\ {4\}-[01] [0-9]-[0-3] [0-9] $'

Then

Break

Else

Echo "the date you entered is invalid, please enter it again!"

Fi

Else

Echo "the date you entered is invalid, please enter it again!"

Fi

Done

Echo "date is $a"

# #

Print date segment all dates

#! / bin/bash

Qsrq=20010101

Jsrq=20010227

Nasty 0

> tmp

While:; do

Current=$ (date +% Y%m%d-d "$n day $qsrq")

If [[$current = = $jsrq]]; then

Echo $current > > tmp;break

Else

Echo $current > > tmp

((nasty +))

Fi

Done

Rq= `awk 'NR==1 {print}' tmp`

# #

Print Tip

Cat > / etc/vsftpd/vsftpd_zhandian/hashlinux

(12)

Mkdir / var/ZhanDian/hashlinux

(13)

Chown-R XuNiRuKou:XuNiRuKou / var/ZhanDian/

(14) restart the service

/ etc/init.d/vsftpd restart

(15) client virtual account test

Create a user script. It is best to add to determine whether the user name exists.

#! / bin/sh

Echo, please enter a user name

Read y

Echo $y > > zhanghu.dat

Echo, please enter your password.

Read m

Echo $m > > zhanghu.dat

Db_load-T-t hash-fzhanghu.dat / etc/vsftpd/vsftpd_zhanghu.db

Chmod 600 / etc/vsftpd/vsftpd_zhanghu.db

Touch / etc/vsftpd/vsftpd_zhandian/$y

Echo "local_root=/var/ZhanDian/$y" > > / etc/vsftpd/vsftpd_zhandian/$y

Mkdir / var/ZhanDian/$y

Chown-R XuNiRuKou:XuNiRuKou / var/ZhanDian/$y

/ etc/init.d/vsftpd restart

# #

Httpd installation

Tar zxvf httpd-2.2.12.tar.gz

Cd httpd-2.2.12

. / configure-- prefix=/usr/local/httpd\

-- enable-rewrite

Make & & make install

Ls / usr/local/

Groupadd www

Useradd-g www-M-s / sbin/nologin www

Cd / usr/local/httpd/

Vi conf/httpd.conf

The server is enabled in the bin of the software installation directory

. / apachectl start

The web page is placed in the htdocs

Boot up

Vi / etc/rc.d/rc.local

/ usr/local/httpd/bin/apachectl start

If you start the prompt

Httpd: Could not reliably determine the server fully qualified domain name, using 127.0.0.1 for

ServerName

Modify / etc/hosts computer name

Open in httpd.conf

ServerName 127.0.0.1:80

Encoding settin

AddDefaultCharset UTF-8

AddDefaultCharset GB2312

# #

Mysql source code installation

Groupadd mysql

Useradd mysql-g mysql-M-s / bin/false

Tar zxvf mysql-5.0.22.tar.gz

Cd mysql-5.0.22

. / configure-- prefix=/usr/local/mysql\

-- with-client-ldflags=-all-static\

-- with-mysqld-ldflags=-all-static\

-- with-mysqld-user=mysql\

-- with-extra-charsets=all\

-- with-unix-socket-path=/var/tmp/mysql.sock

Make & & make install

Generate mysql user database and table files and enter them in the installation package.

Scripts/mysql_install_db-user=mysql

Vi / .bashrc

Export PATH= "$PATH: / usr/local/mysql/bin"

Configuration file, there are three large,medium,small, selected according to machine performance

Cp support-files/my-medium.cnf / etc/my.cnf

Cp support-files/mysql.server / etc/init.d/mysqld

Chmod 700 / etc/init.d/mysqld

Cd / usr/local

Chmod 750mysql-R

Chgrp mysql mysql-R

Chown mysql mysql/var-R

Cp / usr/local/mysql/libexec/mysqld mysqld.old

Ln-s/usr/local/mysql/bin/mysql / sbin/mysql

Ln-s/usr/local/mysql/bin/mysqladmin / sbin/mysqladmin

Ln-s murf / usr/local/mysql/bin/mysqld_safe / etc/rc.d/rc3.d/S15mysql5

Ln-s murf / usr/local/mysql/bin/mysqld_safe / etc/rc.d/rc0.d/K15mysql5

# #

Mysql rpm installation

Download mysql RPM (service and client) from http://www.mysql.com/downloads/mysql

MySQL-server-community-5.1.51-1.rhel5.i386.rpm installation server

MySQL-client-community-5.1.51-1.rhel5.i386.rpm installation client

MySQL-devel-community-5.1.51-1.rhel5.i386.rpm for mysql installation of php

Rpm-ivh MySQL-server-community-5.1.51-1.rhel5.i386.rpm

Rpm-ivh MySQL-client-community-5.1.51-1.rhel5.i386.rpm

Rpm-ivh MySQL-devel-community-5.1.51-1.rhel5.i386.rpm

/ etc/init.d/mysqld start

Mysqladmin-u root password 'hashlinux'

Mysql-u root-S / var/lib/mysql/mysql.sock-p

Data directory / var/lib/mysql

Chkconfig-- list | grep mysqld

Chkconfig-level 3 mysqld on

Configuration file (log\ pid)

/ etc/my.cnf

Ll / usr/bin/mysql*

# #

Mysql common commands

Start the mysql service

. / mysql/bin/mysqld_safe-- user=mysql &

Command to log in to mysql

Format: mysql-h host address-u user name-p user password

Mysql-h210.110.110.110-P3306-uroot-p

Mysql-uroot-p-S / data1/mysql5/data/mysql.sock-A-- default-character-set=GBK

Refresh

Flush privileges

Show all databases

Show databases

Open the database

Use dbname

Show all tables in the selected database

Show tables

View table structure

Desc tables

Delete database

Drop database name

Delete tabl

Drop table name

Create a database

Create database name

Mysqladmin-h myhost-u root-p create dbname

Create a tabl

Create table ka (ka_idvarchar (6), qianshu int)

Insert field

Alter table name add column accountid (column name) int (11) NOT NULL (field is not empty)

Do not log in to mysql insert field

Mysql-uroot-p-S mysql.sock-e "use db;alter table gift add column accountid int (11) NOT

NULL;flush privileges; "

Query

Select column name from table name

Select host,user,password from user

Backup database

Mysqldump-h host-u root-pdbname > dbname_backup.sql

Mysqlhotcopy can only back up the MyISAM engine

/ bin/mysqlhotcopy-u root-p

Restore database

Mysql-h host-u root-pdbname

< dbname_backup.sql 登陆 mysql 后还原 sql 文件 source 路径.sql 赋予查询权限(没有用户,直接创建) grant select on db.* to log@"%" Identified by "123456"; 赋予所有权限(没有用户,直接创建) grant all privileges on db.* to log@"IP" identified by '123456' withgrant option; 更改密码 update user set password=password('新密码') where user='root' mysqladmin -u root password 'hashlinux' mysql 查看所有用户的语句 select user(); 删除用户 delete from user where user='sss' andhost='localhost' ; 查看主从 show slave status\G; 查看主从复制进程 show processlist; 添加索引 解决停 mysql 速度慢 ALTER TABLE playerADD INDEX weekcredit_faction_index (weekcredit, faction); 创建主从复制用户 grant replication slave on *.* to '用户'@'%' identifiedby '密码'; 备份表 mysqldump -u root -p -S mysql.sock --default-character-set=utf8 --hex-blob db table1 table1 >

/ data/db.sql

View the settings for the character set and sorting method of the system

SHOW VARIABLES LIKE 'character_set_%'

View all parameters of mysql

Show variables

Delete empty user

Delete from user where user=''

Create a table to specify the type of storage engine:

CREATE TABLE innodb (id int, titlechar (20)) ENGINE = INNODB

CREATE TABLE myisam (id int, title char (20)) ENGINE = MyISAM

Change the storage engine used by the existing table:

ALTER TABLE mytable ENGINE = MyISAM

Query table engine

SHOW TABLE STATUS from database name where Name=' table name'

SHOW TABLE STATUS from db where Name='innodb'

View mysql variabl

SHOW VARIABLES

Query user permissions

Select host,user,password from user

View the engine status of the table

Show table status

# #

Gd installation

Install components libxml, zlib, freetype, libpng, jpegsrc, gd respectively

Libxml2-2.6.24.tar.bz2

Zlib-1.2.3.tar.gz

Freetype-2.2.1.tar.gz

Libpng-1.2.10.tar.gz

Jpegsrc.v6b.tar.gz

Gd-2.0.33.tar.gz

Libxml installation

Tar xzvf libxml2-2.6.24.tar.bz2

Tar xvf libxml2-2.6.24.tar

Cd libxml2-2.6.24

. / configure

Make

Make install

Zlib installation

Tar xzvf zlib-1.2.3.tar.gz

Cd zlib-1.2.3

. / configure

Make

Make install

Freetype installation

Tar xzvf freetype-2.2.1.tar.gz

Cd freetype-2.2.1

. / configure-- prefix=/usr/local/php/modules/freetype

Make

Make install

Libpng installation

Tar xzvf libpng-1.2.10.tar.gz

Cd libpng-1.2.10

. / configure-- prefix=/usr/local/php/modules/libpng

Jpeg installation

Mkdir / usr/local/php/modules/jpeg6

Mkdir / usr/local/php/modules/jpeg6/bin

Mkdir / usr/local/php/modules/jpeg6/lib

Mkdir / usr/local/php/modules/jpeg6/include

Mkdir / usr/local/php/modules/jpeg6/man

Mkdir / usr/local/php/modules/jpeg6/man/man1

Create in one sentence

Mkdir-pv / usr/local/jpeg/ {, bin,lib,include,man/man1,man1}

Tar zxvf jpegsrc.v6b.tar.gz

Cd jpeg-6b/

. / configure-- prefix=/usr/local/php/modules/jpeg6\

-- enable-shared\

-- enable-static

Make

Make install

Gd installation

Tar zxvf gd-2.0.33.tar.gz

Cd gd-2.0.33

. / configure-- prefix=/usr/local/gd2\

-- with-jpeg=/usr/local/php/modules/jpeg6\

-- with-png=/usr/local/php/modules/libpng\

-- with-zlib\

-- with-freetype=/usr/local/php/modules/freetype

Modify line 231 of the Makefile file, and change the duplicate second freetype to libpng

Make

Make install

Php installation

Tar xvf php-5.1.6.tar

Cd php-5.1.bz2.6

. / configure-- prefix=/usr/local/php\

-- sysconfdir=/etc\

-- with-apxs2=/usr/local/httpd/bin/apxs\

-- with-config-file-path=/usr/local/php/lib\

-- with-libxml-dir=/usr/local/libxml2\

-- with-zlib\

-- with-jpeg-dir=/usr/local/php/modules/jpeg6\

-- with-freetype-dir=/usr/local/php/modules/freetype\

-- with-gd=/usr/local/gd2\

-- with-openssl\

-- with-regex=php\

-- with-gnu-ld\

-- with-tsrm-pthreads\

-- with-bz2\

-- with-gettext\

-- with-db4=/usr\

-- enable-ftp\

-- enable-bcmath\

-- enable-dba\

-- enable-sockets\

-- enable-soap\

-- enable-zend-multibyte\

-- enable-mbstring\

-- with-curlwrappers\

-- with-curl=/usr/local/curl\

-- with-pdo-mysql=/usr/local/mysql\

-- with-mysql=/usr/local/mysql\

-- with-mysqli=/usr/local/mysql/bin/mysql_config

Make

Make install

Cp php.ini-recommended / usr/local/php/lib/php.ini

Vi / usr/local/php/lib/php.ini

Add in PHP.IN

[eaccelerator]

Extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so

Eaccelerator.shm_size= "32"

Eaccelerator.cache_dir= "/ usr/local/cache/eaccelerator"

Eaccelerator.enable= "1"

Eaccelerator.optimizer= "1"

Eaccelerator.check_mtime= "1"

Eaccelerator.debug= "0"

Eaccelerator.filter= ""

Eaccelerator.shm_max= "0"

Eaccelerator.shm_ttl= "0"

Eaccelerator.shm_prune_period= "0"

Eaccelerator.shm_only= "0"

Eaccelerator.compress= "1"

Eaccelerator.compress_level= "9"

When you are finished, add the following line to the / usr/local/httpd/conf/httpd.conf file:

AddType application/x-httpd-php .php .php5

Ln-s/usr/local/php/bin/php / sbin/php

Vi index.php

The above is all the contents of this article "what are the Common hashlinux commands?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report