Installing Redmine on CentOS 6.2 Wiht MySQL and Apache
I needed recently to install the excellent project management tool
Redmine on a CentOS
6.2 machine. There are some tutorials on the Web (here
or here)
but they are a little bit outdated. The following is a method that works as of
today.
Redmine is installed with the following commmands:
12345
cd /var/www
wget http://rubyforge.org/frs/download.php/76255/redmine-1.4.4.tar.gz
tar zxf redmine-1.4.4.tar.gz
ln -s redmine-1.4.4 redmine
rm -f redmine-1.4.4.tar.gz
Install Redmine ruby dependencies
Bundle helps us install the ruby Redmine dependencies:
12
cd /var/www/redmine
bundle install --without postgresql sqlite test development
Database creation
First we start MySQL:
1
service mysqld start
Then we secure it (Optional):
1
mysql_secure_installation
We then create the redmine database and user:
12345
$ mysql
mysql> create database redmine character set utf8;
mysql> grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'my_password';
mysql> flush privileges;
mysql> quit
Redmine database configuration
We copy the database configuration example and we modify it to point to our
newly created database:
12
cd /var/www/redmine/config
copy database.yml.example database.yml
On the database.yml file, the production section should look like this:
At this point, Redmine can be tested in standalone mode by running the
following command:
12
cd /var/www/redmine/
ruby script/server webrick -e production
and open the http://localhost:3000 addess in a browser. If you are testing
from another computer, you will need to open the port in the
/etc/sysconfig/iptables file by duplicating the ssh (port 22) line and
adapting it:
12
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT
Then apply the new configuration with the following command:
And then install the Apache module with the command:
1
passenger-install-apache2-module
Apache configuration
We remove the default Apache configuration and replace it by a new one:
123
cd /etc/httpd
mv conf.d available
mkdir conf.d
In the empty new conf.d folder, we create a redmine.conf file with the
following configuration:
1234567891011121314151617181920
# Loading PassengerLoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13
PassengerRuby /usr/bin/ruby
<VirtualHost *:80>
ServerName redmine.mycompany.com
DocumentRoot /var/www/redmine/public
<Directory /var/www/redmine/public>
# This relaxes Apache security settings. AllowOverride all
# MultiViews must be turned off. Options -MultiViews
allow from all
</Directory>
ErrorLog "|/usr/sbin/rotatelogs /etc/httpd/logs/redmine-error.%Y-%m-%d.log 86400" CustomLog "|/usr/sbin/rotatelogs /etc/httpd/logs/redmine-access.%Y-%m-%d.log 86400""%h %l %u %t %D \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""</VirtualHost>
We then enable named based virtual hosting for our server by uncomenting the
following line in the /etc/httpd/conf/httpd.conf file:
123456
...
## Use name-based virtual hosting.#NameVirtualHost *:80
...
We give full access on the redmine folder to the apache user and test the
configuration:
12
chown -R apache:root /var/www/redmine
service httpd configtest
At this point, the SELinux configuration needs to be modified to allow our
apache instance to run the phusion passenger module. You can do this by putting
SELinux in permissive mode:
1
setenfore Permissive
And letting the Permissive mode survive a reboot by modifyin the
/etc/selinux/config file from:
1
SELINUX=enforcing
to
1
SELINUX=permissive
If you want to run redmine while enforcing, you may want to apply the method
described here for which you will need
to install the policycoreutils-python package.
In any case, you will start Apache with the command:
1
service httpd start
Now you can access your Redmine installation with your browser. To access it
from all the computers in your network, you will need to open the port 80 in the
/etc/sysconfig/iptables. You can replace the 3000 rule by :
12
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
And restart iptables.
1
service iptables restart
Start services at boot
To have MySQL and Apache started at boot, run the commands:
12
chkconfig --level 345 mysqld on
chkconfig --level 345 httpd on
Cleaning up
A quick command to clean up all the devel stuff needed for installation:
1
yum remove '*-devel' make automake autoconf
Tips
Don’t forget that if you change your Redmine configuration, you don’t have to
restart Apache. Your can restart only Redmine with the command:
1
touch /var/www/redmine/tmp/restart.txt
If you restore data on your server from another redmine instance that runs on a
previous version, dont forget to migrate your data:
12
cd /var/www/redmine
rake db:migrate RAILS_ENV="production"
kill command works under both Linux and UNIX/BSD like operating systems.
Step #1: First, you need to find out process PID (process id)
Use ps command or pidof command to find out process ID (PID). Syntax: ps aux | grep processname pidof processname
For example if process name is lighttpd, you can use any one of the following command to obtain process ID: # ps aux | grep lighttpd # pidof lighttpd Output:
3486
Step #2: kill process using PID (process id)
Above command tell you PID (3486) of lighttpd process. Now kill process using this PID: # kill 3486 OR # kill -9 3486 Where,
-9 is special Kill signal, which will kill the process.
killall command examples
DO
NOT USE killall command on UNIX system (Linux only command). You can
also use killall command. The killall command kill processes by name (no
need to find PID): # killall -9 lighttpd Kill Firefox process: # killall -9 firefox-bin
Installing Zend Server Community Edition (CE) on Ubuntu With Phpmyadmin .
Start by adding the official Zend debs to your distribution. ------------------------------------------------------------------------------------------------- sudo nano /etc/apt/sources.list -------------------------------------------------------------------------------------------------
And the following snipplet in the bottom of the file ------------------------------------------------------------------------------------------------- deb http://repos.zend.com/zend-server/deb server non-free -------------------------------------------------------------------------------------------------
All done, you now have Zend Server Community Edition installed!
Now we are Mysql ------------------------------------------------------------------------------------------------- And then MySQL:
#apt-get install mysql-server
#service mysqld start
#mysql_install_db
#/usr/bin/mysql_secure_installation
#chkconfig --levels 235 mysqld on
Install phpmyadmin :
#apt-get install phpmyadmin-zend-server-php-5.3 ------------------------------------------------------------------------------------------------- #vi /usr/local/zend/gui/lighttpd/etc/lighttpd.conf Search for 'phpmyadmin' and you should find the following code block:
To disable the security completely,
you can simply comment out this block. Alternatively, just replace the
IP Address with your own. Finally, we need to add Zend's bin and lib
directories to the system path and restart Zend. ------------------------------------------------------------------------------------------------- #vi /etc/profile
Add the following lines to the very end of this file:
Answer is simple, use nohup utility which
allows to run command./process or shell script that can continue running
in the background after you log out from a shell:
The problem with Subsonic is that it runs on Node.js on a non-standard
port. The rest of my web applications run in Apache on port 80.
Therefore, it would be nice if instead of having to go to http://example.com:8180/subsonic/, I could simply go to http://example.com.
The solution is called a reverse proxy. Reverse proxies can do things
like load balance between multiple web servers or simply make resources
on an internal web server available externally. In this case, I am using
a reverse proxy to make a web application available on a different port
available on the standard port 80. The set up is fairly simple. On Ubuntu, it should be as simple as issuing this command (as root) to enable the proxy modules:
<Directory /var/www/vhosts/path/to/folder>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location />
ProxyPass http://example.com:8180/
ProxyPassReverse http://example.com/
</Location>
</VirtualHost>