Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Redmine deployment and installation manual under Centos system environment

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1 install mysql

Download mysql-5.0.51b.tar.gz to the directory / home/oemplat/, and create a new directory / home/oemplat/mysql/ after mysql installation

The commands to extract the file and install the configuration are as follows:

Cd / home/oemplat/

Tar-xzvf mysql-5.0.51b.tar.gz

Cd / home/oemplat/mysql-5.0.51b# enters the decompressed source directory

. / configure--prefix=/home/oemplat/mysql/-- with-charset=gbk-with-extra-charsets=gbk,utf8,ascli,big5,latin1,binary--with-unix-socket-path=/home/oemplat/mysql/mysql.sock--with-mysqld-user=mysql # configuration

Make # compilation

Make install # installation

Cd/home/oemplat/mysql & & mkdir data # create a data directory to store the database

Cd / home/oemplat/mysql/bin

. / mysql_install_db--user=mysql-- basedir=/home/oemplat/mysql--datadir=/home/oemplat/mysql/data# initializes the database

Cp/home/oemplat/mysql/share/mysql/my-medium.cnf / home/oemplat/mysql/my.cnf# configuration file

Cd/home/oemplat/mysql & & vim my.cnf # modify the configuration file. Mainly port,socket, etc. After this step, you can directly copy the set my.cnf.

/ home/oemplat/mysql/bin/mysqld_safe-defaults-file=/home/oemplat/mysql/my.cnf& # starts mysql background running and specifies the configuration file

2 install ruby

Download ruby-1.8.7-p302.tar.gz to the directory / home/oemplat/, and create a new directory / home/oemplat/ruby after ruby installation

The commands to extract the file and install the configuration are as follows:

Cd / home/oemplat/

Tar-xzvf ruby-1.8.7-p302.tar.gz

Cd ruby-1.8.7-p302

. / configure-- prefix=/home/oemplat/ruby

Make

Make install

It is recommended to add ruby to the system path after installation, so that you can directly use the ruby command as follows:

Cd / home/oemplat/ & & vim. / .bashrc # Editing the bashrc file

# add the following statement to the bashrc file

ExportPATH=/home/oemplat/ruby/bin:$PATH

3 install rubygem

Rubygems is ruby's online package management tool, which is used to install various components required by rails.

Download rubygems-1.3.5.zip to the directory / home/oemplat/, extract the file and install the command as follows:

Cd / home/oemplat

Unziprubygems-1.3.5.zip

Cdrubygems-1.3.5

Ruby setup.rb

4 install rails

Rails installation requires a lot of additional components, because the test machine is not connected to the Internet, so we need to download the relevant components and install them locally.

The version of rails we installed is 2.2.3, and the corresponding components are:

Gems1.3.5 / / has been installed in the previous step

Rake 0.8.7

Activesupport 2.2.3

Activerecord2.2.3

Actionmailser2.2.3

Actionresource2.2.3

Copy these components to the / home/oemplat/rails/ directory and install them in the following order and command:

Cd / home/oemplat/rails/

Gem installrake

The geminstall-l activesupport-2.2.3.gem #-l parameter indicates a local installation

Gem install-l activerecord-2.2.3.gem

Gem install-l actionpack-2.2.3.gem

Gem install-l actionmailer-2.2.3.gem

Gem install-l actionresource-2.2.3.gem

Geminstall-l rails-2.2.3.gem # install rails after all dependencies have been installed

Geminstall-l i18n-0.4.2.gem # install this component after installing rails

After the installation is complete, you will see the relevant gem installed files in the / home/oemplat/ruby/lib/ruby/gems/1.8/gems directory. You will also see commands such as rake,rails in the / home/oemplat/ruby/bin directory.

5 install redmine

Put the redmine_demo folder under / home/oemplat/, and then modify some configuration to ok.

Modify the / home/oemplat/redmine_demo/config/database.yml file to change the value of the relevant location to:

Production:

Adapter:mysql

Database:redmine

Host:localhost

Username:root

Password:

Encoding:utf8

Development:

Adapter:mysql

Database:redmine_development

Host: localhost

Username:root

Password:

Encoding:utf8

At this point, redmine has been installed, and redmine's own webrick server can be used to provide web services.

In order to start redmine, we also need to do some initialization work, such as importing the database, setting up the working environment, and so on. The specific steps are as follows:

1. Import database to mysql

As you can see from the configuration of database.yml above, the databases used in the case of production and development are redmine and redmine_development, respectively, so you need to establish these two databases in the mysql database. Let's just take production as an example. The configuration of development is similar.

Cd / home/oemplat/mysql

. / bin/mysql-uroot-S. / mysql.sock # login to the database

Mysql > createdatabase redmine; # create redmine database

Mysql > source/home/oemplat/redmine.sql # Import the redmine database, where redmine.sql is a pre-exported redmine database and is stored in the / home/oemplat directory

2. Set up the redmine environment

The previous step has imported the redmine database into mysql, which will migrate the database into the redmine project and set up the working environment.

