两台Linux系统之间传输文件

scp是有Security的文件copy,基于ssh登录。操作起来比较方便,比如要把当前一个文件copy到远程另外一台主机上,可以如下命令。

scp /home/daisy/full.tar.gz root@172.19.2.75:/home/root

如果想反过来操作,把文件从远程主机copy到当前系统,也很简单。

实例1:从远处复制文件到本地目录

命令:

scp root@192.168.120.204:/opt/soft/nginx-0.5.38.tar.gz /opt/soft/

 

php5.6安装(apache2.4,mysql5.6已安装)

wget http://mirrors.sohu.com/php/php-5.6.9.tar.gz

tar zxf php-5.6.9.tar.gz

yum install libxml2

yum install libxml2-devel

yum install bzip2 bzip2-devel

yum install libcurl

yum install curl curl-devel

yum install libjpeg-devel

yum -y install libpng-devel

yum -y install freetype-devel

wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz

tar zxf libmcrypt-2.5.7.tar.gz

cd libmcrypt-2.5.7

./configure –prefix=/usr/local/libmcrypt

make && make install

wget http://soft.7dot.com/soft/mhash-0.9.9.9.tar.gz

tar zxf mhash-0.9.9.9.tar.gz

cd mhash-0.9.9.9

./configure –prefix=/usr/local/mhash

make && make install

wget https://sourceforge.net/projects/mcrypt/files/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz/download

tar zxf mcrypt-2.6.8.tar.gz

cd mcrypt-2.6.8

export LD_LIBRARY_PATH=/usr/local/libmcrypt/lib:/usr/local/mhash/lib

export LDFLAGS=”-L/usr/local/mhash/lib -I/usr/local/mhash/include/”

export CFLAGS=”-I/usr/local/mhash/include/”

./configure –prefix=/usr/local/mcrypt –with-libmcrypt-prefix=/usr/local/libmcrypt

make

make install

cd php-5.6.9

./configure –prefix=/usr/local/php –with-apxs2=/usr/local/httpd/bin/apxs –with-libxml-dir=/usr/include/libxml2 –with-config-file-path=/etc/php –with-mysql=/usr/local/mysql –with-mysqli=/usr/local/mysql/bin/mysql_config –with-gd –enable-gd-native-ttf –with-zlib –with-mcrypt=/usr/local/libmcrypt –with-pdo-mysql=/usr/local/mysql –enable-shmop –enable-soap –enable-sockets –enable-wddx –enable-zip –with-xmlrpc –enable-fpm –enable-mbstring –with-zlib-dir –with-bz2 –with-curl –enable-exif –enable-ftp –with-jpeg-dir=/usr/lib –with-png-dir=/usr/lib –with-freetype-dir=/usr/lib/

make && make install

php安装成功

接下来仿wampserver 的httpd.conf 加对php的支持

中国大陆开源镜像站汇总

1.企业贡献:

搜狐开源镜像站:http://mirrors.sohu.com/

网易开源镜像站:http://mirrors.163.com/

2.大学教学:

  北京理工大学:

http://mirror.bit.edu.cn (IPv4 only)

http://mirror.bit6.edu.cn (IPv6 only)

  北京交通大学:

http://mirror.bjtu.edu.cn (IPv4 only)

http://mirror6.bjtu.edu.cn (IPv6 only)

http://debian.bjtu.edu.cn (IPv4+IPv6)

兰州大学:http://mirror.lzu.edu.cn/

厦门大学:http://mirrors.xmu.edu.cn/

  上海交通大学:

http://ftp.sjtu.edu.cn/ (IPv4 only)

http://ftp6.sjtu.edu.cn (IPv6 only)

  清华大学:

http://mirrors.tuna.tsinghua.edu.cn/ (IPv4+IPv6)

http://mirrors.6.tuna.tsinghua.edu.cn/ (IPv6 only)

http://mirrors.4.tuna.tsinghua.edu.cn/ (IPv4 only)

天津大学:http://mirror.tju.edu.cn/

  中国科学技术大学:

http://mirrors.ustc.edu.cn/ (IPv4+IPv6)

http://mirrors4.ustc.edu.cn/

http://mirrors6.ustc.edu.cn/

西南大学:http://linux.swu.edu.cn/swudownload/Distributions/

  东北大学:

http://mirror.neu.edu.cn/ (IPv4 only)

http://mirror.neu6.edu.cn/ (IPv6 only)

电子科技大学:http://ubuntu.uestc.edu.cn/

青岛大学:http://mirror.qdu.edu.cn/

 

linux服务器,信息查看

1.查看操作系统版本

[root@bruce ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)

2.查看32位还是64位
[root@bruce ~]# uname -m
x86_64

3.查看apache版本
[root@bruce ~]# /usr/local/httpd/bin/apachectl -v
Server version: Apache/2.4.18 (Unix)
Server built:   Jan 28 2016 23:27:42

4.查看mysql版本

[root@bruce ~]# mysql -uroot -p’root123′ -e “select version();”
Warning: Using a password on the command line interface can be insecure.
+———–+
| version() |
+———–+
| 5.6.27    |
+———–+

 

Xshell如何解决会话显示中文乱码

Xshell是一款优秀的SSH登陆管理工具,当我们有时候新建会话的时候会发现本地中文显示为乱码,这个其实和软件的编码设置有关系,具体步骤如下:

打开你显示乱码的会话,点击菜单栏的“文件”–“属性”,或者使用快捷键“ALT+P”

在打开的属性设置窗口左侧找到“终端”,在右侧找到“编码”,设置和你系统实际编码一致的编码,(可以使用locale -a命令查看系统编码),设置完成保存。

关闭会话,重新登陆,你就会发现你的会话已经能够正常显示中文了。

/application/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory

[root@localhost nginx-1.8.1]# find / -name libpcre.so*
/lib64/libpcre.so.0
/lib64/libpcre.so.0.0.1
/home/tiance/tools/pcre-8.37/.libs/libpcre.so
/home/tiance/tools/pcre-8.37/.libs/libpcre.so.1.2.5
/home/tiance/tools/pcre-8.37/.libs/libpcre.so.1
/usr/local/lib/libpcre.so
/usr/local/lib/libpcre.so.1.2.5
/usr/local/lib/libpcre.so.1
[root@localhost nginx-1.8.1]# vi /etc/ld.so.conf

include ld.so.conf.d/*.conf
/usr/local/lib

ldconfig //使生效

CentOS下用YUM升级OpenSSH和OpenSSL,一行命令搞定

最近有些客户希望升级openssh和ssl,发现centos默认的库无法直接升级。于是制作了下面的升级命令,分别大家使用。CentOS下用YUM升级OpenSSH和OpenSSL,一行命令搞定

 

wget http://www.ctohome.com/linux-vps-pack/webmin/upgrade-openssh.sh;sh upgrade-openssh.sh;

 

升级成功后会自动重启ssh服务,效果图如下:

Stopping sshd: [  OK  ]
Starting sshd: [  OK  ]

==========   www.CTOHome.com   ============
==========      SSH Version    ============
OpenSSH_5.5p1, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008

[root@225845 ~]# ssh -V
OpenSSH_5.5p1, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008

 

以上如果不好用,

yum install -y openssl-devel