1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
|
## Introduction
The AzerothCore bash dashboard is a collection of scripts that help with the installation and maintenance of an AzerothCore server.
It allows to easily install, update and execute AzerothCore on your machine in a tremendously small amount of steps.
Installing a development or production private server has never been so easy before.
If you need any help just [ask a question](https://www.azerothcore.org/wiki/How-to-ask-for-help).
## Requirements
You need to have [git](https://git-scm.com/), [curl](https://curl.se/), [unzip](https://github.com/madler/unzip), [sudo](https://www.sudo.ws/) installed in your machine.
No other software is required to be installed manually.
- debian/ubuntu-based: `apt update && apt install git curl unzip sudo`
- macOS: `brew install git`
- Windows: download and install [Git for Windows](https://gitforwindows.org/)
### Notes
- For macOS users: install and use the latest version of bash to run the commands of the dashboard (`brew install bash`)
- For Windows users: the commands need to be executed within the "git bash" shell or a bash-compatible shell such as WSL, cygwin etc..
However, git bash is suggested because is preinstalled with git for windows (one of our requirements)
## Setup
### Get the AC sources
```
git clone https://github.com/azerothcore/azerothcore-wotlk.git; cd azerothcore-wotlk
```
### Configuration
There is a [conf/dist/config.sh](https://github.com/azerothcore/azerothcore-wotlk/blob/master/conf/dist/config.sh)
file containing a default configuration. Have a look at it.
Most of the configuration defaults will probably work for your case,
but you can copy it under `conf/config.sh` and change values as you please.
### Install all AC dependencies
```
./acore.sh install-deps
```
NOTE: on Windows it must be executed as an administrator
### Build everything from scratch
```
./acore.sh compiler all
```
### Set-up the database
- Either connect to your MySQL database (with `sudo mysql -u root`) and manually create the `acore` MySQL user by running:
```
DROP USER IF EXISTS 'acore'@'localhost';
DROP USER IF EXISTS 'acore'@'127.0.0.1';
CREATE USER 'acore'@'localhost' IDENTIFIED BY 'acore';
CREATE USER 'acore'@'127.0.0.1' IDENTIFIED BY 'acore';
GRANT ALL PRIVILEGES ON * . * TO 'acore'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON * . * TO 'acore'@'127.0.0.1' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit;
```
*Note: even though the `acore` user is only accessible from localhost,
it is a good practice to change its password to something more secure.*
### Download the latest client data
Get the latest client data:
```
./acore.sh client-data
```
### Server config files
create these 2 files. They contain the default configuration for the worldserver and authserver, if you don't wish to modify simply copying them is enough.
#### Linux and Mac
```
cp env/dist/etc/authserver.conf.dist env/dist/etc/authserver.conf
cp env/dist/etc/worldserver.conf.dist env/dist/etc/worldserver.conf
```
#### Windows and Mac
```
cp env/dist/configs/authserver.conf.dist env/dist/configs/authserver.conf
cp env/dist/configs/worldserver.conf.dist env/dist/configs/worldserver.conf
```
### Result
If you followed the above, you'll get your server inside the `env/dist` directory.
The `worldserver` and `authserver` binaries are located in `azerothcore-wotlk/env/dist/bin`.
You can either run them directly or use the restarter (see below).
The first startup of the `worldserver` will install a full AzerothCore Database. No need to import any DB update at this point.
### Restarter
The AzerothCore dashboard comes with a bundled restarter suite:
```
./acore.sh run-worldserver
```
Wait until the process is completed then run:
```
./acore.sh run-authserver
```
For dedicated servers,
you may want to run them inside terminal multiplexer sessions using tools like `tmux` (see below).
## How to update your server
Update the sources:
```
git pull
```
Rebuild:
```
./acore.sh compiler build
```
Update the database:
[https://www.azerothcore.org/wiki/database-keeping-the-server-up-to-date](https://www.azerothcore.org/wiki/database-keeping-the-server-up-to-date)
That's it.
## Tips for dedicated (production) servers
### Daily backups of your databases via Telegram
Getting daily backups of your private server databases directly to your phone/computer
via [Telegram](https://telegram.org/) messages?
Yes, that's possible. Just use: [azerothcore/telegram-automated-db-backup](https://github.com/azerothcore/telegram-automated-db-backup)
### Visual Studio Code SSH
You can easily install AzerothCore in a linux server without any kind of GUI,
simply connecting remotely via ssh using [Visual Studio Code](https://code.visualstudio.com/)
and the [SSH](https://code.visualstudio.com/docs/remote/ssh)
and the [SSH: Editing Configuration Files](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh-edit) extensions so you'll feel just like at home.
### Run AzerothCore inside Tmux sessions
You can use [tmux](https://github.com/tmux/tmux) as terminal multiplexer,
it will allow you to easily manage your processes inside a server with no GUI.
You can create 2 sessions and run the `worldserver` and `authserver` processes inside them:
- `tmux new -s world-session`
- now run the `./acore.sh run-worldserver` inside it, then detach from it
- `tmux new -s auth-session`
- now run the `./acore.sh run-authserver` inside it, then detach from it
You can detach using `CTRL+B+D` to exit the session without killing the process.
If connected using VSCode SSH, you can just close the terminal session.
You can attach again to the `world-session` session using:
- `tmux attach -t world-session`
Other useful commands:
- create a new session: `tmux new -s my_session`
- list all sessions: `tmux ls`
- kill a session: `tmux kill my_session` (or just attach to it and type `exit`)
- kill ALL sessions: `tmux kill-server`
- ...more details available at the [tmux wiki](https://github.com/tmux/tmux/wiki)
### Automatically start the tmux sessions at system startup
You can automatically create the tmux sessions and execute the `authserver` and `worldserver` using this simple script:
```sh
#!/usr/bin/env bash
# CHANGE THESE WITH THE CORRECT PATHS
authserver="/path/to/azerothcore-wotlk/acore.sh run-authserver"
worldserver="/path/to/azerothcore-wotlk/acore.sh run-worldserver"
authserver_session="auth-session"
worldserver_session="world-session"
if tmux new-session -d -s $authserver_session; then
echo "Created authserver session: $authserver_session"
else
echo "Error when trying to create authserver session: $authserver_session"
fi
if tmux new-session -d -s $worldserver_session; then
echo "Created worldserver session: $worldserver_session"
else
echo "Error when trying to create worldserver session: $worldserver_session"
fi
if tmux send-keys -t $authserver_session "$authserver" C-m; then
echo "Executed \"$authserver\" inside $authserver_session"
echo "You can attach to $authserver_session and check the result using \"tmux attach -t $authserver_session\""
else
echo "Error when executing \"$authserver\" inside $authserver_session"
fi
if tmux send-keys -t $worldserver_session "$worldserver" C-m; then
echo "Executed \"$worldserver\" inside $worldserver_session"
echo "You can attach to $worldserver_session and check the result using \"tmux attach -t $worldserver_session\""
else
echo "Error when executing \"$worldserver\" inside $worldserver_session"
fi
```
On unix systems, you can then use [crontab](https://en.wikipedia.org/wiki/Cron)
to run the script automatically at system startup:
```
crontab -e
```
then add this line (replace `/path/to/startup.sh` with the path of where you placed the above script):
```
@reboot /bin/bash /path/to/startup.sh
```
|