Cd / home/oemplat/redmine_demo # enter the redmine project directory

Rake db:migrateRAILS_ENV= "production" # migrate database

Rakeredmine:load_default_data RAILS_ENV= "production" # loads the default data, that is, sets the environment

After executing this sentence, you will be asked to choose the default language and choose zh.

3. Start the redmine service

After the initialization configuration of 1 and 2, you can start the redmine service using the webrick server that comes with redmine.

Cd / home/oemplat/redmine_demo # enter the redmine project directory

Rubyscript/server webrick-e production-p 8000 # Startup Service, production environment, port 8000

Enter the http:// tester ip address: 8000 in the browser to access the redmine.

Because webrick is too slow, install mongrel and apache instead of webrick to serve.

6 install mongrel

Download the components needed to install mongel into the / home/oemplat/mongrel directory. The required components are:

Gem_plugin-0.2.3.gem

Cgi_multipart_eof_fix-2.5.0.gem

Daemons-1.1.4.gem

Rack-1.0.1.gem

Mongrel-1.1.5.gem

Install these components in turn (there may be something wrong with the installation order listed above, if not, change the installation order according to the error prompt), and the command is still gem install-l xxxxxx.gem

7 install apache

Download httpd-2.2.19.tar.gz to the directory / home/oemplat/, and create a new directory / home/oemplat/apache/ after apache installation

The commands to extract the file and install the configuration are as follows:

7.1 extract the file tar-xzvf httpd-2.2.19.tar.gz

7.2 install apr & apr-util

7.2.1 compile and install apr

Cd / home/oemplat/httpd-2.2.19/srclib/apr

. / configure-- prefix=/home/oemplat/apache/apr

Make

Make install

7.2.2 compile and install apr-util

Cd / home/oemplat/httpd-2.2.19/srclib/apr-util

. / configure--prefix=/home/oemplat/apache/apr-util--with-apr=/home/oemplat/apache/apr

7.3 change the apache source code

Execute the command vim./worker.c under path / home/oemplat/httpd-2.2.19/server/mpm/worker

Find the following lines and change them to the following values in order to modify the maximum number of threads and clients that apache can support in the source code.

# defineDEFAULT_SERVER_LIMIT 256

# defineMAX_SERVER_LIMIT 40000

# defineDEFAULT_THREAD_LIMIT 256

# defineMAX_THREAD_LIMIT 40000

7.4 compile and install apache

Cd/home/oemplat/httpd-2.2.19# enters the source directory

/ configure--prefix=/home/oemplat/apache/apache--enable-mods-shared=all-- enable-so--with-mpm=worker-- enable-deflate--enable-cache-- enable-disk-cache--enable-mem-cache-- enable-file-cache--enable-proxy-- enable-rewrite--enable-charset-lite-- enable-suexec--with-suexec-bin=/usr/sbin/suexec--disable-ipv6-disable-dav--with-apr=/home/oemplat/apache/apr- -with-apr-util=/home/oemplat/apache/apr-util/ # configuration

Make

Make install

7.5 change apache configuration

It mainly modifies the apache listening port, sets the support for cgi, and sets the balance polling mechanism for mongrel. In this step, you can copy the modified httpd.conf. The specific modifications are as follows:

Cd / home/oemplat/apache/apache/conf

Vimhttpd.conf

Change Listen80 to Listen8080 / / modify listening port

Change OptionsIndexesFollowSymLinks to Options Includes ExecCGI FollowSymLinks after removing the comments

Change AddHandlercgi-script.cgi to AddHandlercgi-script.cgi .pl after removing the comments

Add at the end of the file

ProxyRequestsOff

# set polling for mongrel

BalancerMember http://127.0.0.1:8011

BalancerMember http://127.0.0.1:8012

# BalancerMember http://127.0.0.1:8013

# BalancerMember http://127.0.0.1:8014

# BalancerMember http://127.0.0.1:8015

ServerNameoem.mi.baidu.com

DocumentRoot/home/oemplat/redmine_demo/public/

ProxyPass/p_w_picpath!

ProxyPass/stylesheets!

ProxyPass/javascripts!

ProxyPass/ balancer://myCluster/

ProxyPa***everse/ balancer://myCluster/

ProxyPreserveHoston

# add cgi support for redmine

OptionsIndexes ExecCGI FollowSymLinks

Orderallow,deny

Allowfrom all

AllowOverrideall

In order to work properly, you also need to make some changes to the configuration of redmine. Modify the dispatch.cgi in redmine_demo/public, mainly to modify the ruby path. You can refer to the dispatch.cgi that has been set up.

As you can see from the above configuration, apache has set up load balancing on ports 8011 and 8012 of mongrel, so the mongrel service should be enabled on these two ports

/ home/oemplat/redmine_demo/script/servermongrel-e production-p 8011

/ home/oemplat/redmine_demo/script/servermongrel-e production-p 8012

At this point, enter the ip address of the http:// tester in the browser: 8080 to access the redmine.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report