• -동두천 4.8℃
  • -강릉 14.6℃
  • 연무서울 8.0℃
  • 박무대전 7.4℃
  • 맑음대구 8.3℃
  • 맑음울산 12.5℃
  • 박무광주 8.2℃
  • 맑음부산 11.8℃
  • -고창 4.5℃
  • 맑음제주 10.6℃
  • -강화 2.3℃
  • -보은 3.6℃
  • -금산 3.0℃
  • -강진군 4.8℃
  • -경주시 5.4℃
  • -거제 8.1℃
기상청 제공

redmine 과 apache 연동하기

  • 등록 -0001.11.30 00:00:00

redmine 과 apache 연동하기 (by passenger)



1. passenger 설치


gem install passenger
passenger-install-apache2-module



만약 다음과 같이 설치 에러가 나온다면



Installation instructions for required software


 * To install Apache 2 development headers:

   Please download it from http://httpd.apache.org/


apt-get install apache2-prefork-dev

or

yum install httpd-devel apr-devel apr-util-devel


 * To install Apache Portable Runtime (APR) development headers:

   Please download it from http://httpd.apache.org/


 * To install Apache Portable Runtime Utility (APU) development headers:

   Please download it from http://httpd.apache.org/




다음과 같이 메모리가 모자랄 경우 에러메세지가 나온다
이경우에는 swap 메모리를 잡아준다.

Your compiler failed with the exit status 4. This probably means that it ran out of memory. To solve this problem, try increasing your swap space: https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04

Tasks: TOP => apache2 => buildout/agents/PassengerHelperAgent
(See full trace by running task with --trace)

--------------------------------------------

It looks like something went wrong

Please read our Users guide for troubleshooting tips:

   /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.23/doc/Users guide Apache.html

If that doesn't help, please use our support facilities. We'll do our best to help you.







2. 아파치 설정

만약 설치가 잘 끝났다면 다음과 같은 메세지가 나올 것이다.

The Apache 2 module was successfully installed.

Please edit your Apache configuration file, and add these lines:

   LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.23/buildout/apache2/mod_passenger.so
   PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.23
   PassengerDefaultRuby /usr/local/bin/ruby

After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!

Press ENTER to continue.


--------------------------------------------
Deploying a Ruby on Rails application: an example

Suppose you have a Rails application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:

   <VirtualHost *:80>
      ServerName www.yourhost.com
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /somewhere/public
      <Directory /somewhere/public>
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews
      </Directory>
   </VirtualHost>

And that's it! You may also want to check the Users Guide for security and
optimization tips, troubleshooting and other useful information:

  /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.23/doc/Users guide Apache.html

Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) :-)
https://www.phusionpassenger.com

Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.



완료메세지이면서 동시에 마지막 셋팅에 관련된 내용이 모두 들어있다.

apache의 conf에서 passenger 관련 모듈을 올려주고

virtual host 에서 실제 동작하게 될 위치를 지정해주면 모두 끝난다.

이때 주의할 점은

virtual host 설정시 실제 동작하게 될 위치를 redmine 내의 public 디렉토리를 기준으로 설정해줘야 한다.




2-1. 우분투의 경우 (13.04 기준)


자신의 실제 passenger 설치 화면에 떠 있던 관련 내용을 그대로 복사해서 작성해준다.

passenger.load 파일 생성

vi /etc/apache2/mods-available/passenger.load

LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.23/buildout/apache2/mod_passenger.so

passenger.conf 파일 생성

vi /etc/apache2/mods-available/passenger.conf

PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.23
PassengerDefaultRuby /usr/local/bin/ruby

passenger 적용

a2enmod passenger


virtual host 설정을 해준다.

vi /etc/apache2/sites-available/redmine


 <VirtualHost *:80>
      ServerName www.yourhost.com
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /somewhere/public
      <Directory /somewhere/public>
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews
      </Directory>
   </VirtualHost>

virtual host 설정을 적용해준다

an2ensite redmine

2-2. centos의 경우 (6.4 기준)

/etc/httpd/conf.d/passenger.conf

에 자동으로 설정 파일이 생성된다
이곳에서 실제 동작하게 될 redmine 위치를 설정해준다.




3. 아파치 재시작

service apache2 restart // ubuntu
or
service httpd restart  // centos

이후엔 정상적으로 접속해서 사용하면 된다.




참고: