2015年7月3日 星期五

Create Your Own Jabber-Based Server That Works With iChat or Any Jabber Client

iChat Server - Create Your Own Jabber Server

We're going to use Openfire, an open source, real-time collaboration server. It uses XMPP (Jabber) for its instant messaging system, and it works out of the box with the native iChat client, as well as many other Jabber-based messaging clients. Photo Credit: Screen capture courtesy of Coyote Moon Inc.
If you use iChat, you probably already know that it has built-in support for Jabber-based messaging. That's the same messaging scheme used by Google Talk and many other similar services. Jabber uses an open source protocol called XMPP to initiate and talk with messaging clients. The upshot of an open source framework is that it makes it very easy to run your own Jabber server on your Mac.

Why Use Your Own Jabber-Based iChat Server?

There are many reasons to use your own Jabber server to allow iChat messaging:
First-Aid Kit for your Mac Keep your Mac Clean. Try Now!
24/12/8 UP Server Nodes in 3U 24x2.5" SATA3 HDDs, 48x2.5" SSDs
MacKeeper - 即刻清理 Mac。 确保 Mac 安全。
  • You control who can connect to the service.
  • You can create a secure messaging system.
  • Keep all messaging communications in-house.
  • Easy cross-platform messaging.
  • You like to fiddle with your Mac and having a Jabber Server sounds cool.
There are actually many other reasons, especially for larger companies that use messaging systems, but for the majority of users, creating a Jabber server comes down to the security of knowing that your home or small business iChat messages aren't accessible to outside eyes.
That doesn't mean you're creating a closed environment. The Jabber server you create in this guide can be configured for in-house use only, open to the Internet, or just about anything in-between. But even if you choose to open your Jabber server to Internet connections, you can still use various security measures to encrypt and keep your messaging private.
With the background out of the way, let's get started.
There are various Jabber server applications available. Many require you to download source code, and then compile and make the server application yourself.
Others are ready to go, with very simple installation instructions.
We're going to use Openfire, an open source, real-time collaboration server. It uses XMPP (Jabber) for its instant messaging system, and it works out of the box with the native iChat client, as well as many other Jabber-based messaging clients.
Best of all, it's a simple installation that isn't much different than installing any other Mac application. It also uses a web-based interface for configuring the server, so there are no text files to be edited or managed.

What You Need to Create a Jabber Server

  • Openfire real-time collaborative server.
  • An Intel-based Mac.
  • About a half hour of your time.
2 of 4

iChat Server - Installation and Setup of the Openfire Jabber Server

The Openfire server will work whether or not you set up email. But as the Openfire administrator, it's a good idea to be able to receive notifications if a problem should ever arise. Photo Credit: Screen capture courtesy of Coyote Moon Inc.
We chose Openfire for our Jabber server because of its ease of installation, web-based configuration, and adherence to standards that let us create a cross-platform server. To get started on the installation and setup, you need to grab the most current version of Openfire from the Ignite Realtime web site.

