ä¼ç¤¾ã§Git使ãããã£ã¦è¨ã£ãããµã©ãã¨OKãåºãã
ãã ãGitBucketãèªåã§ãã¦ãªãããããªãã®ã§ãããæ¹ã調ã¹ã¨ãã
ä¼ç¤¾ã§ã¯CentOSãµã¼ããã触ã£ã¦ããç°å¢ã¨ãã¦ä¸ãã¦ããããã®ã§ã家ã®Macã«VirtualBoxå
¥ãã¦ãCentOSããã¦ã¦è©¦ãã¦ã¿ãï¼
ç°å¢
VirtualBox 4.3.28
CentOS-7-x86_64-Minimal-1503-01.iso
VirtualBoxã®CentOSã«sshæ¥ç¶ããã¾ã§ã®è¨å®ã¯âã®ãã¼ã¸ãã¿ãªãããã£ãï¼
VirtualBoxにCentOS7をインストールしてみる - yk5656 diary
CentOS6ã¨CentOS7ã§ã¯ããããã¯ã¼ã¯è¨å®ã®ããæ¹ãå
¨ç¶éã£ã¦ããã®ã§æ³¨æï¼
JDKãã¤ã³ã¹ãã¼ã«ãã
âã®ã³ãã³ããæã¤ã¨ãã¤ã³ã¹ãã¼ã«ã§ãããjdkããã£ã±ãã§ã¦ããã®ã§ãããdevelããã¤ãã¦ããã®ãã¤ã³ã¹ãã¼ã«ãã
[root@localhost ~]# yum search openjdk
[root@localhost ~]# yum install java-1.8.0-openjdk-devel.x86_64
[root@localhost ~]# java -version openjdk version "1.8.0_45" OpenJDK Runtime Environment (build 1.8.0_45-b13) OpenJDK 64-Bit Server VM (build 25.45-b02, mixed mode)
ç°å¢å¤æ°ãè¨å®ããã
ã¦ã¼ã¶åãæ¿ããã¦ãã¦ã¼ã¶ã®.bashrcãç·¨éããã
[root@localhost ~]# su <<ã¦ã¼ã¶å>> [syobochim@localhost root]$ cd ~ [syobochim@localhost ~]$ ls -la åè¨ 12 drwx------. 2 syobochim syobochim 59 5æ 31 17:03 . drwxr-xr-x. 3 root root 22 5æ 31 17:05 .. -rw-r--r--. 1 syobochim syobochim 18 3æ 6 07:06 .bash_logout -rw-r--r--. 1 syobochim syobochim 193 3æ 6 07:06 .bash_profile -rw-r--r--. 1 syobochim syobochim 231 3æ 6 07:06 .bashrc
javaã®å ´æãç¥ãããã¨ãã¯â
[syobochim@localhost ~]$ which java /usr/bin/java
.bashrcã«âã追è¨ãã
export JAVA_HOME=/usr/bin/java
sourceã§ãã¡ã¤ã«ãåèªã¿è¾¼ã¿ããã°ãå¤ãè¨å®ãããã
[syobochim@localhost ~]$ source .bashrc [syobochim@localhost ~]$ echo $JAVA_HOME /usr/bin/java
Jettyãé ç½®
Jettyãåå¾ããã
Jetty Download Redirectã«ãã£ã¦ã欲ãããã¼ã¸ã§ã³ã®ãªã³ã¯ãã³ãã¼
[syobochim@localhost ~]$ wget http://download.eclipse.org/jetty/stable-9/dist/jetty-distribution-9.2.11.v20150529.tar.gz bash: wget: ã³ãã³ããè¦ã¤ããã¾ãã
ãã£ãwgetã³ãã³ãããã®ã¾ã¾ã§ã¯å ¥ã£ã¦ããªãã®ã§ãyumã¤ã³ã¹ãã¼ã«ããã
[syobochim@localhost ~]$ sudo yum install wget
ã¤ã³ã¹ãã¼ã«ãå®äºããããâã§ã¤ã³ã¹ãã¼ã«ãã§ããã
[syobochim@localhost ~]$ wget http://download.eclipse.org/jetty/stable-9/dist/jetty-distribution-9.2.11.v20150529.tar.gz
ãã¡ã¤ã«ã解å
[syobochim@localhost ~]$ tar zxvf jetty-distribution-9.2.11.v20150529.tar.gz
/optã®é
ä¸ã«ç§»åï¼renameããã
/optã¯è¿½å ã¢ããªã±ã¼ã·ã§ã³ã®ã½ããã¦ã§ã¢ã»ããã±ã¼ã¸ãªã©ã®ããã®ãã£ã¬ã¯ããªã
åèï¼はじめてのCentOS ディレクトリ構造とファイル
ä»åã¯ãèµ·åãããããµã¼ãã¹ãgitBucketãªã®ã§ããã©ã«ãåãgitbucketã«ãã¦ããã
[syobochim@localhost ~]$ sudo mv jetty-distribution-9.2.11.v20150529 /opt/gitbucket
jettyãèµ·åããããã®ユーザを作成ï¼gitbucketフォルダの所有者を変更ããã
[syobochim@localhost opt]$ sudo useradd -m jetty [syobochim@localhost opt]$ sudo chown -R jetty:jetty /opt/gitbucket/
Jettyã®シンボリックリンクããèµ·åã¹ã¯ãªããã«è¿½å ããã
[syobochim@localhost opt]$ sudo ln -s /opt/gitbucket/bin/jetty.sh /etc/init.d/gitbucket
gitbucketã¨ããååã®ãµã¼ãã¹(å®æ
ã¯jetty)ããµã¼ãã¹ã«è¿½å ããã
ã©ã³ã¬ãã«ã®èª¬æï¼第10章 サービスとデーモン
chkconfigï¼
10.2.3. chkconfig ユーティリティの使用
[syobochim@localhost opt]$ sudo chkconfig --add gitbucket [syobochim@localhost opt]$ sudo chkconfig --level 345 gitbucket on [syobochim@localhost opt]$ sudo chkconfig --list 注è¨: ãã®åºå㯠SysV ãµã¼ãã¹ã®ã¿ã§ããããã¤ãã£ã㪠systemd ã®ãµã¼ãã¹ã¯å«ã¾ãã¦ãã¾ããã systemd services. SysV è¨å®ã®ãã¼ã¿ã¯ãã¤ãã£ã㪠systemd ã®è¨å®ã«ãã£ã¦ä¸æ¸ãããã¾ãã systemd ãµã¼ãã¹ãä¸è¦§è¡¨ç¤ºããã«ã¯ 'systemctl list-unit-files' ã使ç¨ãã¦ãã ããã ç¹å®ã®ã¿ã¼ã²ããã«ããã¦æå¹åããã¦ãããµã¼ãã¹ã確èªããã«ã¯ã 'systemctl list-dependencies [target]' ã gitbucket 0:off 1:off 2:off 3:on 4:on 5:on 6:off netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
è¨å®ãã¡ã¤ã«ãç·¨éããã
[syobochim@localhost opt]$ sudo vi /etc/default/gitbucket
JETTY_HOME=/opt/gitbucket JETTY_USER=jetty JETTY_PORT=8080 JETTY_HOST=192.168.56.10 JETTY_LOGS=/opt/gitbucket/logs/
GitBucketããããã¤ããããã«warãåå¾ãã¦ãjettyã®webappsãã©ã«ãã«é ç½®ããã
[syobochim@localhost gitbucket]$ cd /opt/gitbucket/webapps [syobochim@localhost webapps]$ sudo wget https://github.com/takezoe/gitbucket/releases/download/3.3/gitbucket.war --2015-05-31 18:38:32-- https://github.com/takezoe/gitbucket/releases/download/3.3/gitbucket.war github.com (github.com) ãDNSã«åããããã¦ãã¾ã... 192.30.252.130 github.com (github.com)|192.30.252.130|:443 ã«æ¥ç¶ãã¦ãã¾ã... æ¥ç¶ãã¾ããã HTTP ã«ããæ¥ç¶è¦æ±ãéä¿¡ãã¾ãããå¿çãå¾ ã£ã¦ãã¾ã... 302 Found å ´æ: https://s3.amazonaws.com/github-cloud/releases/9350746/6171eb5a-078f-11e5-9931-31687bd87558.war?response-content-disposition=attachment%3B%20filename%3Dgitbucket.war&response-content-type=application/octet-stream&AWSAccessKeyId=AKIAISTNZFOVBIJMK3TQ&Expires=1433078779&Signature=6K3EHrHIuoj4zJpoc892362WktU%3D [ç¶ã] --2015-05-31 18:38:33-- https://s3.amazonaws.com/github-cloud/releases/9350746/6171eb5a-078f-11e5-9931-31687bd87558.war?response-content-disposition=attachment%3B%20filename%3Dgitbucket.war&response-content-type=application/octet-stream&AWSAccessKeyId=AKIAISTNZFOVBIJMK3TQ&Expires=1433078779&Signature=6K3EHrHIuoj4zJpoc892362WktU%3D s3.amazonaws.com (s3.amazonaws.com) ãDNSã«åããããã¦ãã¾ã... 54.231.244.8 s3.amazonaws.com (s3.amazonaws.com)|54.231.244.8|:443 ã«æ¥ç¶ãã¦ãã¾ã... æ¥ç¶ãã¾ããã HTTP ã«ããæ¥ç¶è¦æ±ãéä¿¡ãã¾ãããå¿çãå¾ ã£ã¦ãã¾ã... 200 OK é·ã: 54920277 (52M) [application/octet-stream] `gitbucket.war' ã«ä¿åä¸ 100%[========================================================================>] 54,920,277 3.48MB/s æé 16s 2015-05-31 18:38:50 (3.20 MB/s) - `gitbucket.war' ã¸ä¿åå®äº [54920277/54920277]
ãµã¼ãã¹ãç«ã¡ä¸ãã¦ã¿ã
[syobochim@localhost gitbucket]$ sudo service gitbucket start Starting Jetty: StartLog to /opt/gitbucket/logs/start.log 2015-05-31 18:42:29.269:INFO::main: Logging initialized @1138ms 2015-05-31 18:42:29.425:WARN:oejs.HomeBaseWarning:main: This instance of Jetty is not running from a separate {jetty.base} directory, this is not recommended. See documentation at http://www.eclipse.org/jetty/documentation/current/startup.html 2015-05-31 18:42:29.814:INFO::main: Redirecting stderr/stdout to /opt/gitbucket/logs/2015_05_31.stderrout.log . . . . . . OK Sun May 31 18:42:57 JST 2015
ãã®ã¾ã¾ã§ã¯ã¢ã¯ã»ã¹ã§ããªãã®ã§ããã¡ã¤ã¢ã¦ã©ã¼ã«ã®è¨å®ãå¤æ´ãã
åèï¼CentOS 7 を VirtualBox にインストールし、Web サーバーの設定を行う(かなり変更点あり): ある SE のつぶやき
[syobochim@localhost default]$ sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent success [syobochim@localhost default]$ sudo firewall-cmd --reload success
è¨å®ããURLã«ã¢ã¯ã»ã¹ããã
ç§ã®å ´å㯠http://192.168.56.10:8080/gitbucket/
åºãï¼ï¼ï¼ï¼ï¼
jettyèµ·åã¾ã§ã§ã¤ã¾ã¥ããããèµ·åå¾ã«ãã¼ãéãã¦ãªãã®ã«æ°ã¥ããªãã£ããã¨ãåå¾ã¯ãã¡ããã¡ãã¤ã¾ã¥ãããã©ãGitBucketèªä½ã¯ãã£ã¡ãç°¡åã«ç«ã¡ä¸ãã£ãã
2015/06/01 追è¨
@soudai1025ããã«ãwarç´æ¥èµ·åããã°ä¾¿å©ã ãã¨æãã¦ããã ããã®ã§è¿½è¨ï¼
æãã¦ããã ãããã¼ã¸ï¼2014-05-20
ãããã¨ããããã¾ãï¼ï¼ç¢ºãã«ãã£ã¡ã楽ã â¦ï¼ï¼