Rhodecodeのインストールとちょっとした設定

Rhodecode https://rhodecode.com/ は、GitlabやGitoliteのようなPython製のWebUI - インストール(Use SQLite) - 言語設定 - ReverseProxy設定

Rhodecodeのインストールとちょっとした設定

Rhodecodeインストール

インストールログ

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
rhodecode@ubuntu1204-4:/home/rhodecode$ mkdir rhodecode
rhodecode@ubuntu1204-4:/home/rhodecode$ cd rhodecode
rhodecode@ubuntu1204-4:/home/rhodecode/rhodecode$ wget https://rhodecode.com/dl/rhodecode-installer.py
rhodecode@ubuntu1204-4:/home/rhodecode/rhodecode$ sudo python rhodecode-installer.py

RhodeCode Installer 0.7.0
-------------------------

I am your assistant for installing, upgrading & adjusting of RhodeCode Enterprise. You can always quit me by typing 'q' on the prompt.

RhodeCode Installer 0.7.0
-------------------------

Do you already have RhodeCode or RhodeCode Enterprise installed on this server?
[y]es
[n]o
> n
'n'

RhodeCode Installer 0.7.0
-------------------------

Under which Linux user do you want to install RhodeCode Enterprise?
> rhodecode
Creating folder /home/rhodecode/rhodecode/data ...
Creating folder /home/rhodecode/rhodecode/system ...
Creating folder /home/rhodecode/rhodecode/repos ...

RhodeCode Installer 0.7.0
-------------------------

Currently I am supporting proxy servers with username:password authentication (called basic auth) and proxy servers without authentication.

Do you need to connect through a proxy server with the Internet?
[y]es
[n]o
> n

RhodeCode Installer 0.7.0
-------------------------

Please select an option:
[1] Install RhodeCode Enterprise
[0] Upgrade RhodeCode Installer
[q] Quit installer
> 1

RhodeCode Installer 0.7.0
-------------------------

RhodeCode Installer 0.7.0
-------------------------

Please wait, I am downloading & installing the dependencies. This may take up to 5 minutes ...
... running command: sudo apt-get update -y
... running command: sudo apt-get install python-dev build-essential git -y
... running command: sudo apt-get install libpq-dev libmysqlclient-dev -y
... running command: sudo apt-get install libldap2-dev libsasl2-dev libssl-dev -y
I installed the dependencies.
Please wait, I am downloading ...
Please wait, I am unzipping the download ...
Please wait, I am downloading ...
Please wait, I am unzipping the download ...
Please wait, I am installing ...
Please wait, I am creating the configuration files ...
I successfully installed RhodeCode Enterprise for you. Starting setup now ...

RhodeCode Installer 0.7.0
-------------------------

Now I want to run the initial setup and create the first RhodeCode Enterprise user. The user will get administrator rights. For that I need to ask you the email, username and password for that user account. Please do not enter spaces to avoid issues.

Please enter the email address:
> username@example.com

Please enter the username:
> username

Please enter a password for the user:
>

Please enter the same password again:
>

RhodeCode Installer 0.7.0
-------------------------

I need to store that admin user in a database. Important: For MySQL and PostgreSQL the database must already exist! For SQLite everything is automatically created.

What database do you use?
[s]qlite (built-in, no server needed)
[m]ysql
[p]ostgresql
> s

RhodeCode Installer 0.7.0
-------------------------

Now I need to store all data in the database to finish the setup.

Please wait, I am creating the admin user and run the initial database setup ...

RhodeCode Installer 0.7.0
-------------------------

I try to install the service to /etc/init.d/rhodecode ...

Please wait, I am downloading the init.d file for your operating system ...

Please wait, I am customizing the init.d file for your installation ...

I create the log folder /var/log/rhodecode if not existing, yet ...
... running command: sudo mkdir /var/log/rhodecode

I create the log file /var/log/rhodecode/rhodecode.log if not existing, yet ...
... running command: sudo touch /var/log/rhodecode/rhodecode.log

I set the proper write permissions for the log file ...
... running command: sudo chmod 0666 /var/log/rhodecode/rhodecode.log

I copy the init.d file to /etc/init.d/rhodecode ...
... running command: sudo cp /tmp/rhodecode-initd-template /etc/init.d/rhodecode

I make the file /etc/init.d/rhodecode executable ...
... running command: sudo chmod +x /etc/init.d/rhodecode

I am verifying the correct installation of the init.d file ...

I am trying to restart the new service ...
... running command: sudo /etc/init.d/rhodecode restart

RhodeCode Installer 0.7.0
-------------------------

The RhodeCode Enterprise service was installed and is already running on port 5000!

You can start, stop, restart and get the status of the service with:
sudo /etc/init.d/rhodecode {start|stop|restart|status}

Please select an option:
[b] Back to menu
[q] Quit Installer
> q

Thanks, it was a pleasure to be your assistant!


rhodecode@ubuntu1204-4:/home/rhodecode/rhodecode$
  • インストールユーザとは異なるユーザがインストールすることもできるけど、/home/<usename>にインストールしようとするから権限周り面倒ですよ。

言語設定

デフォルトは英語なので、WebUIを日本語表記に変更する。

data/production.ini

1
2
3
## Optional Languages
## en, fr, ja, pt_BR, zh_CN, zh_TW, pl, ru
lang = ja

再起動

1
$ sudo /etc/init.d/rhodecode restart

ReverseProxy設定

WebサーバとRhodecodeサーバを分ける場合に、サブディレクトリでのアクセスを行う場合

data/production.ini

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
host = 0.0.0.0

## prefix middleware for rc
[filter:proxy-prefix]
use = egg:PasteDeploy#prefix
prefix = /rhodecode

[app:main]
use = egg:rhodecode
## enable proxy prefix middleware
filter-with = proxy-prefix

再起動

1
$ sudo /etc/init.d/rhodecode restart
Built with Hugo
テーマ StackJimmy によって設計されています。