Download Openfire Jabber/XMPP Server

  1. To download the Openfire application, stop by the Openfire project site and click the Download button for the most current version of Openfire.
  1. Openfire is available for three different operating systems: Windows, Linux, and Mac. As you've probably already guessed, we'll be using the Mac version of the application.
  2. Select the Mac download button, then click on the openfire_3_7_0.dmg file. (We're using Openfire 3.7.0 for these instructions; the actual file name will change over time as new versions are released.)

Installing Openfire

  1. Once the download is complete, open the disk image you downloaded, if it didn't open automatically.
  2. Double-click the Openfire.pkg application listed in the disk image.
  3. The installer will open, welcoming you to Openfire XMPP Server. Click the Continue button.
  4. Openfire will ask where to install the software; the default location is fine for most users. Click the Install button.
  5. You will be asked for an admin password. Supply the password, and click OK.
  6. Once the software has been installed, click the Close button.

Setting Up Openfire

  1. Openfire is installed as a preference pane. Launch System Preferences by either clicking the System Preferences Dock icon, or selecting "System Preferences" from the Apple menu.
  1. Click the Openfire preference pane located in the "Other" category of System Preferences.
  2. You may see another message that says, "To use the Openfire preference pane, System Preferences must quit and reopen." This happens because the Openfire preference pane is a 32-bit application. In order to run the application, the 64-bit System Preferences application must quit, and the 32-bit version run in its place. This won't affect the performance of your Mac, so click OK, and then open the Openfire preference pane again.
  3. Click the Open Admin Console button.
  4. This will open a web page in your default browser that will allow you to administer the Openfire Jabber server.
  5. Since this is the first time you have used Openfire, the administration page will display a welcome message and start the setup process.
  6. Select a language, then click Continue.
  7. You can set the domain name used for the Openfire server. If you're planning to run the Openfire server only for your local network, with no connection to the Internet, then the default settings are fine. If you want to open the Openfire server to outside connections, you'll need to provide a fully qualified domain name. You can change this later if you wish. We're going to assume that you're using Openfire for your own internal network. Accept the defaults, and click Continue.
  8. You can choose to use an external database to hold all of the Openfire account data, or use the embedded built-in database included with Openfire. The embedded database is fine for most installations, especially if the number of clients connecting is less than one hundred. If you're planning a larger installation, the external database is a better choice. We will assume this is for a small installation, so we'll select the Embedded Database option. Click Continue.
  9. User account data can be stored in the server database, or it can be pulled from a directory server (LDAP) or a ClearSpace server. For small to medium Openfire installations, especially if you're not already using an LDAP or ClearSpace server, the default Openfire embedded database is the easiest option. We're going to proceed using the default selection. Make your selection, and click Continue.
  10. The final step is to create an administrator account. Provide a functional email address and a password for the account. One note: You're not providing a username at this step. The username for this default administrator account will be 'admin' without the quotes. Click Continue.
The setup is now complete.
3 of 4

iChat Server - Configuring the Openfire Jabber Server

Enter a username and password. You can also optionally include the user's real name and email address, and specify whether the new user can be an administrator of the server. Photo Credit: Screen capture courtesy of Coyote Moon Inc.
Now that the basic setup of the Openfire Jabber server is complete, it's time to configure the server so that your iChat clients can access it.
  1. If you're continuing from where we left off on the last page, you'll see a button on the web page that will let you move on to the Openfire Administration Console. Click the button to continue. If you closed the setup web page, you can regain access to the administration console by launching the Openfire preference pane and clicking the Open Admin Console button.
  1. Enter the username (admin), and password you specified earlier, then click Login.
  2. The Openfire Admin Console provides a tabbed user interface that allows you to configure Server, Users/Groups, Sessions, Group Chat, and Plugins for the service. In this guide, we'll only look at the basics you need to configure to have the Openfire Jabber server up and running quickly.

Openfire Admin Console: Email Settings

  1. Click the Server tab, then click the Server Manager sub-tab.
  2. Click the Email Settings menu item.
  3. Enter your SMTP settings to allow the Openfire server to send notification emails to the administrator. This is optional; the Openfire server will work whether or not you set up email. But as the Openfire administrator, it's a good idea to be able to receive notifications if a problem should ever arise.
  4. The information asked for in the email settings is the same information you use for your email client. The mail host is the SMTP server (outgoing mail server) you use for your email. If your email server requires authentication, be sure to fill out the Server username, and Server password. This is the same information as your email account username and password.
  1. You can test the Email settings by clicking the Send Test Email button.
  2. You're given the ability to specify who the test email should go to, and what the subject and body text should be. Once you make your choices, click Send.
  3. The test email should appear in your email application after a short time.

Openfire Admin Console: Creating Users

  1. Click the Users/Groups tab.
  2. Click the Users sub-tab.
  3. Click the Create New Users menu item.
  4. Enter a username and password. You can also optionally include the user's real name and email address, and specify whether the new user can be an administrator of the server.
  5. Repeat for additional users you wish to add.

Using iChat to Connect

You will need to create a new account for the user in iChat.
  1. Launch iChat and select "Preferences" from the iChat menu.
  2. Select the Accounts tab.
  3. Click the plus (+) button under the list of current accounts.
  4. Use the dropdown menu to set the Account Type to "Jabber."
  5. Enter the account name. The name is in the following form: username@domain name. The domain name was determined during the setup process. If you used the default settings, it will be the name of the Mac that's hosting the Openfire server, with ".local" appended to its name. For example, if the username is Tom and the host Mac is called Jerry, then the full username would be Tom@Jerry.local.
  6. Enter the password you assigned to the user in Openfire.
  7. Click Done.
  8. A new iChat messaging window will open for the new account. You may see a warning about the server not having a trusted certificate. This is because the Openfire server uses a self-signed certificate. Click the Continue button to accept the certificate.
That's it. You now have a fully operational Jabber server that will allow iChat clients to connect. Of course, an Openfire Jabber server has quite a bit more functionality to it than we explored here. We only looked at the bare minimum required to get the Openfire server up and running, and to connect your iChat clients to it.
If you would like to learn more about using the Openfire Jabber server, you can find additional documentation at:
The last page of this guide includes instructions for uninstalling the Openfire server from your Mac.
4 of 4

iChat Server - Uninstalling the Openfire Jabber Server

Enter the account name. The name is in the following form: username@domain name. For example, if the username is Tom and the host Mac is called Jerry, then the full username would be Tom@Jerry.local. Photo Credit: Screen capture courtesy of Coyote Moon Inc.
One thing I don't like about Openfire is that it doesn't include an uninstaller, or readily available documentation about how to uninstall it. Luckily, the Unix/Linux version contains details about where the Openfire files are located, and since OS X is based on a UNIX platform, it was fairly easy to find all of the files that need to be removed to uninstall the application.

Uninstall Openfire for Mac

  1. Launch System Preferences, and then select the Openfire preference pane.
  1. Click the Stop Openfire button.
  2. After a short delay, the Status for Openfire will change to Stopped.
  3. Close the Openfire preference pane.
Some of the files and folders you'll need to delete are stored in hidden folders. Before you can delete them, you must first make the items visible. You can find instructions on how to make invisible items visible, as well as how to return them to the hidden format after you've finished uninstalling Openfire, here:
  1. After making the hidden items visible, open a Finder window and navigate to:
    Startup drive/usr/local/
  2. Replace the words "Startup drive" with the name of your Mac's boot volume.
  3. Once in the /usr/local folder, drag the Openfire folder to the trash.
  4. Navigate to Startup drive/Library/LaunchDaemons and drag the org.jivesoftware.openfire.plist file to the trash.
  5. Navigate to Startup drive/Library/PreferencePanes and drag the Openfire.prefPane file to the trash.
  6. Empty the trash.
  7. You can now set your Mac back to the default condition of hiding system files, using the process outlined in the link above.

openfire的移除

Removing an OpenFire Install

 | COMMENTS
After playing with OpenFire for some time, I decided to go back to the default jabberd install on OS X Leopard Server. Unfortunately, the application doesn’t seem to come with an un-installer nor are there directions in the documentation.
A quick search on the Ignite Software forums turned up these directions for removing OpenFire from your system:
sudo rm -rf /usr/local/openfire
sudo rm -rf /Library/PreferencePanes/Openfire.prefPane
sudo rm -rf /Library/LaunchDaemons/org.jivesoftware.openfire.plist
sudo rm -rf /Library/Receipts/Openfire.pkg

在電梯裡遇到老闆、馬路上遇到前同事》掌握閒聊公式3步驟,自在寒暄不尷尬

我們都遇過類似的狀況:嚴肅會議開始前的幾分鐘,不知道要和坐在隔壁的同事聊什麼。和前同事在街角相遇,除了打招呼和互道再見外,還可以用什麼話題增加談話的熱絡度呢?在狹小的電梯裡遇到老闆,除了低頭看地板、暗自祈禱電梯趕快打開之外,雖然很想自然的閒聊幾句,增加老闆的正面印象,卻不知道怎麼開口。在這些短暫的時刻,通常會講幾句話,但又偏偏想不到話題,壓力與尷尬接踵而來。這時你可能會暗自嘆氣:「唉!我不是擅長與人交談的人,最不會應付這種狀況了。」   倘若你覺得在找話題閒聊方面缺乏天分,可以參考Anett Grant在《Fast company》雜誌網站分享的「閒聊公式」。Grant是主管溝通訓練公司(Executive Speaking)的創辦人兼董事長,她曾訓練許多高階主管演說與說話技巧,客戶包括3M、百事(PepsiCo)等知名公司。有公式可參考,應該比較不會摸不著頭緒了吧!以下為Grant所提出的閒聊三步驟。   1.找出彼此相似的地方(match)   首先,必須「找出彼此相似的點」,以便和另一方建立關係、連結。試想,和一個人一起走路閒聊,一定得跟上他走路的步調,閒聊的概念也是相同的。究竟要怎麼做才能展現彼此的相似之處呢?Grant所提供的方法很簡單,不必額外花時間上網搜尋熱門議題、球賽結果、時尚新品,只要引用剛剛對方提到的話題即可!如此不只能創造輕鬆愉快的對談經驗,也展現認真傾聽的誠意。讓我們來看看實際例子:   你:「週末有什麼計畫嗎?」   對方:「要和朋友一起參加路跑。」   你(找出連結):「真巧!我之前也一直計劃什麼時候去路跑,只是一直沒有付諸行動。」   2.適時轉換話題(shift)   接著,下一個步驟是「轉換話題」。你可以繼續提出與剛才話題類似的元素,也可以在該話題的基礎上做小小轉彎,直到找到你們倆實際上都熱中、有興趣的事物。   在上述的例子中,如果剛好你也喜歡路跑,可以繼續聊路跑相關的話題,例如最近還有哪個單位在舉辦路跑、不同形式的路跑等等。如果你並非路跑的忠實愛好者,建議將話題轉向不同的週末活動。之所以要轉換話題,是為了避免持續在一個你不熟悉的話題打轉,容易接不下去。Grant的建議是,不要回答自己不愛路跑,因為這樣的回答很容易讓話題畫上句點。延續上面的例子:   你:「真巧!我之前也一直計劃什麼時候去路跑,只是一直沒有付諸行動。」   你(轉換):「因為我不太適應這麼多人一起跑,但我還是滿喜歡運動的,像是下班後去健身房,或是到河堤慢跑。」   3.傳球給對方(pass back)   最後一個步驟是「傳球給對方」,也就是用一句明確的邀約,將話語權交給對方,讓談話對象有機會回應你剛才轉換的話題。   提出邀約前,表達你對該話題的想法很重要,這是為閒聊對象創造一個沒有風險的對話環境,對方不會因為懼怕採到你地雷而不敢表達看法。這個步驟的執行,代表你想繼續談話與傾聽,不只是隨便應付了事。此外,若對方不喜歡你轉換的話題,把話語權交給對方,也是給對方再次轉換話題的機會。接著,讓我們一起將之前提到的例子結束吧!   你:「因為我不太適應這麼多人一起跑,但我還是滿喜歡運動的,像是下班後去健身房,或是到河堤慢跑。」   你(pass back):「你也喜歡下班後運動嗎?」   如果你的談話對象也喜歡下班後運動,你已經找到雙方都感興趣的話題了,可以繼續針對該話題暢所欲言。如果對方不喜歡下班運動,你可以重複上述的三個步驟。   下一次再遇到尷尬的短暫談話時刻,記住Grant的簡單三步驟。談話時間雖短,卻能帶來驚人效果,讓對方對你好感度提升,增添正面印象。   延伸閱讀:「久仰大名」然後呢?7個與人聊不停的話題   原文出處:Fast Company   嚴禁抄襲,若欲轉載,敬請註明出處「SmartLinkin商務社群網」並附上原文連結。 歡迎各大媒體交換文章連結。 圖片來源:主圖、縮圖-Gage Skidmore(CC Licensed) 加入「SmartLinkin商務社群網」粉絲團,更多商務訊息等你關注。

2015年7月2日 星期四

a sentence a day


Without XMPP and Strophe, the work would have been immensely more challenging.


Provides many out-of-the-box tools for solving a wide range of problems


HTTP is limited to simple request-response semantics 


It's certainly possible to build many of the same constructs on top of HTTP, but protocol design is non-trivial. 


comparable HTTP extensions tend to be incompatible with each other, brittle, or primitive. 


More overhead than HTTP for simple chores


minified JavaScript can hinder debugging 

If you are already well versed in Web technologies, feel free to skim the code and skip to the next section. 


they have adequate permis- sions within the room. 

Manipulating roles is necessary for silencing or removing users in a room when they get out of hand