centos安装redmine一些潦草的记录


telnet 223.99.62.203 30002

telnet 121.22.33.123 8080


************************************************************************************************
gem source -l # 查看当前镜像源  
gem source --remove https://gems.ruby-china.org/  
gem source -a https://ruby.taobao.org #新增gem的镜像源(确保只有ruby.taobao.org)  




gem source --remove https://ruby.taobao.org/




gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/


gem source -a https://gems.ruby-china.org/
gem source --remove http://rubygems.org/


--ruby=/usr/local/rvm/rubies/ruby-2.4.1/bin/$(RUBY_BASE_NAME)
************************************************************************************************
cd /data/redmine
chown -R apache:apache redmine
chmod -R 755 redmine
service httpd restart
************************************************************************************************
gem -v 
ruby -v
rails -v


************************************************************************************************
rvm list known #最好不要安装2.0以下的版本  
rvm install ruby-1.9.3-p551 #  


rvm list


rvm remove 1.9.2
************************************************************************************************


************************************************************************************************
redmin和ruby版本
http://www.redmine.org/projects/redmine/wiki/RedmineInstall




************************************************************************************************
修改 /etc/profile 文件,在文件末尾加上如下两行代码 
PATH=$PATH:/usr/local/MATLAB/R2013a/bin 
export PATH


最后执行命令 source /etc/profile 或执行点命令 ./profile 使其修改生效。
************************************************
安装rvm及ruby


rvm 可以安装管理多个ruby版本


gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3    


curl -L https://get.rvm.io | bash -s stable


source /etc/profile.d/rvm.sh  #set up system environment for Ruby, 这步不可少


rvm reload   


rvm install 2.3.3
简单的使用


rvm list 查看ruby


rvm use 2.2.0  使用ruby


rvm install xxxx 安装一个版本的ruby
 
rvm remove  xxxx   卸载一个版本的ruby


pgrading the RVM installation in /usr/local/rvm/
Upgrade of RVM in /usr/local/rvm/ is complete.


************************************************************************************************
安装rails及rake


上一步安装完成之后,下面的就很简单了.


如果嫌慢可以换阿里的源
gem source -l 
gem source -r https://rubygems.org/
--gem source -a http://mirrors.aliyun.com/rubygems/
gem source -a https://gems.ruby-china.org/


安装


gem install rake -v 12.0.0
gem install rails -v 4.2.6
************************************************************************************************
    5、创建一个session安装密钥


[root@bogon redmine]# rake generate_secret_token




     6、创建初始化所有redmine用到的table表


[root@bogon redmine]# RAILS_ENV=production rake db:migrate




    7、装入默认的配置信息,输入zh(选择中文)


[root@bogon redmine]# RAILS_ENV=production rake redmine:load_default_data
************************************************************************************************
启动启动
rails server webrick -e production -d


关闭关闭
ps -aux |grep ruby
kill -s 9  进程号
************************************************************************************************
iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 3000 -j ACCEPT
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3000 -j ACCEPT 
查看已添加的iptables规则


iptables -L -n -v


************************************************************************************************


可以使用


curl http://localhost:3000
检查,没问题的话,使用Nginx做个反向代理就可以了.


server {


    listen 80;
    server_name redmine.xxx.com;


    access_log  logs/redmine_access.log main;
    error_log  logs/redmine_error.log;




    location / {
        proxy_pass http://localhost:3000;
    }


}




************************************************************************************************
ruby-2.4.1 - #gemset created /usr/local/rvm/gems/ruby-2.4.1@global
ruby-2.4.1 - #importing gemset /usr/local/rvm/gemsets/global.gems..............................
ruby-2.4.1 - #generating global wrappers........
ruby-2.4.1 - #gemset created /usr/local/rvm/gems/ruby-2.4.1
ruby-2.4.1 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list




-ruby=/usr/local/rvm/rubies/ruby-2.4.1/bin/$(RUBY_BASE_NAME)
************************************************************************************************
cat /proc/version
lsb_release -a


************************************************************************************************
今天在某台64位LInux下编译一个简单的hello world的C程序,报错:


[plain] view plain copy
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o: could not read symbols: File in wrong format  


