阅读本文前,假设你已经有了一台CentOS5.11的服务器。
关于云服务如何降级,移步另一篇文章:阿里云如何降级(安装CentOS5.11)?
配置:服务器1G1H(1G内存、1核心CPU)足够
接下来上高速:
1、首先关闭SELINUX、防火墙、创建虚拟内存(4G);
sudo sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0service iptables stop
chkconfig iptables offmkdir /swap &&
dd if=/dev/zero of=/swap/mySwap bs=1M count=4096 &&
mkswap /swap/mySwap &&
swapon /swap/mySwap &&
sed -i 's/swapoff -a/#swapoff -a/g' /etc/rc.d/rc.local
sed -i '$a /swap/mySwap swap swap default 0 0' /etc/fstab
2、更换yum源;
cd /etc/yum.repos.d/
mkdir old_repo
mv CentOS-* old_repo/
vi /etc/yum.repos.d/CentOS-Base.repo
新窗口填入以下内容 :
[base]
name=CentOS- - Base
baseurl=http://archive.kernel.org/centos-vault/5.11/os/x86_64
#mirrorlist=http://mirrorlist.centos.org/?release=&arch=&repo=os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS- - Updates
baseurl=http://archive.kernel.org/centos-vault/5.11/updates/x86_64
#mirrorlist=http://mirrorlist.centos.org/?release=&arch=&repo=updates
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS- - Extras
baseurl=http://archive.kernel.org/centos-vault/5.11/extras/x86_64
#mirrorlist=http://mirrorlist.centos.org/?release=&arch=&repo=extras
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS- - Addons
baseurl=http://archive.kernel.org/centos-vault/5.11/addons/x86_64
#mirrorlist=http://mirrorlist.centos.org/?release=&arch=&repo=addons
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS- - Plus
baseurl=http://archive.kernel.org/centos-vault/5.11/centosplus/x86_64
#mirrorlist=http://mirrorlist.centos.org/?release=&arch=&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS- - Contrib
baseurl=http://archive.kernel.org/centos-vault/5.11/contrib/x86_64/
#mirrorlist=http://mirrorlist.centos.org/?release=&arch=&repo=contrib
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
3、重建yum缓存
yum clean all
yum list
yum makecache
rpm --rebuilddb
yum update
4、添加仓库源
yum install epel-release
5、安装依赖
yum -y install glibc.i386 &&
yum -y install xulrunner &&
yum -y install libXtst.i386 &&
yum -y install gcc gcc-c++ make zlib-devel &&
yum -y install psmisc &&
yum -y install GeoIP-devel &&
yum -y install libstdc++-devel.i386 &&
yum install libstdc++-devel.x86_64 -y &&
yum install -y bison &&
yum -y install openssl-devel.i386
6、上传dxf服务端、启动脚本及 mysql数据文件(可以找一个单机版打包出来);
mkdir /root/DXF_ALL_IN_ONE
可以使用ftp工具传送文件。这里使用xftp上传,工具下面会放上来。
7、将dxf.tar.gz解压到home目录下;将 start.tar.gz解压到用户目录下;
cd /root/DXF_ALL_IN_ONE/
tar zxvf dxf.tar.gz -C /home/
tar zxvf start.tar.gz -C ~
8、 第7部执行完,home目录下会多了两个目录,接下来需要替换dxf目录下所有配置文件中的ip,以及编译GeoIP;
#注意,第一个ip为原配置ip,第二个ip为当前服务器ip
sed -i "s/192.168.200.131/192.168.31.118/g" `find . -type f -name "*.tbl"`
sed -i "s/192.168.200.131/192.168.31.118/g" `find . -type f -name "*.cfg"`#添加软连接
ln -s /home/dxf/game/libnxencryption.so /lib/libnxencryption.so#编译
cd /home/GeoIP-1.4.8 &&
./configure &&
make && make check && make install
ps:不确定原配置ip可以到配置文件中查看,如:
vi /home/dxf/channel/cfg/channel.cfg
9、mysql安装(默认5.0)
yum search mysql
yum install -y mysql mysql-server mysql-devel
10、替换dxf数据
详情参考:台服DNF更换Mysql5.6(rpm包安装、二进制安装)_Lazyafei的博客-CSDN博客
11、启动
sh ~/run
撒花。
PS:
服务端(dxf服务端、mysql数据、启动脚本)整合包:
链接: https://pan.baidu.com/s/1DXNXDyR7PRmWGaV_8NICdA 提取码: 6666
GM 工具
链接: https://pan.baidu.com/s/1m2CSCKk7ZayH6303PCaTrg 提取码: 6666