La version Française est disponible ici: Installer sa propre instance StatusNet avec PHP-FPM et Nginx
Previously, about StatusNet
In fact nothing: this is the first part. The publication's list will be updated after each new release:
- Part 1: Install your own StatusNet instance with PHP-FPM and Nginx
- Part 2: Optimize your own StatusNet instance for better performances and features
- Part 3: StatusNet plugin to improve frontend web performances
I'll use a reference configruation detailled here:
- Nginx: automatic vhosts configuration with subdomains, SSL and authentication support - second version
- PHP-FPM, application server made by PHP
Anyway, you should be able to use all purely StatusNet related configuration, whatever you web server could be.
StatusNet is a free micro-blogging software, developed with PHP, using MySQL for persistent storage. It's also able to use NoSQL technologies such as memcached to incerase performances. Many plugins can also be used for performances or features.
StatusNet rely on open protocols like oStatus and oAuth.
The main platform operating StatusNet is identi.ca with about 450.000 users. A new platform, cloud based, is about to open: status.net. Both are operated by StatusNet, tha company who writes the software.
One of the main StatusNet's pros concerns reliability. As distributed system, StatusNet does not suffer the famous Twitter "Fail Whale effect". Of course, it can fail and basically it already had. But, when a StatusNet instance fails, the only impacted user are those who registered this instance. Other are not impacted. More, with your own instance, you still control your data.
We are going to install a single StatusNet instance with Nginx and PHP-FPM. I assume you have a commandline access to the server. Anyway, I do not recommend using StatusNet on shared hosting.
Using command line will simplify NGinx configuration.
Before diving into technical stuff
StatusNet has some usefull options. Among them, you will find the "SingleUser" mode. Before starting, just ask you the question: will you be the only user of this instance ? If yes, you can go. If not, or if you're not sure, do not use this mode.
In theory, you can switch between SingleUser and normal mode. In pratice, it's better not to do it because oStatus seems to have some side effects propagating changes, when done.
Based on the configuration described above, we will setup an application pool. That means StatusNet will be available for different domains and, of course, many users.
Firts create directory tree:
Then, prepare PHP-FPM configuration.
You'll also need some PHP extension to make StatusNet working.
Here we are with PHP. It's now time to configure NGinx.
NGinx configuration as application pool
Here, we're going to setup an application pool, as described in my previous publications.
If requested file is static and its extension listed, it'll be served from first location block. If not, we assume that it's some FancyURL and pass it to PHP via second location block.
Downside with this setup is that you won't be able to use web based installer, because it'll never be transfered to PHP for execution (since we rewrite all requests to /index.php/$uri. That's why we'll use commandline to install it. The pro here is it also prevents direct call to sensitive files like config.php with is always good for security.
Since StatusNet entry point is always index.php and since we can use command line to install our instance, it's not really a problem not being able to use web installer.
Finally, prepare MySQL storage:
Keep these informations somewhere, you will need them soon.
You just need to grab source package from status.net website and deploy it on you server.
Last command is important: StatusNet needs write access in these directories. They are used to store some user data.
It's now time to create you instance:
Simple, yet powerfull. Of course, you have to replace strong strings with you informations.
Now you can join StatusNet network. You can register other people, for example from identi.ca. Of course, you can communicate you StatusNet ID so that people can subscribe you. Just use either StatusNet ID email@example.com or URL: //status.domain.tld/your_nickname.
SingleUser mode setup
Remember introduction ? If you still plan to be the only user of your instance, lets add some lines lines into StatusNet configuration file:
Once it's done, you still need to update already created profiles. To do that, you can manually update them directly in database or, better, just use the script:
With that configuration, your StatusNet ID is still firstname.lastname@example.org but the URL is much more simpler: //status.domain.tld/.
Next time, we'll see how to increase StatusNet performances, how to secure it as well and how to connect it with Twitter and some other cool things.
Stay tuned and have fun !
Sources and references
- Getting started
- Official website
- Official website