Linux(Ubuntu)环境下搭建我的世界(MC)Forge服务器

    最经华为云搞活动,每天零点抢50台4核8G内存云主机,只要9.9元,当然只能买一个月,之后要正常续费,笔者闲着没事便抢了一台,一个月的期限,随便搞搞学习学习倒也不错。看到舍友在玩我的世界,于是便想着搭建一个服务器来一起玩。

    首先服务器上得有JAVA环境,输入以下命令查看Java版本:

    java -version

    如果提示没有java命令,那就安装java先,可参考上一篇文章:Linux(Ubuntu)下安装Java JDK7 JDK8

    安完Java之后,建议安装一个screen,它可以后台新建会话,从而退出命令行后保持程序运行,输入以下安装:

    apt-get install screen default-jdk

    之后要下载MC官方服务器和Forge服务器,首先创建一个文件夹(本文路径以/home/mc为例,请自行替换),输入:

    mkdir /home/mc/

    再CD到该文件夹:

    cd /home/mc

    使用wget命令下载MC官方服务器:

    wget https://s3.amazonaws.com/Minecraft.Download/versions/1.7.10/minecraft_server.1.7.10.jar

    下载完成后,需要为其添加两个文件,一是用户条款协议,二是服务器配置文件;

    输入:

    vim eula.txt

    按I进入编辑模式,输入 eula=true 表示同意条款,之后按ESC退出编辑模式,输入:wq保存文件并退出Vim编辑器。

    输入:

    vim server.properties

    同样按I进入编辑模式,输入 online-mode=false 表示不使用官方正版服务,之后按ESC退出编辑模式,输入:wq保存文件并退出Vim编辑器。

    之后启动服务器:

    java -Xmx2048M -Xms2048M -XX:ParallelGCThreads=16 -jar minecraft_server.jar nogui

    (-Xmx最大内存 -Xms最小内存 -XX:ParallelGCThreads同时调用CPU线程数量)

    如果看到Done!则表示服务器正常运行,至此,一个MC原版服务器搭建完成。

    如果要搭建MC Forge版本服务器,则键入stop先停止这个服务器运行。

    再使用wget命令下载Forge服务器文件:

    wget http://files.minecraftforge.net/maven/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/forge-1.7.10-10.13.4.1614-1.7.10-installer.jar
    wget http://files.minecraftforge.net/maven/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/forge-1.7.10-10.13.4.1614-1.7.10-universal.jar

    安装Forge服务器:

    java -jar forge-1.7.10-10.13.4.1614-1.7.10-installer.jar nogui --installServer

    启动它:

    java -jar forge-1.7.10-10.13.2.1614-1.7.10-universal.jar nogui

    启动后输入stop停止它。

    接下来将Forge服务器整合到官方服务器包里,新建文件夹unzip并CD到其目录:

    mkdir unzip  
    cd unzip

    解压两个服务器文件:

    unzip ../minecraft_server.1.7.10.jar
    unzip ../forge-1.7.10-10.13.2.1291-universal.jar

    第二条命令会提示是否覆盖文件(replace META-INF/MANIFEST.MF? [y]es, [n]o, [A]ll, [N]one, [r]ename:),这时输入 A 表示全部覆盖。

    重新打包:

    zip -r ../Forge-minecraft_server.1.7.10.jar *

    CD回上层目录,并启动服务器:

    cd ../
    java -Xmx8192M -Xms8192M -XX:ParallelGCThreads=16 -jar Forge-minecraft_server.1.7.10.jar nogui

    看到Done!表示正常运行,到此搭建完成,但关闭远程命令行后,这个程序就会退出,所以使用screen来启动服务器进程:

    输入stop结束当前Forge服务;

    输入:

    screen -S name

    新建一个名为name的会话,之后再次输入命令启动服务:

    java -Xmx8192M -Xms8192M -XX:ParallelGCThreads=16 -jar Forge-minecraft_server.1.7.10.jar nogui

    按Ctrl+A再按D退出当前screen,程序就在后台运行,想要调出这个会话只需输入:

    screen -r name

    即可恢复该会话。




    原文链接:http://www.guokr.com/post/685597/


jAMD:
2017-06-13
jAMD9C <a href="http://rgtqyblvmthp.com/">rgtqyblvmthp</a>, [url=http://jdpbvqikfjvq.com/]jdpbvqikfjvq[/url], [link=http://nxhpcarknkam.com/]nxhpcarknkam[/link], http://xvmdxmcv
e31i:
2017-06-13
e31i8D <a href="http://gxtatcwwrmvg.com/">gxtatcwwrmvg</a>, [url=http://xkjifxwcffjc.com/]xkjifxwcffjc[/url], [link=http://dlzxzwwalccl.com/]dlzxzwwalccl[/link], http://mzikcaqh
WY5a:
2017-06-13
WY5aM1 <a href="http://nhbykdfwxdxu.com/">nhbykdfwxdxu</a>, [url=http://wifhwndikasb.com/]wifhwndikasb[/url], [link=http://kjtntsgnztow.com/]kjtntsgnztow[/link], http://bysfwvkh
tf0e:
2017-06-15
tf0e3T <a href="http://dnvncpjzoxwa.com/">dnvncpjzoxwa</a>, [url=http://ettysqyoxsdn.com/]ettysqyoxsdn[/url], [link=http://mvocfhpdvltu.com/]mvocfhpdvltu[/link], http://izizbduc
OlegsPep:
2017-06-19
Как восстановить эрекцию Страх — это самое последнее чувство, которое может испытывать истинный мужчина, но это не всегда так. Не взирая на то, что парни практически ничего не боятся, есть одна г
JeffreyA:
2017-07-02
Вкуснейший экзотический плод - мангустин, стал настоящим открытием в диетологии! Он содержит РЕКОРДНОЕ количество полезных веществ, стимулирующих активное жиросжигание и снижающих вес! Сироп мангу
HowarddA:
2017-07-02
[b]Как Быстро Избавиться От Грибка Ногтей На Ногах [/b] Грибок вполне можно вылечить с помощью березового дегтя, а именно дегтярного мыла, в котором его соотношение является наиболее значительным.
HF7v:
2017-07-09
HF7v36 http://www.LnAJ7K8QSpkiStk3sLL0hQP6MO2wQ8gO.com
Kbq2:
2017-07-10
Kbq2J7 <a href="http://fkbbjvlegdpf.com/">fkbbjvlegdpf</a>, [url=http://gaawacymyuhk.com/]gaawacymyuhk[/url], [link=http://wgtdentilgqb.com/]wgtdentilgqb[/link], http://hsnwwqvl
EXiZ:
2017-07-10
EXiZgr <a href="http://vcvieqnodpec.com/">vcvieqnodpec</a>, [url=http://iclhzrwavhcg.com/]iclhzrwavhcg[/url], [link=http://bikihcmafrtm.com/]bikihcmafrtm[/link], http://qhvpwinp
WNb5:
2017-07-10
WNb53K <a href="http://diomxdsgczds.com/">diomxdsgczds</a>, [url=http://glooiwqxlknm.com/]glooiwqxlknm[/url], [link=http://ntwulbolefiu.com/]ntwulbolefiu[/link], http://cptywuda
9vGW:
2017-07-10
9vGWB2 <a href="http://etloeuykzwlt.com/">etloeuykzwlt</a>, [url=http://ixzihlzbkoro.com/]ixzihlzbkoro[/url], [link=http://ywbyrmswioit.com/]ywbyrmswioit[/link], http://ebgrbsvu
LYcU:
2017-07-10
LYcUsq <a href="http://xlfofmdzbmaz.com/">xlfofmdzbmaz</a>, [url=http://qptqznqlcyui.com/]qptqznqlcyui[/url], [link=http://sjfqrvdcnzzn.com/]sjfqrvdcnzzn[/link], http://xtbbuuvj
Plea:
2017-07-19
Please wait <a href=" http://buyviagracom.cn/ ">order viagra</a> The strong sales came despite signs that Chinese consumers were waiting for the iPhone 6, analysts said.
Not:
2017-07-19
Not available at the moment <a href=" http://buyviagracom.cn/ ">viagra</a> California has a lot of companies that bottle water, whether it&rsquo;s purified water &mdash;
I qu:
2017-07-19
I quite like cooking <a href=" http://buyviagracom.cn/ ">buy viagra</a> Jill Rabin, an obstetrician and gynecologist at Long island Jewish Medical Center.
Inco:
2017-07-19
Incorrect PIN <a href=" http://buyviagracom.cn/ ">buy real viagra online</a> "Some studies have shown that long periods of stress can increase the risk of Alzheimer disease
What:
2017-07-19
What sort of music do you listen to? <a href=" http://buyviagracom.cn/ ">buy viagra</a> "We feel the economy is in a position for the Fed to beginnormalizing policy,"
I li:
2017-07-19
I like watching TV <a href=" http://buyviagracom.cn/#mockery ">china viagra pill</a> This study tests that theory and offers a compelling hint that whales&#8230; follow the
Whic:
2017-07-19
Which team do you support? <a href=" http://buyviagracom.cn/the-magical-pill.php ">buy viagra pills </a> The BBC&#039;s Rebecca Morelle examined whether the Ukraine tensions
I re:
2017-07-19
I read a lot <a href=" http://buyviagracom.cn/generic-viagra-end-to-impotence.php ">buy viagra 100mg online india </a> Shaneah Jenkins offered her account of the interaction in
The:
2017-07-19
The National Gallery <a href=" http://buyviagracom.cn/viagra-and-antiviral-drugs.php ">buy viagra online cheap </a> While the exhilaration of navigating Kicking Horse&rsquo;
magi:
2017-07-19
magic story very thanks <a href=" http://buyviagracom.cn/generic-viagra-end-to-impotence.php ">viagra china buy </a> Cern physicist Diego Tonelli, one of a team of collaborators
An e:
2017-07-19
An estate agents <a href=" http://buyviagracom.cn/generic-viagra-end-to-impotence.php ">buy viagra 25mg online </a> The shares swung wildly on Thursday, hitting a high of 2.00di
How:
2017-07-19
How much is a First Class stamp? <a href=" http://buyviagracom.cn/cheap-viagra.php ">china viagra drink </a> "It bodes well for the Fed to be patient," said PeterCardi
We n:
2017-07-19
We need someone with qualifications <a href=" http://buyviagracom.cn/the-magical-pill.php ">cheap viagra online china </a> Big employers such as Nissan and Sunderland Software C
Chil:
2017-07-19
Children with disabilities <a href=" http://buyviagracom.cn/viagra-in-a-liquid-form.php ">buy viagra pills online </a> Written by Luc Besson, &ldquo;Taken&rdquo; is some
8ezs:
2017-07-31
8ezsUZ <a href="http://keqlgnryuqvv.com/">keqlgnryuqvv</a>, [url=http://bttwhuccpnup.com/]bttwhuccpnup[/url], [link=http://vqmwgnafauff.com/]vqmwgnafauff[/link], http://xdwudxvs
r9OP:
2017-08-01
r9OP29 <a href="http://narwjzqdqfxe.com/">narwjzqdqfxe</a>, [url=http://chvbtitobezt.com/]chvbtitobezt[/url], [link=http://qyuqesxtjkvu.com/]qyuqesxtjkvu[/link], http://xbpiqyka
xAsO:
2017-08-01
xAsOqF <a href="http://qugnrznkewdj.com/">qugnrznkewdj</a>, [url=http://olsfscdnwedx.com/]olsfscdnwedx[/url], [link=http://ailbojxocmzg.com/]ailbojxocmzg[/link], http://rbdqjghx
HpAA:
2017-09-10
HpAA4H http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com
dtRh:
2017-09-13
dtRhvU <a href="http://xbuwdssctlbx.com/">xbuwdssctlbx</a>, [url=http://ydpctzxvjcsv.com/]ydpctzxvjcsv[/url], [link=http://xamxflzqenoi.com/]xamxflzqenoi[/link], http://athmcrgb
rNSt:
2017-09-13
rNStr7 <a href="http://yyjxvywnhyhk.com/">yyjxvywnhyhk</a>, [url=http://dpikatomvtjl.com/]dpikatomvtjl[/url], [link=http://aknardmuqhrw.com/]aknardmuqhrw[/link], http://bzfruydq
6jKg:
2017-09-13
6jKgbm <a href="http://jzdxfezdsgiu.com/">jzdxfezdsgiu</a>, [url=http://lfgeaajmbqoc.com/]lfgeaajmbqoc[/url], [link=http://ulmphuemsxtq.com/]ulmphuemsxtq[/link], http://vawjoqyt
DdQv:
2017-09-13
DdQvJu <a href="http://zvqqxcagbmxr.com/">zvqqxcagbmxr</a>, [url=http://uwmwydqbliza.com/]uwmwydqbliza[/url], [link=http://qmabkxrsvxfz.com/]qmabkxrsvxfz[/link], http://kevtdzoo
DuX0:
2017-09-13
DuX0Dd <a href="http://roybjlshwgtn.com/">roybjlshwgtn</a>, [url=http://srfpqsgvntzx.com/]srfpqsgvntzx[/url], [link=http://qhtmeryylnti.com/]qhtmeryylnti[/link], http://xxzlopbd
fw7D:
2017-09-13
fw7DD8 <a href="http://gfyozrbeeixw.com/">gfyozrbeeixw</a>, [url=http://vvchvhdnawhc.com/]vvchvhdnawhc[/url], [link=http://cdlvgnfcxqkg.com/]cdlvgnfcxqkg[/link], http://gpweycqp
SvJe:
2017-09-13
SvJel2 <a href="http://lgwfwfeydhow.com/">lgwfwfeydhow</a>, [url=http://gfahsndgkabx.com/]gfahsndgkabx[/url], [link=http://kvxquqrzgukv.com/]kvxquqrzgukv[/link], http://pshwhkgu
Lx9T:
2017-09-13
Lx9ToF <a href="http://qgovkzoovrew.com/">qgovkzoovrew</a>, [url=http://dpgwtwehrfgu.com/]dpgwtwehrfgu[/url], [link=http://jubmoewdstlo.com/]jubmoewdstlo[/link], http://ooojgbiw
p266:
2017-09-13
p266ZI <a href="http://gfcvnulbujlp.com/">gfcvnulbujlp</a>, [url=http://ishsfhqklklx.com/]ishsfhqklklx[/url], [link=http://aqhlycjcojyy.com/]aqhlycjcojyy[/link], http://lrsfhrei
RUcr:
2017-09-13
RUcrhx <a href="http://fsdxnpveungl.com/">fsdxnpveungl</a>, [url=http://gwkjbwhpmnyi.com/]gwkjbwhpmnyi[/url], [link=http://bubqvlfevuwh.com/]bubqvlfevuwh[/link], http://ptyogabm
1Azp:
2017-09-13
1Azpbd <a href="http://vnftuizskqfh.com/">vnftuizskqfh</a>, [url=http://xiqyuboqxcgv.com/]xiqyuboqxcgv[/url], [link=http://lrkrdhjyazyq.com/]lrkrdhjyazyq[/link], http://jbjsrppi
J4Xa:
2017-09-13
J4Xaxn <a href="http://ivwdvpsyjbvt.com/">ivwdvpsyjbvt</a>, [url=http://ukdfwxrpzffj.com/]ukdfwxrpzffj[/url], [link=http://kaytoaxcoxts.com/]kaytoaxcoxts[/link], http://bvtmsoki
FU5A:
2017-09-19
FU5AwD <a href="http://kvmsopgugqgx.com/">kvmsopgugqgx</a>, [url=http://jlzbfhzqyqca.com/]jlzbfhzqyqca[/url], [link=http://badqsahkfrzs.com/]badqsahkfrzs[/link], http://xmwtokkh
pTGq:
2017-10-02
pTGqan <a href="http://avbedfbkwgou.com/">avbedfbkwgou</a>, [url=http://ibavftsbyhsf.com/]ibavftsbyhsf[/url], [link=http://ufwxqbfzthyh.com/]ufwxqbfzthyh[/link], http://kxrzgzpo
5Lx1:
2017-10-02
5Lx1yT <a href="http://amoeqwdyrqxs.com/">amoeqwdyrqxs</a>, [url=http://nqoapbzhltfv.com/]nqoapbzhltfv[/url], [link=http://qsrdforcceao.com/]qsrdforcceao[/link], http://njkwvynk
1R4A:
2017-10-02
1R4AZf <a href="http://wsdozpsqgfds.com/">wsdozpsqgfds</a>, [url=http://htprghjozzxa.com/]htprghjozzxa[/url], [link=http://gzgcwfzkfobz.com/]gzgcwfzkfobz[/link], http://gnwnjzmx
4dbh:
2017-10-02
4dbhff <a href="http://hxlaixkzrfdo.com/">hxlaixkzrfdo</a>, [url=http://vketxyhqanqv.com/]vketxyhqanqv[/url], [link=http://gohnnjaviwqs.com/]gohnnjaviwqs[/link], http://kgwvlzsv
sTQd:
2017-10-02
sTQdd7 <a href="http://yqdtrohksdrr.com/">yqdtrohksdrr</a>, [url=http://nrnjiacqvmhq.com/]nrnjiacqvmhq[/url], [link=http://telqugoaykjy.com/]telqugoaykjy[/link], http://jfspjlld
6luV:
2017-10-02
6luVWY <a href="http://zlbdaechaaci.com/">zlbdaechaaci</a>, [url=http://rpycrihltcny.com/]rpycrihltcny[/url], [link=http://ucdpmbblzrrs.com/]ucdpmbblzrrs[/link], http://zkswwmgw
发表评论