cd /usr/local/
rpm -e jdk-7u80-linux-x64.rpm rpm -e jdk-8u121-linux-x64.rpm
rpm -ivh jdk-7u80-linux-x64.rpm rpm -ivh jdk-8u121-linux-x64.rpm
wget https://github.com/git/git/archive/v2.12.2.tar.gz
alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_18/bin/java 16018
alternatives --config java
cd /usr/local/
wget http://ftp.jaist.ac.jp/pub/apache/tomcat/tomcat-7/v7.0.77/bin/apache-tomcat-7.0.77.tar.gz
chmod 755 /usr/local/apache-tomcat-7.0.77.tar.gz
tar -xvf /usr/local/apache-tomcat-7.0.77.tar.gz
ln -s /usr/local/apache-tomcat-7.0.77 tomcat
#!/bin/bash # # Startup script for the Tomcat Servlet Container # # chkconfig: 2345 35 65 # description: Tomcat is the servlet container that is used in the official \ # Reference Implementation for the Java Servlet and JavaServer \ # Pages technologies TOMCAT_USER=tomcat CATALINA_HOME=/usr/local/tomcat . /etc/rc.d/init.d/functions prog=tomcat start() { echo -n $"Starting $prog: " daemon --user $TOMCAT_USER $CATALINA_HOME/bin/startup.sh > /dev/null RETVAL=$? if [ $RETVAL -eq 0 ]; then echo_success else echo_failure fi echo [ $RETVAL = 0 ] && touch /var/lock/subsys/$prog return $RETVAL } stop() { echo -n $"Stopping $prog: " daemon --user $TOMCAT_USER $CATALINA_HOME/bin/shutdown.sh > /dev/null RETVAL=$? if [ $RETVAL -eq 0 ]; then echo_success else echo_failure fi echo [ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog return $RETVAL } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) INSTANCES=`ps --columns 512 -aef|grep java|grep tomcat|grep org.apache.catalina.startup.Bootstrap|wc -l` if [ $INSTANCES -eq 0 ]; then echo $prog is stopped RETVAL=3 else if [ $INSTANCES -eq 1 ]; then echo $prog is running 1 instance... else echo $prog is running $INSTANCES instances... fi RETVAL=0 fi ;; *) echo $"Usage: $prog {start|stop|restart|status|help}" exit 1 esac exit $RETVAL
/sbin/chkconfig --add tomcat
ProxyPass /examples/ http://hostname:8080/examples/
http://183.181.52.78:8080/examples/
wget https://www.kernel.org/pub/software/scm/git/git-2.9.3.tar.gz
tar -xvf git-2.9.3.tar.gz
yum install gcc yum install zlib yum install zlib-devel yum install perl-ExtUtils-MakeMaker ./configure --prefix=/usr/local/ make make install which git git --version
cd /usr/local/src/ git clone git://git.kernel.org/pub/scm/git/git.git
cd git make prefix=/usr/local all make prefix=/usr/local install git --version
yum install git git-deamon git-all xinetd chkconfig xinetd on /etc/init.d/xinetd start touch /etc/xinetd.d/git-daemon
# default: off # description: The git dæmon allows git repositories to be exported using \ # the git:// protocol. service git { disable = no # <- 変更 socket_type = stream wait = no user = nobody server = /usr/libexec/git-core/git-daemon server_args = --base-path=/var/lib/git --export-all --user-path=public_git --syslog --inetd --verbose log_on_failure += USERID }
/etc/rc.d/init.d/xinetd restart
useradd gituser passwd gituser
groupadd git usermod -G git gituser
ssh-keygen -t rsa mv ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys
cd /var/lib/git mkdir public_git mkdir public_git/sample.git cd public_git/sample.git git --bare init --shared
chown -R root:git /var/lib/git
https://github.com/gitbucket/gitbucket/releases
cd /usr/local/tomcat/webapps
wget https://github.com/gitbucket/gitbucket/releases/download/4.11/gitbucket.war -P /usr/local/tomcat/webapps/
wget https://github.com/gitbucket/gitbucket/releases/download/3.10/gitbucket.war -P /usr/local/tomcat/webapps/
service tomcat stop service tomcat start
ProxyPass /gitbucket/ http://hostname:8080/gitbucket/
yum -y install samba
mkdir /usr/local/samba
#!/bin/bash for user in `ls /home` do id $user > /dev/null 2>&1 [ $? -eq 0 ] && \ [ ! -d /home/$user/samba ] && \ mkdir /home/$user/samba && \ chown $user:$user /home/$user/samba && \ echo "/home/$user/samba create" done
mkdir /home/samba
chown nobody:nobody /home/samba
[global] unix charset = UTF-8 ← 追加(Linux側日本語文字コード) dos charset = CP932 ← 追加(Windows側日本語文字コード) # workgroup = NT-Domain-Name or Workgroup-Name workgroup = MYGROUP ↓ workgroup = WORKGROUP ← 変更(Windowsのワークグループ名を指定) ※マイコンピュータのプロパティ⇒コンピュータ名タブ内のワークグループ欄を参照 ; hosts allow = 192.168.1. 192.168.2. 127. hosts allow = 192.168.1. 127. ← 追加(内部からのみアクセスできるようにする) # If you want to automatically load your printer list rather # than setting them up individually then you'll need this ; load printers = yes ← 行頭に;を追加(プリンタ共有無効化)※Sambaでプリンタを共有しない場合 load printers = no ← 追加(プリンタ共有無効化)※Sambaでプリンタを共有しない場合 disable spoolss = yes ← 追加(プリンタ共有無効化)※Sambaでプリンタを共有しない場合 [homes] comment = Home Directories path = %H/samba ← 追加(/home/ユーザー名/sambaをホームディレクトリにする) browseable = no writable = yes 各ユーザー専用のごみ箱機能追加(ここから) ※ファイル削除時に自動的にごみ箱へ移動されるようにする vfs objects = recycle ← ごみ箱の有効化 recycle:repository = .recycle ← ごみ箱のディレクトリ名(/home/ユーザー名/.recycle) recycle:keeptree = no ← ごみ箱へ移動時にディレクトリ構造を維持しない recycle:versions = yes ← 同名のファイルがごみ箱にある場合に別名で移動 recycle:touch = no ← ごみ箱へ移動時にタイムスタンプを更新しない recycle:maxsize = 0 ← ごみ箱へ移動するファイルのサイズ上限(0:無制限) recycle:exclude = *.tmp ~$* ← ここで指定したファイルはごみ箱へ移動せずに即削除する 各ユーザー専用のごみ箱機能追加(ここまで) 以下を最終行へ追加 [public] comment = Public Stuff path = /home/samba public = yes writable = yes only guest = yes 共有ディレクトリのごみ箱機能追加(ここから) ※ファイル削除時に自動的にごみ箱へ移動されるようにする vfs objects = recycle ← ごみ箱の有効化 recycle:repository = .recycle ← ごみ箱のディレクトリ名(/home/ユーザー名/.recycle) recycle:keeptree = no ← ごみ箱へ移動時にディレクトリ構造を維持しない recycle:versions = yes ← 同名のファイルがごみ箱にある場合に別名で移動 recycle:touch = no ← ごみ箱へ移動時にタイムスタンプを更新しない recycle:maxsize = 0 ← ごみ箱へ移動するファイルのサイズ上限(0:無制限) recycle:exclude = *.tmp ~$* ← ここで指定したファイルはごみ箱へ移動せずに即削除する 共有ディレクトリのごみ箱機能追加(ここまで)
/etc/rc.d/init.d/smb start /etc/rc.d/init.d/nmb start chkconfig smb on chkconfig nmb on ※centos7↓ #systemctl start smb #systemctl start nmb #systemctl enable smb #systemctl enable nmb
…