Set up the redmine environment, mail service configuration, and LDAP configuration in centos5

Source: Internet
Author: User
Tags i18n install openssl ldap email account redmine

I. As in the previous article, install the Apache server

Ii. Install MySQL

1. Download

: Http://dev.mysql.com/downloads/mysql/

Download the following three files:

MySQL-server-5.6.11-1.rhel5.i386.rpm

MySQL-client-5.6.11-1.rhel5.i386.rpm

MySQL-devel-5.6.11-1.rhel5.i386.rpm

Put the three files in the/user/local directory and start installation. (On the download page, select Oracle & Red Hat Linux 4 & 5)

2. Installation

[root@MYHOSTNAME ~]# cd /usr/local[root@MYHOSTNAME local]# rpm -ivh MySQL-client-5.6.11-1.rhel5.i386.rpm[root@MYHOSTNAME local]# rpm -ivh MySQL-server-5.6.11-1.rhel5.i386.rpm[root@MYHOSTNAME local]# MySQL-devel-5.6.11-1.rhel5.i386.rpm

3. Enter MySQL

Enter MySQL and an error is returned.

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Enter

/etc/init.d/mysql start

MySQL is started successfully.

Enter MySQL again and continue to report the following error:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

The solution is as follows.

(1) first shut down MySQL,/etc/init. d/MySQL stop

(2) Enter mysqld_safe -- user = MySQL -- skip-grant-tables -- skip-Networking & to enter the MySQL security mode.

(3) Enter mysql-u root MySQL

(4) Enter update user SET Password = PASSWORD ('000000') where user = 'root'; // set the password to 123456 for the root user

(5) Enter flush privileges; // make the change take effect immediately. Then quit.

At this point, we can enter MySQL again to enter MySQL normally.

4. Enter the MySQL database

Enter use MySQL. The error message is as follows:

ERROR 1820 (HY000): You must SET PASSWORD before executing this statement。

In this case, we should first set the password. Input

SET PASSWORD = PASSWORD('123456');use mysql

Now we can see the prompt

Database changed

Then we can switch to the MySQL database.

5. Set available IP addresses for other machines to access the database

Grant all privileges on *. * To 'root' @ '10. 52.11.83 'identified by '20140901'; // where *. * The preceding "*" is the database name, followed by "*" is the table name, and "10.52.11.83" is the IP address of the remotely accessed host. If you change the IP address to "%", it indicates that all machines are authorized, '123' indicates the Database Password flush privileges;

If you find that remote access is still not available, it may be caused by the firewall. I am suffering from this problem for a long time. Run the following command:

service iptables stop

6. Create a redmine Database

This step is to prepare for the subsequent redmine Data Structure generation.

create database redmine character set utf8;

7. modify the configuration file

If there is no my. CNF file under etc, copy a *. CNF file under/usr/share/MySQL and change it to my. CNF.

[Root @ myhostname local] # cp/usr/share/MySQL/my-medium.cnf/etc/My. CNF [root @ myhostname local] # vi/etc/My. CNF // pay attention to my. CNF permission, because my. the CNF permission problem occurs. MySQL cannot be started. Various prompts cannot find the PID file and MySQL cannot be found. the sock file is a waste of time for me to try to correct the errors in the morning.

Modify the following data:

[mysqld]port = 3306socket = /var/lib/mysql/mysql.sockdefault-character-set=utf8[client]default-character-set=utf8

8. Set MySQL to start automatically

[root@MYHOSTNAME local]# vi /etc/rc.d/rc.local

Join this line:

/etc/init.d/mysql start

Save and exit.

3. Install Ruby

1. Download

: Ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz

After the download is complete, put the file in the/user/local directory and start installation.

2. Installation

[root@MYHOSTNAME local]# tar zxf ruby-1.8.7-p72.tar.gz[root@MYHOSTNAME local]# cd ruby-1.8.7-p72[root@MYHOSTNAME ruby-1.8.7-p72]# ./configure --prefix=/usr/local/ruby --enable-pthread[root@MYHOSTNAME ruby-1.8.7-p72]# make && make install

3. Add environment variables to Ruby

[root@MYHOSTNAME ruby-1.8.7-p72]# vi /etc/profile

Modify the path and add:/usr/local/Ruby/bin // to the path. Note that there is a colon in front of it.

[Root @ myhostname ruby-1.8.7-p72] # source/etc/profile // be sure to add this line to make the environment variable settings take effect immediately, or restart your computer. I didn't add this sentence before, so the environment variables didn't take effect. I always thought I had configured an error and found the error for a long time.

4. Test

[root@MYHOSTNAME ruby-1.8.7-p72] # ruby -vruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]

After seeing the above Ruby information, we can see that Ruby is successfully configured.

4. Install rubygems

1. Download

: Http://files.rubyforge.vm.bytemark.co.uk/rubygems/rubygems-1.8.23.tgz

After the download is complete, put the file in the/user/local directory and start installation.

2. Installation

[root@MYHOSTNAME local]# tar xf rubygems-1.3.5.tgz[root@MYHOSTNAME local]# cd rubygems-1.3.5[root@MYHOSTNAME rubygems-1.3.5]# ruby setup.rb

3. Test

[root@MYHOSTNAME rubygems-1.3.5]# gem -v1.3.5

After seeing the above version information, we can see that rubygems is successfully installed.

5. Install rails on Ruby

1. Install

[root@MYHOSTNAME local]# gem install rails -v=2.3.5

2. Verify

[root@MYHOSTNAME local]# rails –vRails 2.3.5

After reading the above version information, we can see that rails on Ruby is successfully installed.

6. Install i18n

[root@MYHOSTNAME local]# gem install i18n -v=0.4.2

7. Install the MySQL driver

[root@MYHOSTNAME local]# gem install ruby-mysql

8. Install redmine

1. Download

: Http://files.rubyforge.vm.bytemark.co.uk/redmine/redmine-1.1.0.tar.gz

After the download is complete, put the file in the/user/local directory and start installation.

2. Installation

[Root @ myhostname local] # tar zxvf redmine-1.1.0.tar.gz (Folder name changed to redmine after decompression) [root @ myhostname local] # cd redmine [root @ myhostname redmine] # cp config/database. yml. example config/database. yml [root @ myhostname redmine] # vi config/database. yml

Modify the content of this file:

production:adapter: mysqldatabase: redminehost: localhostusername: rootpassword: 123456socket: /var/lib/mysql/mysql.sock

Note: there is a space behind the colon.

[Root @ myhostname redmine] # rake generate_session_store // generate a storage key

At this time, an error is reported. The error prompt is as follows:

ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead.

It shows that rake has not been installed. Start to install rake now.

[Root @ myhostname redmine] # gem install-V = 0.8.7 rake // if a problem persists after performing this step, check whether there is a higher version of rake in your computer, uninstall the version, the uninstall statement is Gem uninstall-V = 0.8.7 rake [root @ myhostname redmine] # rake generate_session_store // It is no problem to come back after rake is installed. [root @ myhostname redmine] # rake DB: migrate rails_env = "production" // generate a Data Structure

At this time, an error is reported. Let's take a look at the error message:

no such file to load – openssl

This prompt is also very obvious, we have not installed OpenSSL.

Download this file at http://www.openssl.org/and then start the installation.

[root@MYHOSTNAME local]# tar zvxf openssl-0.9.8k.tar.gz[root@MYHOSTNAME local]# cd openssl-0.9.8k[root@MYHOSTNAME openssl-0.9.8k]# make && make install[root@MYHOSTNAME openssl-0.9.8k]# cd /usr/local/ruby-1.8.7-p72/ext/openssl[root@MYHOSTNAME openssl]# ruby extconf.rb --with-openssl-include=/usr/local/ssl/include/ --with-openssl-lib=/usr/local/ssl/lib[root@MYHOSTNAME openssl]# make && make install

After the problem is solved, we will continue to generate the data structure.

[Root @ myhostname redmine] # rake DB: migrate rails_env = "production" // this step is successful after the problem is resolved [root @ myhostname redmine] # rake redmine: load_default_data rails_env = "production" // load the default configuration. The default language is required, select Chinese ZH [root @ myhostname redmine] # Ruby script/Server webrick-e production // use redmine's webrick to start redmine. Note that, it must be in the redmine directory when starting. If it is not in the directory, pay attention to the script/server path. You can try it.

In this case, redmine should be successfully started.

3. Test

Enter http: // localhost: 3000 in the browser or http://XX.XX.XX.XXX: 3000/(xx. xx. XXX. XXX is the local IP address) to see the redmine page. This indicates that redmine is successful.

Note: here we need to modify the permissions of each redmine folder. Because of the folder permissions, an error occurred while uploading attachments.

IX. Integration of redmine and Apache

1. There is no mod_rails on Apache. Install it first.

First modify the SELinux Configuration

vi /etc/sysconfig/selinux

Modify this behavior disable

SELINUX=disable

Then install passenger.

gem install passengerpassenger-install-apache2-module

See the following prompt to install the corresponding package according to the error prompt. The error message is as follows:

* GNU C++ compiler... not found   * Curl development headers with SSL support... not found   * OpenSSL development headers... not found   * Zlib development headers... not found* Apache 2 development headers... not found   * Apache Portable Runtime (APR) development headers... not found   * Apache Portable Runtime Utility (APU) development headers... not found

Install the missing package:

yum install gcc-c++yum install curl-develyum install openssl-develyum install zlib-develyum install httpd-develyum install apr-develyum install apr-util-devel

Then run the passenger-install-apache2-module, that is, the installation is successful, please note the prompt information in the middle of the installation (will write the content of httpd. conf to be configured, you can directly copy the use)

2. Add passenger to Apache

Note that this paragraph of text will be given after the installation of the passenger-install-apache2-module, as far as possible to directly copy the use, add your own very easy to error, I am because of this problem tossing a night plus a morning, this is because we have written bin as Lib.

LoadModule passenger_module /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/ext/apache2/mod_passenger.soPassengerRoot /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19PassengerRuby /usr/local/ruby/bin/ruby

3. Modify environment. Rb

vi config/environment.rb

Remove the preceding # of env ['rails _ env'] | = 'production'

4. Configure the public/dispath. cgi script in the redmine source code directory.

cd /usr/local/ redminecp public/dispatch.cgi.example public/dispatch.cgi

Change the first line #! /Usr/local/Ruby/bin/Ruby

5. Edit the Apache main configuration file

vi /etc/httpd/conf/httpd.conf

Add the following content:

Listen 8080<VirtualHost *:8080>    ServerAdmin redmine@archermind.com    DocumentRoot /usr/local/redmine/public    ErrorLog logs/redmine_error_log    <Directory "/usr/local/redmine/public">        AllowOverride AllOptions -MultiViews    </Directory></VirtualHost>

6. Test

Enter http: // localhost: 8080 or http://XX.XX.XX.XXX: 8080/in the browser to access the successful, the default background login account is admin, admin (XX. XX. XX. XXX is the IP address of your server)

10. redmine LDAP Authentication

1. log on to the background, and log on to admin and Admin. Select administration, LDAP authentication, and new Authentication Mode to go to the configuration page.

2. Configure, as shown in

3. Click OK after the configuration is complete, and then click test in the list. The connection test is successful.

11. redmine email server configuration

1. Modify the redmine mail configuration file

cd /usr/local/redmine/configcp email.yml.example email.ymlvi email.yml

Modify the configuration file

production:  delivery_method: :async_smtp  smtp_settings:    address: smtp.sina.com.cn    port: 25    domain: sina.com.cn    authentication: :login    user_name: "XXXXX@sina.com.cn"    password: "XXXXX"

Note: The SMTP server of Sina and the password of my account are used here. If you want to use other products, you can modify them accordingly.

2. Restart the Apache server, log on to the redmine background using admin, select administration, select Settings, select the Email Notifications tab, and modifyEmission email addressRestart Apache and click send a test email to send a test email. If the configuration is correct, the message is sent successfully.

Note: RememberEmission email addressThe email account you set up here must be your email. the user_name set in yml is completely consistent. Otherwise, the test email can be sent successfully. However, if you create an issue and modify the status, the email cannot be received.

3. select administration, then settings, select the General tab, and set host name and path to: XX. XX. XX. XXX: 8080 and save the email so that the address in the received email is normal.

Note: This is the installation manual on the official website. For details, refer. Http://www.redmine.org/projects/redmine/wiki/redmineinstall. In particular, install different redmine versions. Remember to check the instructions on the official website.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.