忍者ブログ
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

wgetをインストールする

# yum install wget

fluentdからRedhat7用のRPMをダウンロードする
# wget http://packages.treasuredata.com.s3.amazonaws.com/2/redhat/7/x86_64/td-agent-2.3.4-0.el7.x86_64.rpm

依存性を保つため、redhat-lsb-coreをインストールする
# yum install redhat-lsb-core

ダウンロードしたtd-agentをインストールする
# rpm -ivh td-agent-2.3.4-0.el7.x86_64.rpm

バージョンを確認する
# td-agent --version
td-agent 0.12.31
PR
IPアドレスを固定する

# less /etc/sysconfig/network-scripts/ifcfg-enp0s3

TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=91c800a4-5144-41da-a10c-53c555035f9b
DEVICE=enp0s3
ONBOOT=yes
IPADDR0=192.168.1.10
PREFIX=24
GATEWAY0=192.168.1.1
ノートPCで蓋を閉じてもサスペンドにならないようにするには
/etc/systemd/logind.conf

HandleLidSwitch=ignore
とする。

tdiaryをインストールするために、まずrubyをインストールする。

# yum install ruby

gemとかrubyの仕組みがよくわかってなくて、
gemでのtdiaryがうまくインストールできないため、
tdiary.orgから最新バージョンのものを取ってくる。

$ cd ./public_html

$ wget http://www.tdiary.org/download/tdiary-full-v4.0.4.tar.gz
$ mv tdiary-v4.0.4/ ./public_html/diary
$ cd public_html/diary/
$ chmod 755 ./diary/

この状態で、tdiaryにアクセスすると、web上で以下のようなエラーが出る。
Could not find addressable-2.3.6 in any of the sources (Bundler::GemNotFound)

ってことで、bundle install を実行
$ gem install bundler
$ cd /home/hoge/public_html/diary
$ bundle install
この状態で、tdiaryにアクセスすると、web上で以下のようなエラーが出る。
No such file or directory - tdiary.conf (Errno::ENOENT)
これはtdiary.confがないから。
サンプルを元にtdiary.confを作る。
$ cp tdiary.conf.beginner tdiary.conf
これで一応、tdiaryが動く。
.htaccessの設定
AddHandler cgi-script .rb AddType application/xml .rdf <Files "*.rhtml*"> deny from all </Files> <Files "tdiary.*"> deny from all </Files> <Files update.rb> AuthName tDiary AuthType Basic AuthUserFile /home/hoge/.htpasswd Require user hogehoge </Files>

.htpasswd の設定
$ cd
$ htpasswd -c .htpasswd hogehoge
パスワードを2回入れる。

日本語を入力できるようにkkcをインストールする

# yum install ibus-kkc.x86_64

/etc/httpd/conf.d/user.conf
#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# The path to the end user account 'public_html' directory must be
# accessible to the webserver userid.  This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a "403 Forbidden" message.
#
<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    #UserDir disabled
    UserDir enable
    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disabled" line above, and uncomment
    # the following line instead:
    # 
    #UserDir public_html
</IfModule>
#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory "/home/*/public_html">
    AllowOverride FileInfo AuthConfig Limit Indexes
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS
</Directory>

http.conf を修正
ServerRoot "/etc/httpd"
Listen 80
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin webmaster@example.com
ServerName www.example.com:80
<Directory />
    AllowOverride none
    Require all denied
</Directory>
DocumentRoot "/var/www/html"
<Directory "/var/www">
    AllowOverride None
    Require all granted
</Directory>
<Directory "/var/www/html">
    Options Includes ExecCGI FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
<Directory "/var/www/icons">
    Options MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
<IfModule dir_module>
    DirectoryIndex index.html index.rb index.php
</IfModule>
<Files ".ht*">
    Require all denied
</Files>
ErrorLog "logs/error_log"
LogLevel warn
<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    <IfModule logio_module>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>
    CustomLog "logs/access_log" combined
</IfModule>
<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>
<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>
<IfModule mod_userdir.c>
    UserDir enable
    UserDir public_html
</IfModule>
<Directory "/home/*/public_html/diary.new">
        AllowOverride FileInfo AuthConfig Limit
        Options Includes ExecCGI FollowSymLinks 
        Order allow,deny
        Allow from all
        AddHandler cgi-script .cgi .rb .php .pl
</Directory>
<Directory "/home/*/public_html/diary">
        AllowOverride FileInfo AuthConfig Limit
        Options Includes ExecCGI FollowSymLinks
        Order allow,deny
        Allow from all
        AddHandler cgi-script .cgi .rb .php .pl
</Directory>
<IfModule mime_module>
    TypesConfig /etc/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddHandler cgi-script .cgi .rb .php .pl
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</IfModule>
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
    MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on

カレンダー
04 2024/05 06
S M T W T F S
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
ブログ内検索
HOME  次のページ

material:web*citron  template:ゆずろぐ

忍者ブログ [PR]