* You can safely skip this is you already have an OS installed on your machine.
This provides a basic way to setup an OS environment for wagn:
everything should start and now you are at the login,
enter root and the password
$ su
enter root password
Remove the cd from the sources
http://askubuntu.com/questions/236288/apt-get-asks-me-to-insert-cd-why
$ gedit /etc/apt/sources.list
and simply add to this line with the #-sign so that it looks something like this:
# deb cdrom:[Ubuntu 12.10
then do:
$ apt-get update
Install sudo (you'll be able to execute commands as administrator without becoming root first)
$ apt-get install sudo
Creating new user and making it an administrator
$ adduser myuser
Type in a password and don't forget it. Press enter at all the other questions.
Add 'myuser' to the sudoers
$ visudo
http://serverfault.com/questions/58378/add-new-user-with-root-access-in-linux
Scroll down and under the line where is says root type your name
## Allows just user "username" to run all commands as root
mir ALL=(ALL) ALL
Type to exit the root shell
$ exit
empty
empty
I have just set up an wagn in my local Ubuntu Server with Apache and want to share how it's done.
Assuming that you are on a fresh Installation of Ubuntu 14.04 start with the usual steps:
sudo apt-get update && sudo apt-get dist-upgrade
After the updates are done it's time to get rvm and ruby:
sudo apt-get curl
\curl -sSL https://get.rvm.io | bash -s stable
rvm install ruby
Now let's install apache with Passenger Support:
sudo apt-get install apache2 libapache2-mod-passenger
sudo a2enmod passenger
Imagemagick is also needed so lets get this to:
sudo apt-get install imagemagick libmagickwand-dev
Not to forget about the Database:
sudo apt-get install mysql-server
Let's create an Database user for wagn:
sudo mysql -u root -pmysql> create user 'wagn' identified by 'secret'; mysql> grant all on *.* to 'wagn';
mysql> quit;
This will create the mysql user 'wagn' with the password 'secret'. this user has all rights on your mysql Server.
Now should everything be prepared and you can get the gems:
gem install image_science bundler wagn passenger
If any dependancies need to be fulified, gem will show you the necessary steps.
I've created an extra folder below /opt to put my wagn sites and set the rights:
sudo mkdir /opt/wagn/
sudo chown <user>:<usergroup> /opt/wagn/
<user> and <usergroup> should be the user and his group wich run ruby.
Now let's create our first wagn site:
wagn new /opt/wagn/mysite
Then install all necessary bundles
cd /opt/wagn/mysite
bundler install
Edit the opt/wagn/mysite/config/database.yml and put your former created mysql user with his password in the Production settings.
Now let's create the Database:
wagn seed
And Finally let's add the Passenger:
cd ~
passenger-install-apache2-module
Edit your passenger.load file and fill in the LoadModule line as given by the passenger-install:
sudo nano /etc/apache2/mods-enabled/passenger.load
Edit your passenger.conf file and fill in the IfModule mod_passenger.c lines as given by the passenger-install:
sudo nano /etc/apache2/mods-enabled/passenger.conf
In both config files outcomment the lines wich are installed automtically by Phusion Passenger.
Now let's edit the Webserver config as given by the passenger-install:
sudo nano /etc/apache2/sites-enabled/000-default.conf
And finally restart your Apache, and it should be up & running!
sudo service apache2 restart