Multicraft 搭建教程

第一步

  • 准备一台安装了Centos 7 的服务器,具体配置看你需求。
  • Xshell 以及 Xftp 用来连接SSH和传输文件。

第二步

用Xshell连接到你的服务器;

回车->输入账号(默认root)->输入密码(云服务商处获取默认密码)

连接完成界面

第三步

更换为国内的YUM源

cd /etc/yum.repos.d/   
yum -y install weget   #安装wegt
wget http://mirrors.aliyun.com/repo/Centos-7.repo   #下载阿里云YUM源
mv Centos-7.repo CentOs-Base.repo
yum clean all  #清楚YUM缓存
yum makecache  #生成新缓存

关闭防火墙

 systemctl stop firewalld
 systemctl disable firewalld

升级系统

yum -y update

禁用SElinux

yum -y install vim   #安装vim
vim /etc/selinux/config  #编辑selinux配置文件
将SELINUX=enforcing改为SELINUX=disabled 
reboot   #重启服务器

第四步

搭建MySQL

wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm   #下载MySQL
yum localinstall mysql57-community-release-el7-8.noarch.rpm
yum -y install mysql-community-server   #安装MySQL
systemctl start mysqld   #启动MySQL
systemctl enable mysqld   #设置MySQL自启
systemctl daemon-reload

修改MySQL默认密码

grep "password" /var/log/mysqld.log
A temporary password is generated for root@localhost: xxxxxxxx   #xxxx就是你的默认密码

登陆数据库

mysql -uroot -p
Enter password: xxxxxxxx   #你的默认密码
set password for 'root'@'localhost'=password('你的密码'); #修改密码
create database 数据库名;   #创建数据库
exit   #退出MySQL

Multicraft安装环境搭建

yum -y install httpd php php-common php-gd php-mbstring php-ldap php-odbc php-pear php-xml php-xmlrpc php-bcmath php-mysql php-pdo wget vim tar zip curl java-1.8.0-openjdk
wegt http://dl.mcbar.cc/2.2.1/multicraft-2.2.1-64.tar.gz -O multicraft.tar.gz   #下载multicraft
tar -zxvf multicraft.tar.gz   #解压multicraft
cd multicraft   #进入multicraft目录
./setup.sh   #执行安装程序

安装过程

*** Welcome to Multicraft!
This installer will help you get Multicraft up and running.
No changes are made to the system until all of the required information has been collected.
NOTE: This script automates the installation as described on the Multicraft website. Use it at your own risk.
Run each Minecraft server under its own user? (Multicraft will create system users): [y]/n  (y)
Run Multicraft under this user: [minecraft]  (回车)
User not found. Create user 'minecraft' on start of installation? [y]/n (y)
Install Multicraft in: [/home/minecraft/multicraft]  (回车)
If you have a license key you can enter it now: [no]   (回车)
If you control multiple machines from one web panel you need to assign each daemon a unique number (requires a Dynamic or custom license). Daemon number? [1]   (回车)
Will the web panel run on this machine? [y]/n   (y)
User of the webserver: [apache] (回车)
Location of the web panel files: [/var/www/html/multicraft] (/var/www/html)
Please enter a new daemon password (use the same password in the last step of the panel installer) [none] (如果密码无法输入,可在网页安装界面输入)(回车)
Enable builtin FTP server? [y]/n (y)
IP the FTP server will listen on (0.0.0.0 for all IPs): [123.xxx.xx.xxx] (0.0.0.0)
IP to use to connect to the FTP server (external IP): [123.xxx.xx.xxx] (你的服务器ip)
FTP server port: [21] (回车)
Block FTP upload of .jar files and other executables (potentially dangerous plugins)? [n]/y (n)
What kind of database do you want to use? [sqlite]/mysql  (mysql)
Database host: [127.0.0.1] (回车)
Database name: [multicraft_daemon] (你之前设置的数据库名)
Database user: [root] (回车)
Database password: [] (数据库密码)
Path to unzip program: [/usr/bin/unzip] (回车)
Ready to install Multicraft. Start installation? [y]/n (y)
安装过程省略....
Press [Enter] to continue.  (回车)
Save entered settings? ([y]/n)  (y)
IMPORTANT: Make sure this file is not accessible by unauthorized users.  #安装完成

网页服务器配置

systemctl start httpd   #启动httpd
chown -R apache.apache /var/www/html   #设置访问权限
awk '/AllowOverride None/{c++;if(c==2){sub("AllowOverride None","AllowOverride All");c=0}}1' /etc/httpd/conf/httpd.conf > /tmp/httpd.conf; mv -f /tmp/httpd.conf /etc/httpd/conf/httpd.conf   #允许.htaccess重写
systemctl enable httpd   #设置开机启动httpd
systemctl restart httpd   #重启httpd

网页配置
在浏览器地址栏输入你的服务器ip

点击 Start Installation 进行最后的配置

全部通过 没有报错 即可进入下一步

点击 Continue

点击 Initialize Database

输入你的数据库名字和密码

输入完成点击 Save 保存 ,点击 Continue 进行下一步

默认的面板账号密码 admin  and  admin,点击 Login 进行登陆

登陆完成再次输入数据库账密 点击 Save 保存

点击 Initialize Database 初始化数据库

在 Password for Deamon connections 一行写入密码 你的密码 后,点击‘Save’保存,进入最后一步.

启动Deamon

/home/minecraft/multicraft/bin/multicraft start


点击 Refresh 刷新 Deamon 状态后点击 Continue ,进入下页,会提示为了安全起见,删除 install.php,该文件路径:/var/www/html/install.php

rm -rf /var/www/html/install.php   #删除安装文件

点击 Continue to Multicraft 进入主页
安装完成,教程结束

本文部分内容来自:哔哩哔哩专栏
Multicraft
国内 Multicraft 正版代理 https://mu.zxda.net/

Multicraft
当你没有密钥时,你仅可以搭建一个10人服务器

3条评论

  1. 请问博主,httpd和php没有yum包怎么办。我是一个真正的新手。希望博主有时间是可以教教我,谢谢您

    1. 请问你更换yum源了吗?如果自带的yum源没有httpd和php的话,可以安装epel源,执行yum install epel-release(安装epel) , yum clean all(清理缓存) , yum makecache(重建缓存)

      1. 谢谢,已经用宝塔面板搞定了。但是我很奇怪为什么我安装了epel源之后还是找不到。现在我按照教程安装了以后,我一直打不开,只有一个403的错误提示|´・ω・)ノ

评论已关闭。