{"id":132,"date":"2017-03-16T00:08:00","date_gmt":"2017-03-15T15:08:00","guid":{"rendered":"http:\/\/shinke1987.net\/?p=132"},"modified":"2017-06-22T18:22:12","modified_gmt":"2017-06-22T09:22:12","slug":"post-132","status":"publish","type":"post","link":"https:\/\/shinke1987.net\/?p=132","title":{"rendered":"CentOS\u306b\u3064\u3044\u3066\u3002"},"content":{"rendered":"<ul>\n<li>\u6587\u5b57\u5217\u3092\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u691c\u7d22\uff08aiueo\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u63a2\u3059\u5834\u5408\uff09\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ grep -rn aiueo *<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>\u30d5\u30a1\u30a4\u30eb\u306e\u691c\u7d22\uff08aiueo\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u63a2\u3059\u5834\u5408\uff09<\/strong>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ find \/ -name aiueo<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>sudo\u3067\u30b3\u30de\u30f3\u30c9\u306e\u7d76\u5bfe\u30d1\u30b9\u3092\u5165\u529b\u305b\u305a\u306b\u3059\u3080\u3088\u3046\u306b\u3059\u308b\u8a2d\u5b9a<\/strong><br \/>\n~\/.bashrc\u306b\u3001<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">alias sudo='sudo env PATH=$PATH'<\/pre>\n<p>\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>yum\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u5fc5\u8981\u3068\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># yumdownloader --destdir RPM\u30d5\u30a1\u30a4\u30eb\u306e\u4fdd\u5b58\u5148 \u30d1\u30c3\u30b1\u30fc\u30b8\u540d\r\n# yum-builddep \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305fRPM\u30d5\u30a1\u30a4\u30eb<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>rpm\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u4f7f\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u8868\u793a<\/strong>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># rpm -ql \u30d1\u30c3\u30b1\u30fc\u30b8\u540d<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5168\u3066\u8868\u793a<\/strong>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># rpm -qa<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>\u7279\u5b9a\u306e\u30b3\u30de\u30f3\u30c9\u304c\u3069\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u542b\u307e\u308c\u308b\u306e\u304b\u3092\u8868\u793a<\/strong>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># rpm -qif \u30b3\u30de\u30f3\u30c9\u306e\u7d76\u5bfe\u30d1\u30b9<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>bash_profile\u306b\u3064\u3044\u3066<\/strong><br \/>\n\u7aef\u672b\u306a\u3069\u306e\u30b7\u30a7\u30eb\u3092\u8d77\u52d5\u3059\u308b\u305f\u3073\u306b.bashrc\u306f\u5b9f\u884c\u3055\u308c\u308b\u3002<br \/>\n\u30ed\u30b0\u30a4\u30f3\u6642\u306b\u306e\u307f.bash_profile\u306f\u5b9f\u884c\u3055\u308c\u308b\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>CPU\u304c32bit\u304b64bit\u304b\u3092\u5224\u5225\u3059\u308b\u3002<\/strong>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ lscpu<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>\u6b21\u56de\u30ed\u30b0\u30a4\u30f3\u6642\u306b\u5909\u66f4\u3057\u305f\u30d1\u30b9\u304c\u5168\u3066\u306e\u30e6\u30fc\u30b6\u3067\u9069\u7528\u3055\u308c\u308b\u3088\u3046\u306b\u3059\u308b<\/strong><br \/>\nApache\u306eman\u30d5\u30a1\u30a4\u30eb\u3092MANPATH\u306b\u8ffd\u52a0\u3057\u305f\u5834\u5408\u3002<br \/>\nroot\u3067\u3001\/etc\/profile\u3092\u958b\u3044\u3066\u3001\u4ee5\u4e0b\u306e2\u6587\u3092\u6700\u5f8c\u5c3e\u306b\u8ffd\u52a0\u3059\u308b\u3002<\/li>\n<\/ul>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">MANPATH=$MANPATH:\/usr\/local\/apache2\/man\r\nexport MANPATH<\/pre>\n<p>&nbsp;<\/p>\n<h2>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<ul>\n<li><strong>swap\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u30b5\u30a4\u30ba\u306b\u3064\u3044\u3066<\/strong><br \/>\n\u30b5\u30fc\u30d0\u306e\u7269\u7406\u30e1\u30e2\u30ea\u304c2GB\u4ee5\u4e0b\u2192\u7269\u7406\u30e1\u30e2\u30ea\u306e2\u500d<br \/>\n\u30b5\u30fc\u30d0\u306e\u7269\u7406\u30e1\u30e2\u30ea\u304c2GB\u4ee5\u4e0a\u2192\u7269\u7406\u30e1\u30e2\u30ea + 2GB<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>iptables<\/h2>\n<ul>\n<li><strong>\u518d\u8d77\u52d5\u3057\u3066\u3082\u8a2d\u5b9a\u304c\u4fdd\u5b58\u3055\u308c\u308b\u3088\u3046\u306b\u3059\u308b<\/strong><br \/>\n\/etc\/sysconfig\/iptables\u306b\u4ee5\u4e0b\u306b\u66f8\u3044\u3066\u3042\u308b\u3088\u3046\u306a\u30b3\u30de\u30f3\u30c9\u3092\u66f8\u3051\u3070\u826f\u3044\u3002<br \/>\n\u3082\u3057\/etc\/sysconfig\/iptables\u304c\u7121\u3044\u306a\u3089\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3055\u308c\u308b\u3068\u4f5c\u3089\u308c\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># iptables-save<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>\u63a5\u7d9a\u304c\u78ba\u7acb\u3055\u308c\u305f\u30d1\u30b1\u30c3\u30c8\u3092\u901a\u3059\u3088\u3046\u306b\u3059\u308b<\/strong><br \/>\n(&#8211;dport\u3067\u6307\u5b9a\u3057\u305f\u30d1\u30b1\u30c3\u30c8\u3092\u901a\u3057\u3066\u3082\u63a5\u7d9a\u304c\u78ba\u7acb\u3055\u308c\u306a\u3044\u5834\u5408\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u6253\u3064\u3068\u826f\u3044\uff09<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>SSH\u3067\u63a5\u7d9a\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/strong>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># iptables -A INPUT -p tcp --dport 22 -j ACCEPT<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>Web\u30b5\u30fc\u30d0\u3092\u516c\u958b\u3059\u308b\u5834\u5408<\/strong>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># iptables -A INPUT -p tcp --dport 80 -j ACCEPT<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>wget\u7b49\u3092\u4f7f\u3048\u308b\u3088\u3046\u306bDNS\u306e\u30d1\u30b1\u30c3\u30c8\u306f\u53d7\u3051\u5165\u308c\u308b<\/strong>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># iptables -A INPUT -p udp --sport 53 -j ACCEPT\r\n# iptables -A INPUT -p tcp --sport 53 -j ACCEPT<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>wget\u3067https\u30d7\u30ed\u30c8\u30b3\u30eb\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b<\/strong>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># iptables -A INPUT -p tcp --sport 443 -j ACCEPT<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>\u30dd\u30ea\u30b7\u30fc\u306e\u5909\u66f4<\/strong>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# iptables -P INPUT DROP\r\n# iptables -P FORWARD DROP\r\n<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210<\/h2>\n<p>FHS\u3067\u691c\u7d22\u3059\u308b\u3068\u95a2\u9023\u60c5\u5831\u304c\u51fa\u3066\u304f\u308b\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<td rowspan=\"14\">\/<\/td>\n<td>bin<\/td>\n<td>\u30d0\u30a4\u30ca\u30ea\u5f62\u5f0f\u306e\u5b9f\u884c\u53ef\u80fd\u30d5\u30a1\u30a4\u30eb\u3002<br \/>\n\u57fa\u672c\u30b3\u30de\u30f3\u30c9\u304c\u3053\u3053\u306b\u7f6e\u304b\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>boot<\/td>\n<td>Linux\u30ab\u30fc\u30cd\u30eb\u3084\u30d6\u30fc\u30c8\u51e6\u7406\u306b\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u304c\u7f6e\u304b\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>dev<\/td>\n<td>\u30c7\u30d0\u30a4\u30b9\u30d5\u30a1\u30a4\u30eb\u304c\u7f6e\u304b\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>etc<\/td>\n<td>\u30b7\u30b9\u30c6\u30e0\u7ba1\u7406\u7528\u306e\u5404\u7a2e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3068\u3001\u8d77\u52d5\u6642\u306b\u5b9f\u884c\u3055\u308c\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u7f6e\u304b\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>home<\/td>\n<td>\u30e6\u30fc\u30b6\u306e\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u7f6e\u304b\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>lib<\/td>\n<td>\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u7f6e\u304b\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>lost+found<\/td>\n<td>\u30b7\u30b9\u30c6\u30e0\u969c\u5bb3\u306b\u3088\u308a\u3069\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5c5e\u3059\u308b\u306e\u304b\u4e0d\u660e\u306a\u30d5\u30a1\u30a4\u30eb\u304c\u3067\u304d\u305f\u6642\u306b\u3053\u3053\u306b\u7f6e\u304b\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>mnt<\/td>\n<td>\u30de\u30a6\u30f3\u30c8\u7528\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3002\u5b9f\u614b\u306f\u7a7a\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3002<\/td>\n<\/tr>\n<tr>\n<td>proc<\/td>\n<td>\u30ab\u30fc\u30cd\u30eb\u306e\u52d5\u4f5c\u60c5\u5831\u3092\u542b\u3080\u7279\u6b8a\u306a\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3002<\/td>\n<\/tr>\n<tr>\n<td>root<\/td>\n<td>root\u306e\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/td>\n<\/tr>\n<tr>\n<td>sbin<\/td>\n<td>\u30b7\u30b9\u30c6\u30e0\u7ba1\u7406\u8005\u304c\u4f7f\u7528\u3059\u308b\u5b9f\u884c\u53ef\u80fd\u30d5\u30a1\u30a4\u30eb\u304c\u7f6e\u304b\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>tmp<\/td>\n<td>\u4e00\u6642\u7684\u306a\u30d5\u30a1\u30a4\u30eb\u7f6e\u304d\u5834\u3068\u3057\u3066\u4f7f\u7528\u3055\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>usr<\/td>\n<td>\u8d77\u52d5\u306b\u306f\u5fc5\u8981\u7121\u3044\u304c\u91cd\u8981\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u7f6e\u304b\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>var<\/td>\n<td>\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u3084\u30d7\u30ea\u30f3\u30bf\u30b9\u30d7\u30fc\u30eb\u306a\u3069\u3001\u5185\u5bb9\u304c\u5bb9\u91cf\u304c\u5909\u5316\u3057\u3066\u3044\u304f\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304f\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u5b57\u5217\u3092\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u691c\u7d22\uff08aiueo\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u63a2\u3059\u5834\u5408\uff09 $ grep -rn aiueo * &nbsp; \u30d5\u30a1\u30a4\u30eb\u306e\u691c\u7d22\uff08aiueo\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u63a2\u3059\u5834\u5408\uff09 $ find \/ -name aiueo &#038;nbsp [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[34],"class_list":["post-132","post","type-post","status-publish","format-standard","hentry","category-centos","tag-centos"],"_links":{"self":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=132"}],"version-history":[{"count":7,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/132\/revisions"}],"predecessor-version":[{"id":331,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/132\/revisions\/331"}],"wp:attachment":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}