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
************************************************************************************************
centos安装redmine一些潦草的记录
最新推荐文章于 2024-04-30 03:31:40 发布