分类 服务器技术 下的文章

之前单位用的kangle服务器,便于快速搭建网站。

但是现在不想用了,如何删除呢?

其实很简单:

停止服务

service kangle stop

删除服务启动项

chkconfig kangle off

删除服务

chkconfig --del kangle

删除残留文件

rm -rf  /vhs
rm -f /etc/init.d/kangle

现在重启看看,是不是已经删除的很干净了!

##ps.这个删除流程也可以针对其他服务使用!##

顺便提一下

删除Apache可以用rpm -qa|grep apache|xargs rpm -e,一次删除所有与Apache有关的包

准备

PHP的安装最头疼的就是因为某些类库没有安装而报错,所以编译前请确保以下包已安装

yum groupinstall "development tools"

yum install -y gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses curl curl-devel openssl-devel gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel readline-devel libxslt-devel expat-devel xmlrpc-c xmlrpc-c-devel

编译

高大上的编译选项

./configure  \
--prefix=/usr/local/php  \
--enable-fpm  \
--with-curl  \
--with-openssl  \
--enable-mbregex  \
--with-mysql  \
--with-mysqli  \
--with-mysql-sock  \
--enable-pdo  \
--with-pdo-mysql  \
--with-pdo-pgsql  \
--with-pdo-sqlite  \
--enable-mysqlnd  \
--with-gd  \
--enable-gd-native-ttf  \
--enable-exif  \
--with-jpeg-dir=/usr/local/jpeg  \
--with-png-dir=/usr/local/png  \
--with-freetype-dir=/usr/local/freetype  \
--enable-gd-jis-conv  \
--with-gettext  \
--with-zlib  \
--enable-zip  \
--with-bz2  \
--disable-fileinfo  \
--enable-xmlreader  \
--enable-xmlwriter  \
--with-xmlrpc  \
--enable-mbstring  \
--enable-inline-optimization \

20150524更新 5.6.9编译配置选项,推荐使用

./configure --prefix=/usr/local/php --with-pdo-pgsql --with-pdo-sqlite --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-xmlreader --enable-xmlwriter --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-gd --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-pdo-mysql --with-mysqli --with-mysql-sock --enable-mysqlnd --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl --enable-ftp --with-imap=/usr/local/php-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --disable-fileinfo

编译中出了问题请参考

彻底解决编译PHP找不到libc-client.a的问题

PHP编译错误的解决办法

如果内存小于1G,需要加上--disable-fileinfo

找到二进制文件

添加环境变量

whereis php
#/usr/local/bin/php
echo $PATH
#/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
export PATH=/usr/local/php/bin:$PATH
echo $PATH
#/usr/local/php/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
php -v
#PHP 5.6.0 (cli) (built: Sep 10 2014 23:54:43)

编辑profile

ps./etc/profile:在登录时,操作系统定制用户环境时使用的第一个文件,此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行

pss./etc/environment:在登录时操作系统使用的第二个文件,系统在读取你自己的profile前,设置环境文件的环境变量。

pss.~/.bash_profile:在登录时用到的第三个文件是.profile文件,每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该 文件仅仅执行一次!默认情况下,他设置一些环境变游戏量,执行用户的.bashrc文件。/etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取.

pss.~/.bashrc:该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该该文件被读取。

vim /etc/profile

在最后一行加上:export PATH="/usr/local/php/bin:$PATH"

最后:

source /etc/profile

或者直接把php拷贝至/usr/local/bin/

cp /usr/local/php/bin/php /usr/local/bin/

配置文件

cp /tmp/php-5.6.0/php.ini-production /usr/local/php/etc/php.ini

启动php-fpm

/usr/local/php/sbin/php-fpm

运行时指定配置文件

/usr/local/php/sbin/php-fpm -c /usr/local/php/etc/php.ini -y /usr/local/php/etc/php-fpm.conf

开机自启动

echo "/usr/local/php/sbin/php-fpm -c /usr/local/php/etc/php.ini -y /usr/local/php/etc/php-fpm.conf" >> /etc/rc.local

或者

vim /etc/rc.local

# ADD
/usr/local/php/sbin/php-fpm -c /usr/local/php/etc/php.ini -y /usr/local/php/etc/php-fpm.conf

配置php-fpm

配置文件路径/usr/local/php/etc/php-fpm.conf

扩展阅读

PHP安装配置Opcache加速你的网站

PHP安装memcached扩展

PHP之负载均衡下的session共用(Memcache实现)

中文总是能引出很多麻烦,所以推荐安装系统的时候不要选择任何与中文有关的选项。

但是如果很不幸你选了中文作为系统语言,还是有补救的办法的。

很简单,请看下面的代码:

编辑i18n:

vi /etc/sysconfig/i18n

LANG="zh_CN.UTF-8"改为LANG="en_US.UTF-8"即可!

今天给老娘的Mi2S刷机,研究了一下在mac上刷机的方法,在此记录一下。

PS.本方法适用于所有Android机器

Android File Transfer

安装Android File Transfer

brew cask install android-file-transfer

