How to setup openfire for local environment

hey guys, just wondering can i set up openfire to work locally with my android virtual device.
i have tried almost everything and cant seem to get it to connect

I haven’t tried Android VM, but as i’m able to connect to my local Openfireon VirtualBox Host from various VMs (Linux, Windows) it should be possible. You need to use a client on that Android VM, which will support putting IP address as host/domain and put your gateways IP (not sure how to check that IP on Android, on Windows i just run ipconfig and i see what IP is used for a gateway, how it reaches the host machine). But say Conversations android client doesn’t work that way as it wants a proper domain provided. But i think Xabber still supports that and some other clients.

Hello, thanks for the reply. I am currently using the smack client library which in facts does support a way to connect via xmppdomain and i can also set port to 5222. My problem is in the servser settings i do not know if upon registration i should put localhost as my xmppdomain name and also their is the full domoin name. I was wondering how to set up the server to work locally

I wouldn’t use ‘localhost’ as xmpp domain as it would create problems when trying to connect from virtual machine to that server. Personally i have named my test server same as my machine name (hostname), so clienta installed on the same machine work automatically with such name for the server. But in virtual machines i sill have to use IP to specify host to connect to.

Ok so let me reiterate to see if i understoos. Use my computer name as the xmppdomain and in the android app refer to the host in the app by the localhost ip adress instead of the name. Is that correct

Not exactly. I will tell how it works in my case and maybe you will understand how to do it on your end.

My Windows 7 PC has name “wroot”. When installing Openfire i have named my xmpp domain “wroot”. So if i run Spark or any other client on the same PC i just put “wroot” as Domain and it logs in normally. I also have VirtualBox installed on the same PC and have a number of Windows\Linux virtual machines.

When i run a virtual machine, i check its network configuration (say ipconfig on Windows, or ifconfig on Linux). It shows me that Default Gateway is 10.0.2.2. That is an IP of my main Windows 7 PC, but only as it is seen from inside the virtual machine. Because the real IP of my Windows 7 PC is 192.168.56.1. I’m not using Bridged network in VirtualBox, so my virtual machines can’t reach/use the real network and only operate in virtual network with 10.0.x.x subnet.

So, in a virtual machine if i run Spark or other client, i still put “wroot” as a Domain, but then i go to Advanced settings and put 10.0.2.2 as a host (right beside the 5222 port). Because otherwise this virtual machine won’t be able to find out what is the address of this wroot domain. I suppose you could do the same in Android VM with Smack library.

You can probably avoid using IP as a host, if you somehow add your local domain name into DNS available in your network. Say you can add it in your router (if you are using Bridged network in virtual environment), or you can edit hosts file in a virtual machine and add
domain IP_address
there, so this virtual machine will resolve domain name into an IP automatically, without having to put IP into host in the client.

1 Like

Wow thank you for the detailed information. You have answer all my questions here i should be able to figure it out from here. I was just really confused about the xmpp domain… well i do have one last question what do you put for the full domain… see you have the xmpp domqin and right below it there is the full domain name. Should i just put the pc name again

That’s fully qualified domain name of the server you have Openfire installed on. But it is only important in real setups when using DNS SRV records (SRV record would point queries for your xmpp domain on 5222 port to FQDN of your server, so clients would be pointed to the server hosting your xmpp domain). In your case you can have it the same as your xmpp domain.

Thank you brother for your time and help?you have saved me time and fustration

since you are already here can i ask you a quick questoin, you dont have to delve into details on it just a basic answer would do ill go about how to do it my self.
so lets say i have a chat app and its using the openfire server connected to a external mysql database (that is the approach/design am going for) will every person that download my app have to be register as a user in the openfire server to be able to chat and take advantage of the presence feature of xmpp.
also if this is true wont memory be an issue for the server.

As you have mentioned presence, then yes. To be able to have a presence and see presence of others you will have to have a registered user on the server. Every user will have some impact on server resources. But that depends on his behavior (how many contacts he/she has, how many messages and how big are sent, etc.). Openfire is a Java application, so it needs lots of RAM usually. If you plan to have many users, you should maybe look into clustering option with Hazelcast plugin. Although i think it is more designed for fault tolerance, than scaling.

Maybe not suited for you, but there is also an option to have anonymous login. Then there is no need to have users registered on the server. Like here http://www.igniterealtime.org/support/group_chat.jsp
You can login with any not used nickname and chat.

There is also a server to server option. Then users from other servers can say connect to a group chat on your server and chat, without you having any registered users.

So i plan to have a dating app with chat capabilites. Number of users is unknown and hopefully would be great one day since i do plan on it been on all 3 platforms, Mobile and web.
But cant i just store all my users only on the server and what ever messages while their on queue to be sent. And just use mysql to store any files if any.
Maybe i would just make a server for each platform then Connect those 3 servers idk. I only plan on using server memory for storing each user.

By memory you mean storage, not operating memory (hdd vs ram)? If you plan to save all conversation history on the server, then it can take some space (especially with thousands of users). But if you only plan to save offline messages for them to be delivered once a user gets online, then you will need much less space for that.

You can use one server for all platforms. Though you may have to do some integration if you want to use same users for registering and using your website and chatting via Openfire. You should look into integrated Auth provider in Openfire for that.

Not sure what you meant by storing files in mysql. File transfer in xmpp is done directly and is not storing files on the server. And in the case of Http file upload (which only works in group chat) it stores files in the temp folder of the operating system, not in DB.

Ok. When i installed openfire i see in the admin page their is a memory bar and i would think thats the memory assosicated with the server. But am not gonna keep bothering you brother again i really appreciate your guidance i now a good vision of how i want to implement this whole thing. Am gonna do my self a fqvor and read the documentation i dont keep on waisting your time. Again than you brother you are very appreciated

Not a problem :slight_smile: that bar shows JVM (java virtual machine) memory utilization. It is related to server’s memory (it can’t go higher than the actual memory server has) but not strictly. You may have 10 gigs of ram and JVM would only use very little of it by default. You should read on custom parameters in the installation guide on how to increase that value and of course only go with a 64 bit version.

Actually, it also works in one on one chats.