Centos 双网卡 默认路由

之前建了一台虚拟机,一块网卡vlan100(可访问公网),一块网卡vlan2(只能访问内网)

操作系统是centos 7

系统完整完成后发现无法上网 …

more ...

Centos 支持NTFS格式磁盘

要使用linux 支持NTFS格式,需要额外安装软件包

软件名字

ntfs-3g

下载地址:http://www.tuxera.com/community/open-source-ntfs-3g/

1.下载软件包:

[root@Udisk-GKM ~]# wget https://tuxera.com/opensource/ntfs-3g_ntfsprogs-2015.3.14.tgz^C
[root …
more ...

Centos7 查看IP

Centos7 最小化安装,是没有ifconfig命令的

是要安装以下的软件包:

yum install net-tools

ifconfig命令来自于 net-tools工具

但是centos7中默认安装了iproute套件,iproute2套件里提供了许多增强功能的命令,ip命令即是其中之一。

iproute2

设置ip 命令

ip addr add 192.168.0.193/24 dev wlan0

请注意IP地址要有一个后缀,比 …

more ...

Centos7 禁用IPV6

很多时候我们根本用不到IPV6

所以我们需要禁用掉IPV6模块

最好的方便就是系统启动的使用

[root@Yum ~]# vi /etc/default/grub
GRUB_TIMEOUT=5

    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc …
more ...

wordpress替换默认的字体

可以编辑以下两个文件:

wp-includes/script-loader.php

wp-content/themes/主题名称/functions.php

找到

open_sans_font_url = "//fonts.googleapis.com/css?family1=Open+Sans:300italic,400italic,600italic,300,400,600⊂=$subsets";

把googleapis.com换成360的字体库:useso.com

more ...

yum clean all,yum 升级失败

今天使用yum 来自动升级服务器的时候发生错误.

yum 进程自动会被killed ,在终端中也没有返回任何其他错误信息

查过度娘后 …

more ...

centos wget代理设置

linux

今天安装了一个centos 6.5

由于机器没有直接访问internet的权限,所以在使用YUM之前,我对yum 增加了代理的设置

编辑/etc/yum.conf

[root@Personal ~]# vim /etc/yum.conf

在 …

more ...

禁用、启用SeLinux

SELinux

SELinux(Security-Enhanced Linux) 是美国国家安全局(NSA)对于强制访问控制的 实现,是 Linux历史上最杰出的新安全子系统。NSA是在Linux社区的帮助下开发了一种访问控制体系,在这种访问控制体系的限制下,进程只能访问那些在他 …

more ...

linux 自动注销登录帐号

很多时候我们都会忘记注销账户

我们可以如下设定:

[root@vStudy ~]# vi /etc/profile

在最后一行添加如下代码:

export TMOUT=60

在60秒后自动注销,无需重启,在下一 …

more ...

-bash: ssh: command not found的解决办法

最小化安装的问题.

more ...

MySql 简单设置

环境centos6.5+apache+php+mysql

统一采用yum 安装

安装完成后第一次启动mysql服务

[root@vBlog www]# service mysqld  start

    Initializing MySQL database:  WARNING: The host 'vBlog' could not be looked up with resolveip.

    This probably means that your …
more ...

Centos怎样查看已经安装的软件

centos查看已经安装的软件

centos

命令如下:

rpm -qa |grep  name_of_software

例如:

   [root@vBlog ~]# rpm -qa|grep vsftpd

vsftpd-2.2.2-11.el6_4.1.x86_64

[root@vBlog ~]#
more ...

wordpress安装百度分享按钮

在安装插件页面搜索baidushare

search

然后安装插件:

find

然后启用插件

uesbaidu

然后点击进行配置:

config

代码的取得:

登录百度的分享

按照提示进行操作 …

more ...

Linux 查看文件系统、磁盘

centos
centos 下查看硬盘的信息
[root@vCentos ~]# fdisk -l

Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes …
more ...

Centos 双网卡绑定

[root@Study ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
[root@Study ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
[root@Study ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
ONBOOT …
more ...

linux常用命令

1.losf
lsof(list open files)是一个列出当前系统打开文件的工具。在linux环境下,任何事物都以文件的形式存在,通过文件不仅仅可以访问常规 …
more ...

linux cpu,内存, 使用情况

  1. cpu 使用

查看CPU的完整信息:

root@squid ~]# cat /proc/cpuinfo

输出结果如下:

[root@squid ~]# cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 42
model name  : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
stepping    : 7
cpu MHz     : 3392.294
cache size  : 8192 …
more ...

Centos 的源

首先备份/etc/yum.repos.d/CentOS-Base.repo

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)

http://mirrors.163 …

more ...

vsftpd+iptables

1.查看系统版本

[root@Apache vsftpd]# lsb_release -a
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.5 (Final)
Release:    6.5
Codename:   Final
[root@Apache vsftpd]#
  1. 由于FTP采用的是被动方式传输 …
more ...

centos 路由说明

route add 的方法添加路由后,服务器重启后,会消失不见,这个是临时的添加方面
方法如下:
route add -net 172.24.0.0/16 gw 172.24.3.1
172.24 …
more ...