dd if=/dev/zero of=/swapfile bs=2M count=1024
mkswap /swapfile
swapon /swapfile
/swapfile swap swap defaults 0 0
vim /etc/fstab
/swapfile swap swap defaults 0 0
yum -y install screen
screen -S idcbaike
yum -y upgrade
yum install -y wget gcc gcc-c++ flex bison make bind bind-libs bind-utils openssl openssl-devel perl patch quota libaio libcom_err-devel libcurl-devel gd zlib-devel zip unzip libcap-devel cronie bzip2 db4-devel cyrus-sasl-devel perl-ExtUtils-Embed autoconf automake libtool which patch mailx bzip2-devel lsof glibc.i686 openssl098e.i686 libstdc++.i686
systemctl stop firewalld
systemctl disable firewalld
———————————–
ifconfig eth0:0 公网ip netmask 255.255.255.0 up
iptables -t nat -A POSTROUTING -s 公网ip -j SNAT –to-source=内网ip
sed -i ‘/exit .*/d’ /etc/rc.local
sed -i ‘$a\ifconfig eth0:0 公网ip netmask 255.255.255.0 up’ /etc/rc.local
sed -i ‘$a\iptables -t nat -A POSTROUTING -s 公网ip -j SNAT –to-source=内网ip’ /etc/rc.local
sed -i ‘$a\exit 0’ /etc/rc.local
————————————–
cd /etc/sysconfig/network-scripts
vi ifcfg-eth0:0
DEVICE=eth0:0
BOOTPROTO=none
ONPARENT=yes
IPADDR=149.129.69.189
NETMASK=255.255.255.0
ONBOOT=yes
———————————–
wget http://www.directadmin.com/setup.sh
chmod 755 setup.sh
./setup.sh
php版本切换
cd /usr/local/directadmin/custombuild/
vi options.conf
./build clean
./build update
./build all y
IP管理–添加IP
把内网IP(内网ip)添加进去, 掩码可以去/sbin/ifconfig查看
添加完成后返回IP关联, 点击公网IP(如:公网ip), 选择下面的内网IP(内网ip), 取消添加到DNS, 选择添加到Apache后点击关联.
vi /usr/local/directadmin/conf/directadmin.conf
lan_ip=内网ip