Difference between revisions of "User:CSammy/Installation/CentOS/6"
(→It's time to start Diaspora:)
|Line 266:||Line 266:|
Revision as of 20:51, 2 September 2013
So, here are the steps I followed to get it up and running for CentOS 6.4. This is an entirely fresh/clean install of CentOS 6.4. Nothing else is running on this box, and this tutorial covers all that needs to be installed.
First step is to install CentOS 6.4 with the base/minimal install. Please follow other instructions to do this if you don't know how.
- 1 Perform an update to ensure you've got the latest of everything in the base package.
- 2 Install wget so you can download a few things.
- 3 Allow yum to locate/install redis, per this page here.
- 4 Now, install all the prerequisites
- 5 Enable and start MySQL
- 6 Secure your MySQL installation by setting a password. replace 'new-password' with your secure password.
- 7 Open up the necessary firewall ports
- 8 Restart the firewall
- 9 Configure Nginx
- 10 Enable and activate nginx web server.
- 11 Enable and activate redis service.
- 12 Create the diaspora user
- 13 Run all future commands as diaspora user
- 14 Install RVM - Per instructions here. http://rvm.io/
- 15 Logout and back into the diaspora user account
- 16 Install Diaspora*
- 17 Copy the base configuration files.
- 18 It's time to install the Ruby libraries required by Diaspora:
- 19 Double check your config/database.yml looks right and run:
- 20 Precompile assets
- 21 It's time to start Diaspora:
Perform an update to ensure you've got the latest of everything in the base package.
Install wget so you can download a few things.
yum install wget
Allow yum to locate/install redis, per this page here.
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm"
Now, install all the prerequisites
yum install tar make automake gcc gcc-c++ git net-tools libcurl-devel libxml2-devel libffi-devel libxslt-devel tcl redis ImageMagick npm mysql-server mysql-devel nginx libyaml libyaml-devel patch readline-devel libtool bison
Enable and start MySQL
chkconfig --level 3 mysqld on service mysqld start
Secure your MySQL installation by setting a password. replace 'new-password' with your secure password.
mysqladmin -u root password 'new-password' mysqladmin -u root -h YourHost.YourDomain.com password 'new-password'
Open up the necessary firewall ports
vi /etc/sysconfig/iptables copy this line. -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT and add two more with port 80 & 443 as well -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
Restart the firewall
service iptables restart
Next, modify the nginx configuration based on this advice I found on here. https://github.com/diaspora/diaspora/wiki/Nginx-Configuration Be sure to follow all the FIXME instructions, including replacing "example.com" with your domain name. You may also need to create a key and csr to obtain a signed SSL certificate. That part is not covered here.
Enable and activate nginx web server.
chkconfig --level 3 nginx on service nginx start
Enable and activate redis service.
chkconfig --level 3 redis on service redis start
Create the diaspora user
useradd diaspora passwd diaspora
Run all future commands as diaspora user
su -l diaspora
Install RVM - Per instructions here. http://rvm.io/
curl -L https://get.rvm.io
vi .bashrc -- begin add to .bashrc -- [[ -s "~/.rvm/scripts/rvm" ]] && source "~/.rvm/scripts/rvm" -- end add to .bashrc -- :wq <- to save and exit
Logout and back into the diaspora user account
exit su -l diaspora
$ rvm autolibs read-only Install the version of ruby wanted by Diaspora (installing latest version will not work) $ rvm install 1.9.3-p448
git clone -b master git://github.com/diaspora/diaspora.git cd diaspora
Answer y[es] to the prompt about switching to '.ruby-version'
Copy the base configuration files.
cp config/database.yml.example config/database.yml cp config/diaspora.yml.example config/diaspora.yml
Now open config/database.yml and config/diaspora.yml in your favorite text editor and carefully review them, they are extensively commented.
Important values in config/diaspora.yml
environment.url: Set the public facing URL to your pod here, for example for https://pod.geraspora.de this would be https://pod.geraspora.de environment.certificate_authorities: You have to set this, one of the examples should fit. If the file in the example doesn't exist you're missing a package, in most cases it's named ca-certificates. server.rails_environment: You must set this to production. The server section is read by ./script/server and most alternative startup methods to setup the correct environment. environment.require_ssl: If for some reason you can't run your pod on HTTPS (we highly encourage you to do it!), set this to false to prevent a redirect from http:// to https://
It's time to install the Ruby libraries required by Diaspora:
# RAILS_ENV=production bundle install --without test development
Double check your config/database.yml looks right and run:
RAILS_ENV=production bundle exec rake db:create db:schema:load
RAILS_ENV=production bundle exec rake assets:precompile
It's time to start Diaspora: