| | 142 | === MySQL === |
| | 143 | |
| | 144 | 1. In the sql table of auth_user add a user with email "chat_admin@example.com" , username "chat_admin_example.com" and password of your choice(having alphanumeric characters). |
| | 145 | {{{ |
| | 146 | w2p |
| | 147 | db.auth_user.insert(email="chat_admin@example.com", username="chat_admin_example.com", password="changeme", first_name="Chat") |
| | 148 | db.commit() |
| | 149 | }}} |
| | 150 | |
| | 151 | 2. Open Openfire console http://servname:7070. Go to System Properties and set the following properties. |
| | 152 | |
| | 153 | Change: |
| | 154 | * provider.auth.className to org.jivesoftware.openfire.auth.JDBCAuthProvider |
| | 155 | * provider.user.className to org.jivesoftware.openfire.user.JDBCUserProvider |
| | 156 | |
| | 157 | Add (if some property names are already present modify them to the given values): |
| | 158 | * jdbcProvider.driver : org.postgresql.Driver |
| | 159 | * jdbcProvider.connectionString : jdbc:postgresql://localhost:5432/<sahana database name>?user=<sql_username>&password=<sql_password> |
| | 160 | * jdbcAuthProvider.passwordSQL : select password from auth_user where username=? |
| | 161 | * jdbcAuthProvider.passwordType : plain |
| | 162 | * jdbcUserProvider.loadUserSQL : select first_name,email from auth_user where username=? |
| | 163 | * jdbcUserProvider.userCountSQL : select count(*) from auth_user |
| | 164 | * jdbcUserProvider.allUsersSQL : select username from auth_user |
| | 165 | * jdbcUserProvider.searchSQL : select username from auth_user where |
| | 166 | * jdbcUserProvider.usernameField : username |
| | 167 | * jdbcUserProvider.emailField : email |
| | 168 | * jdbcUserProvider.nameField : first_name |
| | 169 | * admin.authorizedJIDs: choose a username from the user database and put it here e.g. chat_admin_example.com@<servername> |
| | 170 | |
| | 171 | 3. Restart the Openfire server. |
| | 172 | {{{ |
| | 173 | sudo /opt/openfire/bin/openfire restart |
| | 174 | }}} |