RedMine is a great tool for developpers: unfortunately it does not perform well on my synology DS-107+ (for various reasons i don't have time to inspect, low memory is probably a first answer)...
Anyway, as i'm having a-lot-of (probably too-much) machines available @ home: i choose to dedicate some horsepower to run a minimalistic virtual linux machine with Apache and RedMine (note that Bitnami is offering such packages ready for download).
So my idea was to use the Synology as a gateway between the internet and my home LAN, mainly to centralize security settings, and access point uniqueness.
Many topics are covered in this recipe:
1) Installing a virtual ubuntu server running redmine
2) Running a virtual machine as a service under Windows 7
3) Binding the Synology web frontend and a virtual server 2) Running a virtual machine as a service under Windows 7
Creating the virtual machine : ubuntu+redmine
Get VirtualBox, http://www.virtualbox.org/ . Eventually look for a portable edition.Note: to move a virtual server from one machine to another: ensure that you're using the same netword card between virtualbox installations: type of network card and MAC address must be the same. (note that if network is not working properly on virtualized linux, ensure that /etc/udev/rules.d/70-persistent-net.rules doesn't contain deprecated MAC entries).Grab Ubuntu server ISO, attach it to your virtua machine and perform the (blazingly fast) install: select Apache and MySQL components
- Once connected to the console, you might notice a sluggish refresh:
howto blackList vga mode :
sudo nano /etc/modprobe.d/blacklist-framebuffer.conf
add the following line:
blacklist vga16fb
Enforcing static IP use for the virtual Ubuntu Server (192.168.0.78 in my case)Note: you can enable and use remote access to a virtualbox machine...
sudo vi /etc/network/interfaceschange
auto eth0into
iface eth0 inet dhcp
auto eth0store your dns info via
iface eth0 inet static
address 192.168.0.78
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.254
sudo vi /etc/resolv.conf
you should read/add something like thisnameserver 208.67.220.220 nameserver 208.67.222.222
and finally
Install VirtualBox extensions on ubuntu serverssudo /etc/init.d/networking restart
Perform Ubuntu system update:apt-get install build-essential linux-headers-`uname -r`
mount /dev/cdrom /media/cdrom
cd /media/cdrom
./VBoxLinuxAdditions-x86.run
Install Ruby requirements for RedMinesudo apt-get updatesudo apt-get install rubysudo apt-get install rubygems
Plug Ruby with MySQL, using an adapter:sudo gem install
gem install rails -v 2.3.5 -no-doc -no-rigem install rack -v 1.0.1 -no-doc -no-ri
cd /tmpEventually install PHPMyAdmin
check latest version http://github.com/tmtm/ruby-mysql/downloadswget http://github.com/downloads/tmtm/ruby-mysql/ruby-mysql-2.9.3-beta.tar.gz
tar -xzvf ruby-mysql-2.9.3-beta.tar.gz
cd ruby-mysql-2.9.3-beta/
ruby setup.rb
sudo wget http://sourceforge.net/projects/phpmyadmin/files%2FphpMyAdmin%2F3.3.7%2FphpMyAdmin-3.3.7-all-languages.tar.gzsudo tar -xzvfsudo mv /apps/phpMyAdmin
On Ubuntu Server: symbolic links in /etc/apache2/sites-enabled point to 'available' web sites. Use the a2ensite (Apache2 Enable Site) command to create such symbolic links, like this: sudo a2ensite mynewsite where your site configuration file is /etc/apache2/sites-available/mynewsite
. Similarly, the a2dissite utility is used to disable sites.
Enabling your PhpMyAdmin directory as a site
cd /etc/apache2/sites-available
ln /phpmyadmin /apps/phpmyadmin-3.3.7
sudo a2ensite phpmyadmin
/etc/init.d/apache2 reload
Install Mercurialbrowse to address/phpmyadminlogin/root from installation credentialssometimes php fails when triggered (security problems), editsudo nano /etc/php5/apache2/php.iniand edit open_basedir = to add your own '/apps/' (which allow php execution from that directory).
Download and configure Redmine (http://www.redmine.org/wiki/redmine/RedmineInstall)sudo apt-get install mercurial
chown -R www-data:www-data /apps/
cd /volume1/apps
wget http://rubyforge.org/frs/download.php/72201/redmine-1.0.1.tar.gz
tar -xzvf redmine-1.0.1.tar.gz
mv redmine-1.0.1 redmine
cd redmine/config
cp database.yml.sample database.yml
nano /config/database.yml
productionusername: redmine
adapter: mysql
password: xxxxxxxx
sudo apt-get install libopenssl-ruby1.8
sudo apt-get install rake
cd redmine
RAILS_ENV=production rake config/initializers/session_store.rb
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
ruby script/server -p production
in redmine login/password: admin admin
Install passenger (module enabling execution of ruby servicing in Apache)
sudo apt-get install libapache2-mod-passenger
load module in sites apache config scripts if not included by default
LoadModule passenger_module modules/mod_passenger.so
Install RedMine site under Apache (http://www.he1ix.org/?p=572)
cd /etc/apache2/sites-available
Alias /redmine /apps/redmine-1.0.1/public
sudo a2ensite redmine
sudo /etc/init.d/apache2 reload
sudo chown -R www-data.www-data files log tmp public/plugin_assets
sudo a2enmod rewrite
cd /apps/redmine-1.0.1/public
copy dispatch.cgi.example dispatch.cgi
If you have problem with /tmp/mysql.sock (Redmine having some problems to access mysql: can't find /tmp/mysql.sock):
you cant use sudo ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock (file is not persistent), but you may specify the ubuntu mysql socket path in redmine config: edit /redmine/config/database.yml
Enabling NFS services on your synology: to allow your LAN machine to access a repository on the synologyproduction: adapter: mysql socket: /var/run/mysqld/mysqld.sock
synoservice --list
synoservice --enable nfs
nano /etc/exports
In 'exports' file, add the following line
/directory/ ip.of.NFS.client(ro,root_squash,no_subtree_check)
(* as 'ip.of.NFS.client', means 'for all computers on LAN')
Save the 'exports' file
Check if the file /var/lib/nfs/rmtab does exist, if not, run the following command
touch /var/lib/nfs/rmtab
Now perform
cd / /usr/sbin/exportfs -a
Testing: look at /var/log/messages to check whether the settings are ok with your Synology product
On the Ubuntu Server side (read this):
sudo apt-get install nfs-kernel-server
sudo mkdir /apps/mnt
sudo mount 192.168.0.77:/volume1/repos
sudo vi /etc/fstab
to add
That's it for the virtual ubuntu server install !192.168.0.77:/volume1/repos /nfsmount nfs
No comments:
Post a Comment