|
| 1 | +--- |
| 2 | +title: TAK Server Install CentOS |
| 3 | +author_profile: false |
| 4 | +toc: true |
| 5 | +toc_label: "Table of Contents" |
| 6 | +toc_icon: "cog" |
| 7 | +tags: tak atak |
| 8 | +categories: self-hosted atak tak |
| 9 | +header: |
| 10 | + teaser: /assets/images/pfSense.PNG |
| 11 | +--- |
| 12 | +# TAK Server Options |
| 13 | + |
| 14 | +There are two options to install TAK server. |
| 15 | + |
| 16 | +1. Install from source using the source code on [GitHub](https://github.com/TAK-Product-Center/Server) |
| 17 | +2. Download the .rpm/.deb files from [tak.gov](https://tak.gov/) |
| 18 | + |
| 19 | + |
| 20 | +# Install from Source |
| 21 | + |
| 22 | +Instructions for installing TAK Server on CentOS 7 |
| 23 | + |
| 24 | +## CentOS |
| 25 | +First you will need the [CentOS](http://isoredirect.centos.org/centos/7/isos/x86_64/) ISO (CentOS 7). Setup either a VM or install on baremetal. |
| 26 | + |
| 27 | +Follow the prompts on the install, be sure to enable your networking on the install screen, and also set the install to be "infrastructure server". |
| 28 | + |
| 29 | +Be sure to create an admin password and make the user you create an admin. |
| 30 | + |
| 31 | +## TAKServer |
| 32 | +Once your CentOS server is setup update the packages. |
| 33 | + |
| 34 | +```bash |
| 35 | +sudo yum update -y && sudo yum upgrade -y |
| 36 | +``` |
| 37 | + |
| 38 | +Then install |
| 39 | + |
| 40 | +```bash |
| 41 | +sudo yum install epel-release -y |
| 42 | +``` |
| 43 | + |
| 44 | + |
| 45 | +Make sure git is installed |
| 46 | + |
| 47 | +```bash |
| 48 | +sudo yum install git -y |
| 49 | +``` |
| 50 | + |
| 51 | +then clone the TakServer repo |
| 52 | + |
| 53 | +```bash |
| 54 | +git clone https://github.com/TAK-Product-Center/Server.git |
| 55 | +``` |
| 56 | + |
| 57 | +You will also need to make sure Java 11 is installed. (JDK & JRE) |
| 58 | + |
| 59 | +```bash |
| 60 | +sudo yum install java-11-openjdk-devel -y |
| 61 | +``` |
| 62 | + |
| 63 | + |
| 64 | +You will also need to install patch |
| 65 | + |
| 66 | + |
| 67 | +```bash |
| 68 | +sudo yum install patch -y |
| 69 | +``` |
| 70 | + |
| 71 | +As well as Postgres |
| 72 | + |
| 73 | + |
| 74 | +```bash |
| 75 | +sudo yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm -y |
| 76 | +``` |
| 77 | + |
| 78 | +Once those are installed you can build the project. |
| 79 | + |
| 80 | + |
| 81 | +## Build Project |
| 82 | + |
| 83 | +Navigate into the src directory and clean and build the project |
| 84 | + |
| 85 | +```bash |
| 86 | +cd Server/src |
| 87 | +./gradlew clean bootWar |
| 88 | +``` |
| 89 | + |
| 90 | +If that completes you are ready to move on. |
| 91 | + |
| 92 | +Run the following: |
| 93 | + |
| 94 | + |
| 95 | +```bash |
| 96 | +./gradlew clean buildRpm |
| 97 | +``` |
| 98 | + |
| 99 | +This will generate the rpm image for you. |
| 100 | + |
| 101 | + |
| 102 | +# Install from Downloaded .rpm |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | +The following steps are shared among the two approaches. |
| 107 | + |
| 108 | +# Install RPM |
| 109 | + |
| 110 | +Next navigate to the following directory |
| 111 | + |
| 112 | + |
| 113 | +```bash |
| 114 | +cd Server/src/takserver-package/build/distributions |
| 115 | +``` |
| 116 | + |
| 117 | +In here you should see the server rpm: |
| 118 | + |
| 119 | +`takserver-<version>-RELEASE<Number>.noarch.rpm` |
| 120 | + |
| 121 | +At the time of writing this my rpm is `takserver-4.5-RELEASE72.noarch.rpm` |
| 122 | + |
| 123 | +Run |
| 124 | + |
| 125 | +```bash |
| 126 | +sudo yum install takserver-4.5-RELEASE72.noarch.rpm |
| 127 | +``` |
| 128 | +to install the server. |
| 129 | + |
| 130 | + |
| 131 | +# Setup DB |
| 132 | + |
| 133 | +There is a db install script pre-made that you will have to run. |
| 134 | + |
| 135 | + |
| 136 | +```bash |
| 137 | +sudo ./opt/tak/db-utils/takserver-setup-db.sh |
| 138 | +``` |
| 139 | + |
| 140 | + |
| 141 | +# Reload Service |
| 142 | + |
| 143 | +After the db setup script is complete you can reload the services |
| 144 | + |
| 145 | +```bash |
| 146 | +sudo systemctl daemon-reload |
| 147 | +``` |
| 148 | + |
| 149 | +At this point you can set TAK Server to start at boot |
| 150 | + |
| 151 | +```bash |
| 152 | +sudo systemctl enable takserver |
| 153 | +```` |
| 154 | + |
| 155 | +# Certificates |
| 156 | + |
| 157 | +First you will have to become the `tak` user that is created. |
| 158 | + |
| 159 | +```bash |
| 160 | +sudo su tak |
| 161 | +``` |
| 162 | + |
| 163 | +Then create env variables: |
| 164 | +```bash |
| 165 | +export STATE=NY |
| 166 | +export CITY=NYC |
| 167 | +export ORGANIZATION=my-organizaton |
| 168 | +export ORGANIZATIONAL_UNIT=my-unit |
| 169 | +``` |
| 170 | + |
| 171 | +Navigate to |
| 172 | +```bash |
| 173 | +/opt/tak/certs/ |
| 174 | +``` |
| 175 | + |
| 176 | +Then run |
| 177 | +```bash |
| 178 | +./makeRootCa.sh |
| 179 | +``` |
| 180 | + |
| 181 | +Give a name for your CA: example-name |
| 182 | + |
| 183 | +Create a server certificate: |
| 184 | + |
| 185 | +```bash |
| 186 | +./makeCert.sh server takserver |
| 187 | +``` |
| 188 | + |
| 189 | + |
| 190 | +## Client Certs |
| 191 | + |
| 192 | +For each client that you want on your network copy the following command and change `user` to the user you want to add: ex -> `Alpha`. |
| 193 | + |
| 194 | +```bash |
| 195 | +./makeCert.sh client <user> |
| 196 | +``` |
| 197 | + |
| 198 | +## Admin UI Cert |
| 199 | + |
| 200 | +Generate an admin cert to gain access to the admin UI. |
| 201 | + |
| 202 | +```bash |
| 203 | +./makeCert.sh client admin |
| 204 | +``` |
| 205 | + |
| 206 | + |
| 207 | +## Reload |
| 208 | + |
| 209 | +After you have created the certs restart the TAK Server. |
| 210 | + |
| 211 | +```bash |
| 212 | +sudo systemctl restart takserver |
| 213 | +``` |
| 214 | + |
| 215 | +Then authorize the admin cert. |
| 216 | + |
| 217 | +```bash |
| 218 | +sudo java -jar /opt/tak/utils/UserManager.jar certmod -A /opt/tak/certs/files/admin.pem |
| 219 | +``` |
| 220 | + |
| 221 | + |
| 222 | +Also, the generated CA trustores and certs will be here: |
| 223 | + |
| 224 | +```bash |
| 225 | +/opt/tak/certs/files |
| 226 | +``` |
| 227 | + |
| 228 | + |
| 229 | + |
| 230 | +# Firewall |
| 231 | +Setup the following firewall rules: |
| 232 | +```bash |
| 233 | +sudo firewall-cmd --permanent --zone=public --add-port 8089/tcp |
| 234 | +sudo firewall-cmd --permanent --zone=public --add-port 8443/tcp |
| 235 | +sudo firewall-cmd --reload |
| 236 | +``` |
| 237 | + |
| 238 | +After reloading the firewall check that the ports are opened by running: |
| 239 | + |
| 240 | +`sudo firewall-cmd --list-ports` |
| 241 | + |
| 242 | +The output should look like this |
| 243 | +``` |
| 244 | +8089/tcp 8443/tcp |
| 245 | +``` |
| 246 | +
|
| 247 | +# Web UI |
| 248 | +
|
| 249 | +In order to access the webUI you will need to download the admin certificate that you created in the previous step. |
| 250 | +
|
| 251 | +You can do this a number of ways. |
| 252 | +
|
| 253 | +1. SFTP |
| 254 | +2. SCP |
| 255 | +3. FileZilla |
| 256 | +
|
| 257 | +
|
| 258 | +Choose whichever is best for you. |
| 259 | +The file you are looking for is here: |
| 260 | +
|
| 261 | +`/opt/tak/certs/files/admin.p12` |
| 262 | +
|
| 263 | +Once you have this cert you will have to import it in your browser. |
| 264 | +
|
| 265 | +Firefox: |
| 266 | +Settings -> Preferences -> Privacy & Security -> Certificates -> View Certificates |
| 267 | +
|
| 268 | +Select `Your Certificates` and import the downloaded cert. |
| 269 | +
|
| 270 | +The password is `atakatak` |
| 271 | +
|
| 272 | +Then navigate to: |
| 273 | +
|
| 274 | +`https://yourip:8443/` |
| 275 | +
|
| 276 | +
|
| 277 | +## (Optional) Create Admin Credentials |
| 278 | +
|
| 279 | +Create Login Credentials for local admin account: |
| 280 | +``` |
| 281 | +sudo java -jar /opt/tak/utils/UserManager.jar usermod -A -p <password> <username> |
| 282 | +``` |
| 283 | +
|
| 284 | +
|
| 285 | +# Setup Wizard |
| 286 | +
|
| 287 | +Secure: https://yourip:8443/setup/ |
| 288 | +
|
| 289 | +Insecure with user/pass: http://yourip:8080/setup |
| 290 | +
|
| 291 | +
|
| 292 | +# Other Configurations |
| 293 | +
|
| 294 | +After running through the wizard you may want to disable port 8080. |
| 295 | +
|
| 296 | +```bash |
| 297 | +sudo nano /opt/tak/CoreConfig.xml |
| 298 | +``` |
| 299 | + |
| 300 | +then remove |
| 301 | +``` |
| 302 | +<connector port="8080" tls="false" _name="http_plaintext"/> |
| 303 | +``` |
| 304 | + |
| 305 | +save the changes and restart tak server. |
| 306 | + |
| 307 | +```bash |
| 308 | +sudo systemctl restart takserver |
| 309 | +``` |
| 310 | + |
0 commit comments