Вы находитесь на странице: 1из 8

Tutorial Openfire & Spark

Step 1. Login ke terminal (ctrl + alt + T) sebagai root dan update semua package
user@server:~$sudo i
[sudo] password for user:
root@server:~#apt-get update
root@server:~#apt-get upgrade

Step 2. Install Apache dan MariaDB


root@server:~#apt-get install apache2 mariadb-server libapache2-mod-php5
root@server:~#apt-get install php5-gd php5-json php5-mysql php5-curl
root@server:~#apt-get install php5-intl php5-mcrypt php5-imagick

Step 3. Konfigurasi MariaDB / MySQL


root@server:~# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):


OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] y


New password:
Re-enter new password:
Password update successfully!
Reloading privilege table..
... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone


to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y


... Success!

Normally, root should only be allowed to connect from 'localhost'. This


ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y


... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y


- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

root@server:~# mysql -u root p


Enter password:

Welcome to the MariaDB monitor. Commands end with ; or \g.


Your MariaDB connection id is 50
Server version: 10.0.20-MariaDB-0ubuntu0.15.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE USER 'adminuser'@'localhost' IDENTIFIED BY 'adminpass';


Query OK, 4 rows affected (0.00 sec)

MariaDB [(none)]> CREATE DATABASE openfiredb;


Query OK, 4 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL ON openfiredb.* TO 'adminuser'@'localhost';


Query OK, 4 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;


Query OK, 4 rows affected (0.00 sec)

MariaDB [mysql]> exit


Bye

Step 4. Installing JAVA


root@server:~# apt-get install openjdk-7-jre

Step 5. Installing Openfire


root@server:/home/user# chmod +x openfire_3_9_3.tar.gz
root@server:/home/user# tar xvzf openfire_3_9_3.tar.gz C /opt/
root@server:/home/user# cd /opt/openfire/conf
root@server:/opt/openfire/conf# nano openfire.xml

<?xml version="1.0" encoding="UTF-8"?>


<!--
This file stores bootstrap properties needed by Openfire.
Property names must be in the format: "prop.name.is.blah=value"
That will be stored as:
<prop>
<name>
<is>
<blah>value</blah>
</is>
</name>
</prop>

Most properties are stored in the Openfire database. A


property viewer and editor is included in the admin console.
-->
<!-- root element, all properties must be under this element -->
<jive>
<adminConsole>
<!-- Disable either port by setting the value to -1 -->
<port>9090</port>
<securePort>9091</securePort>
</adminConsole>

<locale>en</locale>

<!-- Network settings. By default, Openfire will bind to all network interfaces.
Alternatively, you can specify a specific network interfaces that the server
will listen on. For example, 127.0.0.1. This setting is generally only useful
on multi-homed servers. -->

<network>
<interface>192.168.153.74</interface>
</network>
</jive>

root@server:/opt/openfire/conf# /opt/openfire/bin/openfire start


root@server:/opt/openfire/conf# ufw allow 9090/tcp
root@server:/opt/openfire/conf# ufw allow 9091/tcp
root@server:/opt/openfire/conf# ufw allow 5222/tcp
root@server:/opt/openfire/conf# ufw allow 7777/tcp
root@server:/opt/openfire/conf# ufw allow 7443/tcp
root@server:/opt/openfire/conf# ufw allow 7070/tcp
root@server:/opt/openfire/conf# ufw allow 3478/tcp
root@server:/opt/openfire/conf# ufw allow 3479/tcp

Masuk browser, masuk pada alamat http://localhost:9090 atau http://<ip-server>:9090


Pilih Language  Continue
Isi Domain (exp : mayora.co.id)

Pilih Standart Database Connection  Continue


Database Driver Presets : MySQL
JDBC Driver Clas : com.mysql.jdbc.Driver
Database URL : jdbc:mysql://localhost:3306/openfiredb (openfiredb 
database di MySQL)
Username : adminuser (username MySQL)
Password : ******(password MySQL)
Minimum Connections : 5
Maximum Connections : 25
Connection Timeout : 1.0
 Continue

Pilih Default  Continue


Isi data admin  Continue

Login Openfire
Username : admin
Password : ***** (password yang sudah diinput di Administrator Account)
Create User Openfire
Users/Groups  Create New User

Isi data user  Create User


Agar saat startup service mysql & openfire langsung running dapat lakukan 2 hal dbi :

Cara pertama :
root@server:/opt#gedit /etc/rc.local

~~Isi Scrip~~
#! /bin/ bash
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure que the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/opt/lampp/lampp start
exit 0

root@server:/opt#reboot

Cara kedua :
root@server:/opt#gedit /etc/init.d/openfire (openfire diisi nama sesuai selera)

~~Isi Scrip~~
sudo /opt/lampp/xampp start
sudo /opt/openfire/bin/openfire start

root@server:/opt#chmod +x /etc/init.d/openfire
root@server:/opt#update-rc.d openfire default
root@server:/opt#reboot

Step 6. Installing Spark


Install spark di pc, lalu isi data :
Username : Sesuai username yang sudah dicrate pada openfire
Password : Sesuai password yang sudah dicrate pada openfire
Server : Isi IP pc yang dijadikan server

Вам также может понравиться