Advertisement
SparkRiders

PW Centos

Mar 23rd, 2017 (edited)
1,551
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.03 KB | None | 0 0
  1. //============================================================================================================
  2. // By RXL-Realms
  3. // This post has been posted at https://rxl.smfnew2.com
  4. // Join our Discord at https://discord.gg/uqUfXdS2Vc
  5. // Learn more at https://www.youtube.com/@rxlrealms
  6. //============================================================================================================
  7.  
  8. tips:
  9. #configure your centos through installation on static ip make sure to always configure it to manual
  10. then add your ipv4 = the ip of your server subnetmask 255.255.255.0 and gateway to your router ip dns to 8.8.8.8 8.8.4.4
  11. #to use vi text editir press I to insert and Shift + : then type x to save file or q to quit without saving!
  12. #to change centos to static ip
  13.  
  14. vi /etc/sysconfig/network-scripts/ifcfg-eth0
  15.  
  16. sample:
  17.  
  18. DEVICE="eth0"
  19. NM_CONTROLLED="yes"
  20. ONBOOT=yes
  21. HWADDR=A4:BA:DB:37:F1:04
  22. TYPE=Ethernet
  23. BOOTPROTO=static
  24. NAME="System eth0"
  25. UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
  26. IPADDR=192.168.1.44
  27. NETMASK=255.255.255.0
  28.  
  29.  
  30.  
  31. ## Configure Default Gateway
  32. #
  33. # vi /etc/sysconfig/network
  34.  
  35. NETWORKING=yes
  36. HOSTNAME=centos6
  37. GATEWAY=192.168.1.1
  38.  
  39.  
  40.  
  41. ## Restart Network Interface
  42. #
  43.  
  44. /etc/init.d/network restart
  45.  
  46. ## Configure DNS Server
  47. #
  48. # vi /etc/resolv.conf
  49.  
  50. nameserver 8.8.8.8 # Replace with your nameserver ip
  51. nameserver 192.168.1.1 # Replace with your nameserver ip
  52.  
  53. original post of changing centos to static ip here : https://gist.github.com/fernandoaleman/2172388
  54.  
  55. 1- Install linux libs
  56.  
  57. [CODE]1.02.74-10.el6_3.3.x86_64 groff-1.18.1.4-21.el6.x86_64 device-mapper-event-1.02.74-10.el6_3.3.x86_64 selinux-policy-3.7.19-155.el6_3.14.noarch cyrus-sasl-lib-2.1.23-13.el6_3.1.x86_64 kernel-2.6.32-279.19.1.el6.x86_64 lvm2-2.02.95-10.el6_3.3.x86_64 epel-release-6-8.noarch gpg-pubkey-6b8d79e6-3f49313d libgpg-error-1.7-4.el6.x86_64 libgcc-4.4.6-4.el6.i686 glibc-common-2.12-1.80.el6_3.7.x86_64 unzip-6.0-1.el6.x86_64 p7zip-plugins-9.20.1-2.el6.x86_64 unrar-4.2.3-1.el6.rf.x86_64 fuse-libs-2.8.3-4.el6.x86_64 fipscheck-1.2.0-7.el6.x86_64 glibc-2.12-1.80.el6_3.7.i686 zlib-1.2.3-27.el6.i686 compat-libstdc++-33-3.2.3-69.el6.i686 nss-util-3.13.6-1.el6_3.x86_64 nss-3.13.6-2.el6_3.x86_64 kernel-2.6.32-279.22.1.el6.x86_64 tzdata-2012j-1.el6.noarch ntpdate-4.2.4p8-2.el6.centos.x86_64 bzip2-libs-1.0.5-7.el6_0.x86_64 perl-Pod-Escapes-1.04-127.el6.x86_64 libdrm-2.4.25-2.el6.x86_64 perl-version-0.77-127.el6.x86_64 perl-Module-Pluggable-3.90-127.el6.x86_64 perl-DBI-1.609-4.el6.x86_64 postfix-2.6.6-2.2.el6_1.x86_64 mysql-5.1.67-1.el6_3.x86_64 libcap-ng-0.6.4-3.el6_0.1.x86_64 lzo-2.03-3.1.el6.x86_64 python-pycurl-7.19.0-8.el6.x86_64 gnutls-2.8.5-4.el6_2.2.x86_64 openvpn-2.2.2-1.el6.rf.x86_64 cracklib-dicts-2.8.16-4.el6.x86_64 perl-URI-1.40-2.el6.noarch pciutils-3.1.4-11.el6.x86_64 perl-Compress-Raw-Zlib-2.020-127.el6.x86_64 perl-Compress-Zlib-2.020-127.el6.x86_64 passwd-0.77-4.el6_2.2.x86_64 perl-HTML-Parser-3.64-2.el6.x86_64 iptables-ipv6-1.4.7-5.1.el6_2.x86_64 perl-libwww-perl-5.833-2.el6.noarch perl-XML-RegExp-0.03-7.el6.noarch bash-4.1.2-9.el6_2.x86_64 curl-7.19.7-26.el6_2.4.x86_64 libgcrypt-1.4.5-9.el6_2.2.x86_64[/CODE]
  58.  
  59. most of them will work and rest won't this was taken from titan Battle of immortal install package script and i didn't bother to specify them but if anyone did that please post down here to update the thread
  60.  
  61.  
  62.  
  63. 2- Fix epel repo
  64.  
  65. since epel repo the following command will solve the problem
  66.  
  67. sudo yum upgrade ca-certificates --disablerepo=epel
  68.  
  69. optional if you wish to clean yum[CODE]yum clean all && yum makecache
  70.  
  71.  
  72.  
  73. 3-Install pw server files
  74. use winscp and upload the server files using stfp connection of centos to directory /home
  75. use winscp to move all folders from /home/home to /home and del /home/home with winscp or command
  76. rm -rf /home/home
  77. apply the following commands
  78.  
  79. rm -rf /home/etc/hosts
  80. cp -rf /home/etc /
  81. cp -rf /home/libs /
  82. cp -rf /home/libs /usr/
  83. rm -rf /home/libs
  84.  
  85. 4-Configuration
  86. #change hosts file
  87. vi /etc/hosts
  88. # add those lines to hosts file
  89.  
  90. 127.0.0.1 manager
  91. 127.0.0.1 aumanager
  92. 127.0.0.1 auth
  93. 127.0.0.1 audb
  94. 127.0.0.1 link1 link2 game1 game2 game3 game4 delivery database backup
  95. 127.0.0.1 gmserver.localdomain gmserver 127.0.0.1 bogon
  96.  
  97.  
  98. # change your username to mysql username and password
  99. vi /etc/table.xml
  100.  
  101.  
  102. # change first 4 ip addresses '0.0.0.0' to your ip
  103. vi /home/glinkd/gamesys.conf
  104.  
  105. 5-fix problem with gacd on centos
  106. here:http://forum.ragezone.com/f753/solved-centos-issue-gacd-libxml2-1128722/
  107.  
  108. 6-servers to install
  109. MYSQL
  110. 2 choices
  111. 1- if you want to run mysql server or having one already on different machine , windows for example
  112. #this will install mysql client
  113. then apply that command only
  114.  
  115. yum install mysql
  116.  
  117. Apache
  118. 2 choices as well
  119. 1- if you want to run apache server or having one already on different machine , windows for example
  120. #then do nothing and depend only on apache server on windows
  121. 2- if you want to run it on the same hosting machine then
  122.  
  123. yum install httpd php
  124.  
  125. ALL
  126. # this will install all on the same machine
  127.  
  128. sudo yum install httpd mysql-server php php-mysql
  129. sudo service httpd start
  130. sudo service mysqld start
  131. sudo mysql_secure_installation
  132. sudo yum install phpmyadmin
  133. vi /etc/httpd/conf.d/phpMyAdmin.conf
  134. example
  135. . . .
  136. Require ip your_workstation_IP_address
  137. . . .
  138. Allow from your_workstation_IP_address
  139. . . .
  140. Require ip your_workstation_IP_address
  141. . . .
  142. Allow from your_workstation_IP_address
  143. . . .
  144. [/CODE]
  145. follow this guide from original post here : https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-a-centos-6-4-vps
  146. JAVA
  147. #install java
  148. [CODE]yum install java-1.6.0-openjdk[/CODE]
  149. JETTY
  150. #follow this guide on these links
  151. http://www.copper-arrow.com/blog/jetty-web-server-centos-6
  152. http://forum.ragezone.com/f695/install-pw-server-centos-788699/
  153.  
  154. the last touches
  155. 1- add pw website to apache
  156. cp -rf /home/var /
  157. rm -rf /home/var
  158. 2- add pwadmin to jetty
  159. cp -R adminer/ /opt/jetty/webapps/
  160. cp -R pwAdmin/ /opt/jetty/webapps/
  161. cp -R ROOT/ /opt/jetty/webapps/
  162. 3- edit server file
  163.  
  164. rm -rf /home/server
  165. vi /home/server
  166.  
  167. #add the following on this new empty file
  168. #!/bin/bash
  169.  
  170. ServerDir=home
  171. GsLogFileDir=$ServerDir
  172. GsLogFileName=GameService_Log
  173.  
  174. txtnrm='\e[0;0m' # Normal
  175. txtred='\e[0;31m' # Red
  176. txtgrn='\e[0;32m' # Green
  177.  
  178. Server::Start()
  179. {
  180. if [ ! -d /$ServerDir/logs/starting ]; then
  181. mkdir /$ServerDir/logs/
  182. mkdir /$ServerDir/logs/starting
  183. fi
  184. echo -e "=== [${txtred} START ${txtnrm}] Log Service ==="
  185. cd /$ServerDir/logservice; ./logservice logservice.conf > /$ServerDir/logs/starting/logservice.log &
  186. sleep 3
  187. echo -e "=== [${txtgrn} OK ${txtnrm}] ==="
  188. echo -e ""
  189.  
  190. echo -e "=== [${txtred} START ${txtnrm}] Unique Name ==="
  191. cd /$ServerDir/uniquenamed; ./uniquenamed gamesys.conf > /$ServerDir/logs/starting/uniquenamed.log &
  192. sleep 3
  193. echo -e "=== [${txtgrn} OK ${txtnrm}] ==="
  194. echo -e ""
  195.  
  196. echo -e "=== [${txtred} START ${txtnrm}] Auth ==="
  197. cd /$ServerDir/auth/build; ./authd.sh start &
  198. sleep 5
  199. echo -e "=== [${txtgrn} OK ${txtnrm}] ==="
  200. echo -e ""
  201.  
  202. echo -e "=== [${txtred} START ${txtnrm}] Data Base ==="
  203. cd /$ServerDir/gamedbd; ./gamedbd gamesys.conf > /$ServerDir/logs/starting/gamedbd.log &
  204. sleep 10
  205. echo -e "=== [${txtgrn} OK ${txtnrm}] ==="
  206. echo -e ""
  207.  
  208. echo -e "=== [${txtred} START ${txtnrm}] Anti Cheat ==="
  209. cd /$ServerDir/gacd; ./gacd gamesys.conf > /$ServerDir/logs/starting/gacd.log &
  210. sleep 5
  211. echo -e "=== [${txtgrn} OK ${txtnrm}] ==="
  212. echo -e ""
  213.  
  214. echo -e "=== [${txtred} START ${txtnrm}] Faction ==="
  215. cd /$ServerDir/gfactiond; ./gfactiond gamesys.conf > /$ServerDir/logs/starting/gfactiond.log &
  216. sleep 7
  217. echo -e "=== [${txtgrn} OK ${txtnrm}] ==="
  218. echo -e ""
  219.  
  220. echo -e "=== [${txtred} START ${txtnrm}] Delivery ==="
  221. cd /$ServerDir/gdeliveryd; ./gdeliveryd gamesys.conf > /$ServerDir/logs/starting/gdeliveryd.log &
  222. sleep 5
  223. echo -e "=== [${txtgrn} OK ${txtnrm}] ==="
  224. echo -e ""
  225.  
  226. echo -e "=== [${txtred} START ${txtnrm}] Link ==="
  227. cd /$ServerDir/glinkd; ./glinkd gamesys.conf 1 > /$ServerDir/logs/starting/glink.log &
  228. cd /$ServerDir/glinkd; ./glinkd gamesys.conf 2 > /$ServerDir/logs/starting/glink2.log &
  229. cd /$ServerDir/glinkd; ./glinkd gamesys.conf 3 > /$ServerDir/logs/starting/glink3.log &
  230. cd /$ServerDir/glinkd; ./glinkd gamesys.conf 4 > /$ServerDir/logs/starting/glink4.log &
  231. sleep 8
  232. echo -e "=== [${txtgrn} OK ${txtnrm}] ==="
  233. echo -e ""
  234.  
  235. echo -e "=== [${txtred} START ${txtnrm}] Game Service ==="
  236. cd /home/gamed; ./gs is62 > /home/logs/is62.log &
  237. cd /$ServerDir/gamed; ./gs gs01 > /$ServerDir/logs/starting/gs01.log &
  238. sleep 30
  239. echo -e "=== [${txtgrn} OK ${txtnrm}] ==="
  240. }
  241.  
  242. Server::Stop()
  243. {
  244.  
  245. echo -e "[${txtgrn} OK ${txtnrm}] Stop Log Service"
  246. pkill -9 logservices
  247. sleep 2
  248. echo -e "[${txtgrn} OK ${txtnrm}] Stop Link"
  249. pkill -9 glinkd
  250. sleep 15
  251. echo -e "[${txtgrn} OK ${txtnrm}] Stop Auth"
  252. pkill -9 authd
  253. sleep 3
  254. echo -e "[${txtgrn} OK ${txtnrm}] Stop Delivery"
  255. pkill -9 gdeliveryd
  256. sleep 2
  257. echo -e "[${txtgrn} OK ${txtnrm}] Stop Anti Cheat"
  258. pkill -9 gacd
  259. sleep 2
  260. echo -e "[${txtgrn} OK ${txtnrm}] Stop Game Service"
  261. pkill -9 gs
  262. sleep 2
  263. echo -e "[${txtgrn} OK ${txtnrm}] Stop Faction"
  264. pkill -9 gfactiond
  265. sleep 2
  266. echo -e "[${txtgrn} OK ${txtnrm}] Stop Unique Name"
  267. pkill -9 uniquenamed
  268. sleep 2
  269. echo -e "[${txtgrn} OK ${txtnrm}] Stop Data Base"
  270. pkill -9 gamedbd
  271. sleep 2
  272. echo -e "[${txtgrn} OK ${txtnrm}] Stop Java"
  273. pkill -9 java
  274. sleep 3
  275. }
  276.  
  277. PARAM_STR=$1
  278. if [ -n "$PARAM_STR" ]; then
  279. if [ "$PARAM_STR" == "start" ]; then
  280. Server::Start
  281. elif [ "$PARAM_STR" == "stop" ]; then
  282. Server::Stop
  283. elif [ "$PARAM_STR" == "restart" ]; then
  284. Server::Stop
  285. echo ""
  286. Server::Start
  287. elif [ "$PARAM_STR" == "getlog" ]; then
  288. cd /$ServerDir/gamed; ./gs log > /$GsLogFileDir/$GsLogFileName.txt
  289. echo -e "[${txtgrn} OK ${txtnrm}] Getting Logs. Path To Log File: /${GsLogFileDir}/${GsLogFileName}.txt"
  290. fi;
  291. fi;
  292. exit 0
  293.  
  294. 3-shut down firewall/iptables
  295.  
  296. /etc/init.d/iptables save
  297. /etc/init.d/iptables stop
  298. chkconfig iptables off
  299.  
  300. 4- check website url http://yourserver'sip/
  301. 5- to make server public port forward from router with 29000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement