分类存档: 未分类

阿里云 轻量云服务器 directadmin 安装

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