要在OSX上管理Android手机上的文件,需要下载安装这个官方工具http://www.android.com/filetransfer/

由于某些特殊原因网站打不开不要紧,不会翻墙的TX可以到我的网盘下载到目前最新的Android File Transfer。

下载安装完成后运行,就可以轻松管理手机文件了,这个时候把下载好的ROM拷贝到手机目录下,再进入recovery刷机了。

如何安装Android File Transfer

命令行刷机

安装adb工具

brew cask install android-platform-tools

接下来再terminal中运行adbfastboot即可开始刷机

adb版本

**小提示:**刷机用到的命令可以参考博主的这篇文章adb,fastboot常用命令及刷机技巧

部分参考来自:

http://www.technobuzz.net/install-adb-fastboot-mac-linux-chrome-os-nexus-tool-script/?utm_source=tuicool

有时候centos使用yum命令的时候软件下载速度会很慢,还好国内有很多镜像站供大家选择,在此博主为大家总结了一些centos国内镜像站,如果你需要下载centos的iso文件或者相关软件,可以到以下网站下载,速度相当快!

当然,如果你想直接替换掉centos系统内置的yum源地址,可以参考这篇文章Centos源设置,将你的源设为比较快的地址!

地区 HTTP
Alibaba Cloud Computing http://mirrors.aliyun.com/centos/
Beijing Institute of Technology http://mirror.bit.edu.cn/centos/
Beijing Teletron Telecom Engineering http://mirrors.btte.net/centos/
BitComm Ltd. http://mirrors.pubyun.com/centos/
CDS China http://mirrors.yun-idc.com/centos/
China University of Geosciences http://mirrors.cug.edu.cn/centos/
Dalian Neusoft University of Information http://mirrors.neusoft.edu.cn/centos/
Grand Cloud http://mirrors.grandcloud.cn/centos/
Huazhong University of Science and Technology http://mirrors.hust.edu.cn/centos/
NetEase http://mirrors.163.com/centos/
Northeastern University, Shenyang Liaoni http://mirror.neu.edu.cn/centos/
Qiming College of Huazhong University of Science and Technology http://mirrors.hustunique.com/centos/
Sohu Inc, Beijing P.R. China http://mirrors.sohu.com/centos/
The Linux open source community mirror http://mirrors.skyshe.cn/centos/
University of Science and Tech of China http://centos.ustc.edu.cn/centos/
Hong Kong Asia Web Services Ltd. http://mirror.vpshosting.com.hk/pub/linux/centos/
01LINK NETWORK SERVICES LIMITED http://centos.01link.hk/
CommuniLink Internet Limited http://centos.communilink.net/
i-System Technology Limited http://centos.uhost.hk/
SunnyVision Limited http://mirror.sunnyvision.com/centos/
The Chinese University of Hong Kong http://ftp.cuhk.edu.hk/pub/Linux/centos/
UDomain Web Hosting Company Ltd. http://repo.virtualhosting.hk/centos/

vim常用命令

VIM虽说不长用,然是还是很需要掌握的,VIM功能强大的没话说,就是命令太多不好记!

老高就来慢慢总结一下VIM的常用命令和技巧吧!


命令

选择,删除,复制,粘贴

快捷键 作用
v 从光标当前行开始,光标经过的行都会被选中,再按一下v结束
V 从光标当前行开始,光标经过的行都会被选中,再按一下V结束
Ctrl + v 从光标当前位置开始,选中光标起点和终点所构成的矩形区域,再按一下Ctrl + v结束。
gg``VG 选中全部的文本,其中gg为跳到行首,V选中整行,G末尾
y 复制 (默认是复制到"寄存器
p 粘贴 (默认从"寄存器取出内容粘贴)
"+y 复制到系统剪贴板(也就是vim的+寄存器)
删除 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
d 删除
x 删除字符
dd 删除一行
J 删除换行符,两行合并为一行
重做 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
u 撤销
CTRL + R 反转撤消
U 一次撤消对一行的全部操作 第二次使用该命令则会撤消前一个U的操作
追加 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
i 在当前光标之前插入文本。
a 在当前光标之后插入文本。
o 在当前行的下面另起一行,并使当前模式转为Insert模式。
O 将在当前行的上面另起一行。
使用命令计数 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
kkkkkkkkk9k 要向上移动9行
a!!! 行尾追加三个感叹号
3x 删除3个字符可以用
退出 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
ZZ 退出Vim
:q! 丢弃所有的修改并退出
:wq 丢弃所有的修改并退出
移动 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
w 将光标向前移动一个word的首字符上
3w 将光标向前移动3 words
b 将光标向后移动到前一个word的首字符上
e 将光标移动到下一个word的最后一个字符
ge 将光标移动到前一个word的最后一个字符上
$ 将光标移动到当前行行尾 = END key
^ 将光标移动到当前行的第一个非空白字符上
0(数字) 总是把光标移动到当前行的第一个字符上
1$ 将光标移动到当前行行尾
2$ 将光标移动到下一行的行尾
注意 ^0 不能接受命令计数

技巧

快速清空文件

gg
dG