├── README.md ├── install └── 启动指令.txt /README.md: -------------------------------------------------------------------------------- 1 | # DNF-server /台服DNF服务端 2 | - 服务端系统请基于 Linux centos 5.8版本 进行搭建 3 | - 上传 Package.tar install 文件到跟目录下并给予777权限 4 | - 启动指令:cd /;chmod -R 0777 /install;bash install 5 | - 虚拟内存设置建议为 8192MB 6 | - IP为您的外网IP&内网IP 7 | - 之后脚本会自动搭建完毕后会自动重启服务端系统 8 | - 上传生成的你的密钥文件 publickey.pem 9 | - [注:如果使用高于centos5系 6系7系及以上 需要附加如下操作] 10 | - 关闭CPU高精度 重启生效 11 | - grubby --update-kernel=ALL --args=highres=off 12 | - 补全安装支持库 13 | - yum install -y xulrunner.i686 14 | - yum install -y libXtst.i686 15 | # 默认目录信息如下 16 | - "启动服务端命令为“./run”,关闭命令为“./stop”" 17 | - "数据库默认帐号为“game”" 18 | - "数据库默认密码为“uu5!^%jg”" 19 | - "php目录为:“/opt/lampp/htdocs" 20 | - "数据库目录为“/opt/lampp/var/mysql”" 21 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | echo "欢迎使用地下城与勇士服务端安装脚本,作者:与你的明日" 2 | echo "进行下一步之前,请先确定你的系统为CentOS 5.X 64bit,否则请按Ctrl+C退出安装脚本" 3 | read -p "请输入你的IP: " ip 4 | IP=$ip 5 | read -p "服务端一共需要8G内存才能较好地运行起来,即物理内存+虚拟内存≥8GB,请输入你需要创建多少MB的虚拟内存(1GB=1024MB,输入整数): " swap 6 | Swap=$swap 7 | cd / 8 | tar -zxvf Package.tar.gz 9 | cd /home/neople/channel 10 | sed -i "s/Public IP/${IP}/g" `find . -type f -name "*.cfg"` 11 | cd /home/neople/game 12 | sed -i "s/Public IP/${IP}/g" `find . -type f -name "*.cfg"` 13 | sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/sysconfig/selinux 14 | setenforce 0 15 | echo "正在创建虚拟内存,请耐心等待。" 16 | dd if=/dev/zero of=/mnt/swap bs=1M count=${Swap} 17 | mkswap /mnt/swap 18 | swapon /mnt/swap 19 | sed -i '$a /mnt/swap swap swap defaults 0 0' /etc/fstab 20 | service iptables stop 21 | chkconfig iptables off 22 | cd 23 | echo "地下城与勇士服务端已经安装完毕了!" 24 | echo "启动服务端命令为“./run”,关闭命令为“./stop”" 25 | echo "数据库默认帐号为“game”" 26 | echo "数据库默认密码为“uu5!^%jg”" 27 | echo "php目录为:“/opt/lampp/htdocs" 28 | echo "数据库目录为“/opt/lampp/var/mysql”" 29 | echo 1 > /proc/sys/vm/drop_caches 30 | reboot -------------------------------------------------------------------------------- /启动指令.txt: -------------------------------------------------------------------------------- 1 | cd /;chmod -R 0777 /install;bash install 2 | 3 | 4 | 6或者7系列 5 | 6 | 关闭防火墙 7 | chkconfig iptables off 8 | 9 | 安装支持库 10 | yum install -y xulrunner.i686 11 | yum install -y libXtst.i686 12 | ———————————————————————————————————————————————————————— 13 | 14 | 优化 15 | yum remove Deployment_Guide-en-US finger cups-libs cups ypbind 16 | yum remove bluez-libs desktop-file-utils ppp rp-pppoe wireless-tools irda-utils 17 | yum remove sendmail* samba* talk-server finger-server bind* xinetd 18 | yum remove nfs-utils nfs-utils-lib rdate fetchmail eject ksh mkbootdisk mtools 19 | yum remove syslinux tcsh startup-notification talk apmd rmt dump setserial portmap yp-tools 20 | yum groupremove "Mail Server" "Games and Entertainment" "X Window System" "X Software Development" 21 | yum groupremove "Development Libraries" "Dialup Networking Support" 22 | yum groupremove "Games and Entertainment" "Sound and Video" "Graphics" "Editors" 23 | yum groupremove "Text-based Internet" "GNOME Desktop Environment" "GNOME Software Development" 24 | 清理缓存 25 | yum clean all #清理全部缓存文件 26 | 27 | 第三步、禁用seLinux 28 | 29 | sestatus #先执行看seLinux状态,如果不是disabled,就需要执行下面步骤,否则不要执行 30 | vi /etc/selinux/config 31 | SELINUX=disabled #禁用SeLinux 32 | SELINUX=enforcing #使用SeLinux 33 | 34 | 第四步、禁止IPV6(执行后需要reboot重启) 35 | 36 | vi /etc/modprobe.conf #打开文件,把下面两行加到最后 37 | alias net-pf-10 off 38 | alias ipv6 off 39 | 40 | 第六步、禁止无用服务 41 | 42 | #! /bin/bash 43 | service acpid off 44 | service atd stop 45 | service auditd stop 46 | service avahi-daemon stop 47 | service avahi-dnsconfd stop 48 | service bluetooth stop 49 | service conman stop 50 | service cpuspeed stop 51 | service cups stop 52 | service dnsmasq stop 53 | service dund stop 54 | service firstboot stop 55 | service hidd stop 56 | service httpd stop 57 | service ibmasm stop 58 | service ip6tables stop 59 | service irda stop 60 | service kdump stop 61 | service lm_sensors stop 62 | service mcstrans stop 63 | service messagebus stop 64 | service microcode_ctl stop 65 | service netconsole stop 66 | service netfs stop 67 | service netplugd stop 68 | service nfs stop 69 | service nfslock stop 70 | service nscd stop 71 | service ntpd stop 72 | service oddjobd stop 73 | service pand stop 74 | service pcscd stop 75 | service portmap stop 76 | service psacct stop 77 | service rdisc stop 78 | service restorecond stop 79 | service rpcgssd stop 80 | service rpcidmapd stop 81 | service rpcsvcgssd stop 82 | service saslauthd stop 83 | service sendmail stop 84 | service setroubleshoot stop 85 | service smb stop 86 | service vncserver stop 87 | service winbind stop 88 | service wpa_supplicant stop 89 | service xfs stop 90 | service ypbind stop 91 | service yum-updatesd stop 92 | chkconfig acpid off 93 | chkconfig atd off 94 | chkconfig auditd off 95 | chkconfig avahi-daemon off 96 | chkconfig avahi-dnsconfd off 97 | chkconfig bluetooth off 98 | chkconfig conman off 99 | chkconfig cpuspeed off 100 | chkconfig cups off 101 | chkconfig dnsmasq off 102 | chkconfig dund off 103 | chkconfig firstboot off 104 | chkconfig hidd off 105 | chkconfig httpd off 106 | chkconfig ibmasm off 107 | chkconfig ip6tables off 108 | chkconfig irda off 109 | chkconfig kdump off 110 | chkconfig lm_sensors off 111 | chkconfig mcstrans off 112 | chkconfig messagebus off 113 | chkconfig microcode_ctl off 114 | chkconfig netconsole off 115 | chkconfig netfs off 116 | chkconfig netplugd off 117 | chkconfig nfs off 118 | chkconfig nfslock off 119 | chkconfig nscd off 120 | chkconfig ntpd off 121 | chkconfig oddjobd off 122 | chkconfig pand off 123 | chkconfig pcscd off 124 | chkconfig portmap off 125 | chkconfig psacct off 126 | chkconfig rdisc off 127 | chkconfig restorecond off 128 | chkconfig rpcgssd off 129 | chkconfig rpcidmapd off 130 | chkconfig rpcsvcgssd off 131 | chkconfig saslauthd off 132 | chkconfig sendmail off 133 | chkconfig setroubleshoot off 134 | chkconfig smb off 135 | chkconfig vncserver off 136 | chkconfig winbind off 137 | chkconfig wpa_supplicant off 138 | chkconfig xfs off 139 | chkconfig ypbind off 140 | chkconfig yum-updatesd off --------------------------------------------------------------------------------