查看该文件的格式,竟然是32位的:
[plain] view plain copy
# file /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o  
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.18, not stripped  


查看glibc-devel版本:
[plain] view plain copy
# yum info glibc-devel  
Installed Packages  
Name        : glibc-devel  
Arch        : i686  
Version     : 2.12  
Release     : 1.149.el6_6.5  
Size        : 955 k  
Repo        : installed  
From repo   : 6ASU5-updates  
Summary     : Object files for development using standard C libraries.  
URL         : http://sources.redhat.com/glibc/  
License     : LGPLv2+ and LGPLv2+ with exceptions and GPLv2+  
Description : The glibc-devel package contains the object files necessary  
            : for developing programs which use the standard C libraries (which are  
            : used by nearly all programs).  If you are developing programs which  
            : will use the standard C libraries, your system needs to have these  
            : standard object files available in order to create the  
            : executables.  
            :   
            : Install glibc-devel if you are going to develop programs which will  
            : use the standard C libraries.  
  
Available Packages  
Name        : glibc-devel  
Arch        : x86_64  
Version     : 2.12  
Release     : 1.149.el6_6.5  
Size        : 983 k  
Repo        : 6ASU5-updates  
Summary     : Object files for development using standard C libraries.  
URL         : http://sources.redhat.com/glibc/  
License     : LGPLv2+ and LGPLv2+ with exceptions and GPLv2+  
Description : The glibc-devel package contains the object files necessary  
            : for developing programs which use the standard C libraries (which are  
            : used by nearly all programs).  If you are developing programs which  
            : will use the standard C libraries, your system needs to have these  
            : standard object files available in order to create the  
            : executables.  
            :   
            : Install glibc-devel if you are going to develop programs which will  
            : use the standard C libraries.  






在其他正常的64位机器上,发现是有/usr/lib64/crt1.o文件的,而问题机器却没有改文件,只有/usr/lib/crt1.o文件。




询问牛人,牛人用了以下命令查看正常机器上的crt1.o文件:


[plain] view plain copy
# rpm -qf /usr/lib64/crt1.o   
glibc-devel-2.12-1.149.el6_6.5.x86_64  


原来是问题机器只安装了glibc-devel.i686,没有安装glibc-devel.x86_64,用yum安装即可:
[plain] view plain copy
yum install glibc-devel.x86_64  
安装成功后,一切正常!!!






************************************************************************************************
##添加规则,让外网正常访问
  # vi /etc/sysconfig/iptables
 # 进入编辑模式,在末尾添加一条规则
     -I INPUT -p TCP --dport 80 -j DROP
  # 保存
  # 重启防火墙,命令:service iptables restart 或者 /etc/init.d/iptables restart


##关闭防火墙,不推荐
 # /etc/init.d/iptables stop(临时关闭吧)
 # chkconfig –level 35 iptables off(永久关闭,这个是把自启动服务去掉了)
************************************************************************************************
service httpd restart 


************************************************************************************************
##添加规则,让外网正常访问
  # vi /etc/sysconfig/iptables
 # 进入编辑模式,在末尾添加一条规则
     -I INPUT -p TCP --dport 80 -j DROP
  # 保存
  # 重启防火墙,命令:service iptables restart 或者 /etc/init.d/iptables restart


##关闭防火墙,不推荐
 # /etc/init.d/iptables stop(临时关闭吧)
 # chkconfig –level 35 iptables off(永久关闭,这个是把自启动服务去掉了)
************************************************************************************************
#反向代理设置
<VirtualHost *:80>
    ServerAdmin prograsliu@gmail.com
    DocumentRoot "D:/www/test"
    ServerName www.test.com
    ServerAlias test.com
    ErrorLog "logs/test.com-error.log"
    CustomLog "logs/test.com-access.log" common    
    Alias /sublook "D:/www/test/look/sublook/"
    <Directory "D:/www/test">
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    
    #反向代理设置
    ProxyPass /proxy http://www.proxypass.com/proxy
    ProxyPassReverse /proxy http://www.proxypass.com/proxy


</VirtualHost>
************************************************************************************************
apache设置


<VirtualHost *:80>
    ServerAdmin prograsliu@gmail.com
    DocumentRoot "D:/www/proxypass"
    ServerName www.proxypass.com
    ServerAlias proxypass.com
    <Directory "D:/www/proxypass">
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
************************************************************************************************
[root@localhost ~]# service iptable status      ---查看防火墙状态


[root@localhost ~]#servcie iptables stop           --临时关闭防火墙


[root@localhost ~]#service iptables start          --临时启动防火墙


[root@localhost ~]#service iptables restart          --重启防火墙


[root@localhost ~]#chkconfig iptables off          --永久关闭防火墙


[root@localhost ~]#chkconfig iptables on          --永久开启防火墙


************************************************************************************************
安装redmine的apache支持,这样可以通过apache访问


gem install passenger
passenger-install-apache2-module


命令执行完后按照提示进行配置http:


vim /etc/httpd/conf.d/passenger.conf
  LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.5/buildout/apache2/mod_passenger.so
  <IfModule mod_passenger.c>
    PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.5
    PassengerDefaultRuby /usr/local/rvm/gems/ruby-1.9.3-p551/wrappers/ruby
  </IfModule>


 


vim /etc/http/conf.d/redmine.conf
  <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
        # Uncomment this if you're on Apache >= 2.4:
        #Require all granted
      </Directory>
  </VirtualHost>


由于我们的redmine还没有安装,因此路径暂时还不配置,等按完redmine后在来配置具体路径,注意root目录必须是redmine下的public目录。 
************************************************************************************************
rake generate_secret_token


初始化redmine数据库表名


RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data


************************************************************************************************






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你可以参考以下步骤来安装 Redmine: 1. 首先,确保你已经安装CentOS 操作系统。 2. 安装必要的软件包: ``` sudo yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel sqlite-devel ``` 3. 安装 Ruby: ``` cd /usr/local/src sudo wget https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.3.tar.gz sudo tar zxvf ruby-2.6.3.tar.gz cd ruby-2.6.3 sudo ./configure --disable-install-doc sudo make sudo make install ``` 4. 安装 Redmine: ``` cd /usr/local/src sudo wget https://www.redmine.org/releases/redmine-4.1.1.tar.gz sudo tar zxvf redmine-4.1.1.tar.gz sudo mv redmine-4.1.1 /var/www/redmine cd /var/www/redmine sudo gem install bundler sudo bundle install --without development test ``` 5. 配置数据库: ``` sudo yum install -y mariadb-server mariadb-devel sudo systemctl start mariadb sudo systemctl enable mariadb sudo mysql_secure_installation sudo mysql -u root -p CREATE DATABASE redmine CHARACTER SET utf8mb4; CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost'; FLUSH PRIVILEGES; exit ``` 6. 配置 Redmine: ``` cd /var/www/redmine sudo cp config/configuration.yml.example config/configuration.yml sudo vi config/configuration.yml 修改数据库配置: production: adapter: mysql2 database: redmine host: localhost username: redmine password: "password" encoding: utf8mb4 sudo cp config/database.yml.example config/database.yml sudo vi config/database.yml 修改数据库配置: production: adapter: mysql2 database: redmine host: localhost username: redmine password: "password" encoding: utf8mb4 sudo bundle exec rake generate_secret_token sudo RAILS_ENV=production bundle exec rake db:migrate sudo RAILS_ENV=production REDMINE_LANG=zh bundle exec rake redmine:load_default_data sudo chown -R apache:apache files log tmp public/plugin_assets sudo chmod -R 755 files log tmp public/plugin_assets ``` 7. 配置 Apache: ``` sudo yum install -y httpd sudo systemctl start httpd sudo systemctl enable httpd sudo vi /etc/httpd/conf.d/redmine.conf 添加以下内容: <VirtualHost *:80> ServerName redmine.example.com DocumentRoot /var/www/redmine/public <Directory /var/www/redmine/public> AllowOverride all Require all granted </Directory> </VirtualHost> sudo systemctl restart httpd ``` 8. 访问 Redmine: 在浏览器中输入 http://redmine.example.com,即可访问 Redmine。 希望这些步骤能够帮助你成功安装 Redmine

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值