Diaspora* Tutorial
How to Install Diaspora*
Diaspora* is an open-source, user-owned distributed social network. It is made up of independently operated servers called pods. This guide shows how to deploy your own Diaspora* pod on the platform using Ruby, MySQL, and Redis.
Create Environment
- Log in to the platform dashboard.
- Click Create Environment.
- Open the Ruby tab in the topology wizard.
- Add the following nodes:
- Apache application server
- MySQL database
- Redis data structure server
- Set the resource limits for the selected nodes.
- Enter an environment name, for example
diaspora-network, and click Create.
After the environment is created, it appears in the dashboard with the Apache, MySQL, and Redis layers.
Diaspora* Deployment
- Open the official Diaspora* GitHub repository.
- Select the master branch and download the project as a ZIP archive.
- Return to the platform dashboard and upload the archive through Deployment Manager.
- Click Deploy to… beside the uploaded archive.
- Select the target Ruby/Apache environment and deploy the application.
The deployment process may take some time. When it finishes, the application context appears under the Apache node.
Database Configuration
Open Config for the Apache application server and navigate to the application config directory.
- Find
database.yml.example. - Copy its contents.
- Create a new
database.ymlfile in the same directory. - Paste the copied configuration into the new file.
- Find the MySQL configuration section and replace the connection values with the database information supplied for your environment.
Use your database hostname without the http:// prefix, together with the MySQL username and password received when the environment was created.
mysql: adapter: mysql2 host: "YOUR_MYSQL_HOST" username: "YOUR_MYSQL_USERNAME" password: "YOUR_MYSQL_PASSWORD"
Save the updated database.yml file.
Application Server and Redis Configuration
In the same application config folder, create diaspora.yml from the supplied diaspora.yml.example file.
Set the Environment URL
Find the application URL setting and replace the sample value with the URL of your environment. The environment URL can be obtained through Open in Browser in the dashboard.
url: "https://YOUR_ENVIRONMENT_URL/"
Configure Remote Redis
Find the remote Redis configuration block and enable the connection string that contains a username, password, host, and port.
## URL for a remote redis. ## Don't forget to restrict the IP access! ## Leave it commented out for the default (localhost) #redis: 'redis://example_host' redis: 'redis://username:password@host:6379/0' #redis: 'unix:///tmp/redis.sock'
Replace the sample values with the Redis connection information supplied by the platform.
Update the Test Environment URL
In the test configuration section, remove the dummy marker and replace the localhost URL with your actual environment URL.
test:
environment:
url: 'https://YOUR_ENVIRONMENT_URL/'
Deployment Configuration
Create a file named rake_deploy in the application webroot and add the following deployment tasks:
db:create db:schema:load assets:precompile
Save the file, then restart the Apache node to apply all changes.
Expected Result
After Apache restarts successfully, click Open in Browser for the environment. The Diaspora* start page should load, allowing you to continue setting up and using your own hosted Diaspora* pod.
Important Notes
- The documented topology uses Apache, MySQL, and Redis under the Ruby environment type.
- Create
database.ymlanddiaspora.ymlfrom the supplied example files. - Use the actual environment URL instead of the sample URL values.
- Use the remote Redis credentials supplied for the Redis node.
- The
rake_deployfile initializes the database schema and precompiles application assets. - The source workflow is a legacy-style Diaspora* deployment and may depend on the application version being used.
