Skip to content

倪之帅 Victor 个人主页

  • Home
  • Tech
    • Linux
    • LNMP
    • Mac
    • Mobile
    • Products
    • SMS
  • 英语学习
May 16, 2018 / Linux

Centos install haproxy

Command

yum update -y
yum install haproxy

mv /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.default
vi /etc/haproxy/haproxy.cfg

copy to haproxy.cfg

global
ulimit-n 51200
defaults
log global
mode tcp
option dontlognull
timeout connect 1000ms
timeout client 150000ms
timeout server 150000ms
frontend 80-in
bind *:80
default_backend 80-out
backend 80-out
server server1 original Ip maxconn 20480

Auto start haproxy

sudo chkconfig haproxy on
June 2, 2018 / Linux

Centos 7 enable port 80

firewall

firewall-cmd --zone=public --add-port=80/tcp --permanent
systemctl stop firewalld.service
systemctl start firewalld.service
systemctl restart firewalld.service

 

Ipatbles

iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 80 -j ACCEPT
systemctl save iptables.service
systemctl restart iptables.service
May 16, 2018 / Linux

postfix删除队列中的邮件

Postfix中有一套Mail Queue Management机制,所有队列中的邮件都可以全自动的处理,但在发送大量邮件的时候,有必要对这个队列进行手工的维护处理,比如说,删除队列中的邮件. 以下是一些常用的命令:

列出目前在 Mail Queue 中的邮件

mailq

刪除所有在 Queue 中的邮件

postsuper -d ALL

(more…)

Continue Reading
May 16, 2018 / Linux

mount ntfs-3g

fdisk -l

 

mkdir /home/sdb1
mount -t ntfs-3g /dev/sdb1 /home/sdb1
vi /etc/fstab
/dev/sdb1 /home/sdb1 ntfs-3g defaults 0 0
November 29, 2015 / 技术

php timezone

http://php.net/manual/en/timezones.php

date.timezone = Pacific/Auckland

May 16, 2018 / 技术

Check CentOS folder space

command

cd /
du --max-depth=1 -h
/var/log
May 16, 2018 / Linux

How To Configure Static IP On CentOS 6

Configure eth0

vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
NAME="System eth0"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
IPADDR=192.168.1.44
NETMASK=255.255.255.0

## Configure Default Gateway
#

vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos6
GATEWAY=192.168.1.1

## Restart Network Interface
#

/etc/init.d/network restart

## Configure DNS Server
#

vi /etc/resolv.conf
nameserver 8.8.8.8 # Replace with your nameserver ip
nameserver 192.168.1.1 # Replace with your nameserver ip
May 16, 2018 / Linux

Linux VPS添加SWAP(交换分区)

Linux VPS添加SWAP(交换分区)

1.进入目录

cd /var/

2.获取要增加的SWAP文件块(这里以1GB为例)

dd if=/dev/zero of=swapfile bs=1024 count=1038336

2G

dd if=/dev/zero of=swapfile bs=2048 count=2097152

3.创建SWAP文件

/sbin/mkswap swapfile

4.激活SWAP文件

/sbin/swapon swapfile

5.查看SWAP信息是否正确

/sbin/swapon –s

6.添加到fstab文件中让系统引导时自动启动

echo "/var/swapfile swap swap defaults 0 0" >>/etc/fstab

上面这步也可以修改/etc/fstab,末尾加入/var/swapfile swap swap defaults 0 0

7.查看是否挂载成功

free -m

一次性安装代码

cd /var/
dd if=/dev/zero of=swapfile bs=1024 count=1038336
/sbin/mkswap swapfile
/sbin/swapon swapfile
echo "/var/swapfile swap swap defaults 0 0" >>/etc/fstab
 
May 16, 2018 / Mac

Mac install Brew

安装命令如下:

curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1

当brew安装成功后,就可以随意安装自己想要的软件了,例如wget,命令如下:

sudo brew install wget

卸载的话,命令如下:

sudo brew uninstall wget

查看安装软件的话,命令如下:

sudo brew search /apache*/

注意/apache*/是使用的正则表达式,用/分割。

June 16, 2016 / Linux

How To Use Rsync to Sync Local and Remote Directories on a VPS

Introduction
Rsync, which stands for “remote sync”, is a remote and local file synchronization tool. It uses an algorithm that minimizes the amount of data copied by only moving the portions of files that have changed.

In this guide, we will cover the basic usage of this powerful utility. We will be using an Ubuntu 12.04 VPS in the examples, but you can use any modern Linux distribution to follow along.
(more…)

Continue Reading

Posts navigation

  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next

Categories

  • Linux
  • LNMP
  • Mac
  • Mobile
  • PHP
  • Products
  • SMS
  • Uncategorized
  • VPS
  • 原创
  • 技术

Recent Posts

  • composer切换源_composer全局更换镜像源的教程
  • 宝塔终端切换root用户为www
  • linux 宝塔 nginx php8.0 或者 php7 安装swoole
  • 宝塔面板修改composer默认PHP版本
  • PHP代码http跳转到https

Archives

  • October 2022
  • August 2022
  • June 2020
  • June 2019
  • October 2018
  • May 2018
  • April 2018
  • March 2018
  • July 2016
  • June 2016
  • April 2016
  • November 2015
  • October 2015
  • May 2015
  • April 2015
  • February 2015
  • January 2015
  • December 2014
  • October 2014
  • August 2014
  • April 2014
  • June 2011
  • June 2010
  • May 2010
  • April 2010
  • December 2004
  • October 2002
  • January 2001
  • March 2000
© 2000-2025 倪之帅 Victor 个人主页