{"id":2251,"date":"2015-02-03T17:02:49","date_gmt":"2015-02-03T08:02:49","guid":{"rendered":"http:\/\/taitan916.info\/blog\/?p=2251"},"modified":"2021-07-29T00:11:50","modified_gmt":"2021-07-28T15:11:50","slug":"post-2251","status":"publish","type":"post","link":"https:\/\/taitan916.info\/blog\/archives\/2251","title":{"rendered":"VPS\u3067\u5fc5\u8981\u6700\u4f4e\u9650\u306e\u521d\u671f\u8a2d\u5b9a\u3068\u9ad8\u901f\u5316\uff06\u8ca0\u8377\u5bfe\u7b56\u307e\u3068\u3081(CentOS5\u7cfb)"},"content":{"rendered":"<p>\u4e45\u3057\u3076\u308a\u306bVPS\u3067\u65b0\u3057\u304f\u30b5\u30fc\u30d0\u3092\u69cb\u7bc9\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u3063\u305f\u3002\u904e\u53bb\u8a18\u4e8b\u3092\u898b\u3066\u8a2d\u5b9a\u3057\u3088\u3046\u3068\u601d\u3063\u305f\u3051\u3069\u3001\u8a18\u4e8b\u3092\u5206\u6563\u3057\u3066\u66f8\u3044\u3066\u305f\u306e\u3067\u307e\u3068\u3081\u3066\u30e1\u30e2\u3002\u30e1\u30e2\u30ea2GB\u3001CPU\u30b3\u30a2\u65702\u30671\u65e510\u4e07PV\u306f\u8010\u3048\u3089\u308c\u308b\u7b48\u3002phpMyAdmin\u306f\u5c0e\u5165\u305b\u305aAdminer\u3067\u5bfe\u5fdc\u3002\u3042\u3068\u30b5\u30fc\u30d0\u5074\u3067\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u5bfe\u7b56\u3082\u3002\u74b0\u5883\u3068\u3057\u3066\u3044\u3064\u3082\u306fCentOS6.x\u7cfb\u3060\u3063\u305f\u3051\u3069\u4eca\u56de\u306fCentOS5.5\u3060\u3063\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>SSH\u306b\u63a5\u7d9a<\/strong><\/h2>\n<p>IP\u30a2\u30c9\u30ec\u30b9\u3001\u30d1\u30b9\u306f\u3042\u308b\u306f\u305a\u306a\u306e\u3067\u30dd\u30fc\u30c8\u309222\u3067\u63a5\u7d9a\u3002DTI\u306e\u5834\u5408\u306f3843\u304c\u521d\u671f\u30dd\u30fc\u30c8\u306a\u306e\u3067\u6ce8\u610f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>root\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u5909\u66f4<\/strong><\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">passwd<\/pre>\n<p>\u3092\u5165\u529b\u3059\u308b\u3068\u65b0\u3057\u3044\u30d1\u30b9\u30ef\u30fc\u30c9\u30922\u56de\u805e\u304b\u308c\u308b\u306e\u3067\u5165\u529b\u3059\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>\u63a5\u7d9a\u7528\u30e6\u30fc\u30b6\u30fc\u306e\u4f5c\u6210\u3068\u8a2d\u5b9a<\/strong><\/h2>\n<p>\u63a5\u7d9a\u7528\u30e6\u30fc\u30b6\u30fc\u306f\u30e6\u30fc\u30b6\u30fc\u540dtestuser\u3001\u30d1\u30b9\u30ef\u30fc\u30c9testpass\u3068\u3059\u308b\u3002\u307e\u305a\u306f\u30e6\u30fc\u30b6\u30fc\u306e\u4f5c\u6210\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">useradd -d \/testuser -G wheel testuser<\/pre>\n<p>\u6b21\u306b\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u8a2d\u5b9a\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">passwd testuser<\/pre>\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u5165\u529b\u304c2\u56de\u6c42\u3081\u3089\u308c\u308b\u306e\u3067\u5165\u529b\u3059\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>sudo\u30b3\u30de\u30f3\u30c9\u306e\u8a2d\u5b9a<\/strong><\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">visudo<\/pre>\n<p>\u3092\u5165\u529b\u3057\u3066\u300c\/wheel\u300d\u3067\u691c\u7d22\u3059\u308b\u3068\u3001<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">##Allows people in group wheel to run all comma\r\n#wheel ALL=(ALL) ALL<\/pre>\n<p>\u307f\u305f\u3044\u306a\u90e8\u5206\u304c\u3042\u308b\u306e\u3067#wheel\u306e\uff03\u3092\u524a\u9664\u3059\u308b\u3002\u524a\u9664\u5f8c\u306f\u300c:wq\u300d\u3067\u4fdd\u5b58\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>SSH\u306e\u8a2d\u5b9a<\/strong><\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">vi \/etc\/ssh\/sshd_config<\/pre>\n<p>\u3067\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u3001\u300c#Port 22\u300d\u3092\u691c\u7d22\u3002\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u306e#\u3092\u5916\u3057\u3066\u300122\u306e\u6570\u5b57\u306f\u9069\u5b9c\u5909\u66f4\u3059\u308b\u3002\u3053\u3053\u3067\u306f\u4f8b\u3068\u3057\u30667777\u306b\u5909\u66f4\u3059\u308b\u3002<\/p>\n<p>\u6b21\u306broot\u3067\u306e\u30ed\u30b0\u30a4\u30f3\u3092\u62d2\u5426\u3057\u305f\u3044\u306e\u3067\u300cPermitRootLogin\u300d\u3092\u691c\u7d22\u3002Yes\u306b\u306a\u3063\u3066\u3044\u308b\u90e8\u5206\u3092No\u306b\u66f8\u304d\u63db\u3048\u3066\u300c:wq\u300d\u3067\u4fdd\u5b58\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">\/etc\/rc.d\/init.d\/sshd restart<\/pre>\n<p>\u3067\u518d\u8d77\u52d5\u304b\u3051\u3066\u5b8c\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>iptables\u306e\u8a2d\u5b9a<\/strong><\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">vi \/etc\/sysconfig\/iptables<\/pre>\n<p>\u3067\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u4ee5\u4e0b\u3092\u8a18\u8ff0\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">*filter\r\n:INPUT ACCEPT [0:0]\r\n:FORWARD ACCEPT [0:0]\r\n:OUTPUT ACCEPT [0:0]\r\n:RH-Firewall-1-INPUT - [0:0]\r\n-A INPUT -j RH-Firewall-1-INPUT\r\n-A FORWARD -j RH-Firewall-1-INPUT\r\n-A RH-Firewall-1-INPUT -i lo -j ACCEPT\r\n-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT\r\n-A RH-Firewall-1-INPUT -p 50 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -p 51 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 465 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 587 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 110 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 995 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 143 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 993 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 7777 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 10000 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT\r\n-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited\r\nCOMMIT<\/pre>\n<p>7777\u306e\u3068\u3053\u308d\u306fSSH\u3067\u8a2d\u5b9a\u3057\u305f\u30dd\u30fc\u30c8\u306e\u756a\u53f7\u3092\u5165\u308c\u308b\u3002<\/p>\n<p>\u4ee5\u4e0b\u3067\u518d\u8d77\u52d5\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">service iptables restart<\/pre>\n<p>&nbsp;<\/p>\n<h2><strong>yum\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8(\u203b2015\/08\/09\u8ffd\u8a18)<\/strong><\/h2>\n<p>yum\u3092\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u3066\u304a\u304f\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">yum update<\/pre>\n<p>&nbsp;<\/p>\n<h2><strong>Apache\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a<\/strong><\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">yum -y install httpd<\/pre>\n<p>\u3067Apache\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002\u5b8c\u4e86\u3059\u308c\u3070\u3001\u4ee5\u4e0b\u3067\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">\/sbin\/chkconfig httpd on<\/pre>\n<p>\u6b21\u306bApache\u306e\u8a2d\u5b9a\u3092\u3057\u305f\u3044\u306e\u3067\u4ee5\u4e0b\u3067\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">vi \/etc\/httpd\/conf\/httpd.conf<\/pre>\n<p>\u4ee5\u4e0b\u8a2d\u5b9a\u306b\u7de8\u96c6\u3057\u3066\u3044\u304f\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">#ServerTokens OS\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\r\nServerTokens Prod\r\n\r\n#KeepAlive Off\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\r\nKeepAlive On\r\n\r\n#ServerName www.example.com:80\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\r\nServerName *:80\r\n\r\n#Options Indexes FollowSymLinks\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048(\u8907\u6570\u3042\u308b\u304b\u3082)\r\nOptions FollowSymLinks\r\n\r\n#AllowOverride NONE\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048(\u8907\u6570\u3042\u308b\u304b\u3082)\r\nAllowOverride ALL\r\n\r\n#ServerSignature On\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\r\nServerSignature Off\r\n\r\n#Timeout 300\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\r\nTimeout 10\r\n\r\n#MaxKeepAliveRequests 100\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\r\nMaxKeepAliveRequests 50\r\n\r\n#KeepAliveTimeout 15\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\r\nKeepAliveTimeout 8\r\n\r\n#&lt;IfModule prefork.c&gt;\r\n#StartServers       8\r\n#MinSpareServers    5\r\n#MaxSpareServers   20\r\n#ServerLimit      256\r\n#MaxClients       256\r\n#MaxRequestsPerChild  4000\r\n#&lt;\/IfModule&gt;\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\r\n&lt;IfModule prefork.c&gt;\r\nStartServers       5\r\nMinSpareServers    5\r\nMaxSpareServers   10\r\nServerLimit      256\r\nMaxClients       256\r\nMaxRequestsPerChild  400\r\n&lt;\/IfModule&gt;\r\n\r\n#&lt;IfModule worker.c&gt;\r\n#StartServers         2\r\n#MaxClients         150\r\n#MinSpareThreads     25\r\n#MaxSpareThreads     75\r\n#ThreadsPerChild     25\r\n#MaxRequestsPerChild  0\r\n#&lt;\/IfModule&gt;\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\r\n&lt;IfModule worker.c&gt;\r\nStartServers         5\r\nMaxClients         300\r\nMinSpareThreads     30\r\nMaxSpareThreads    150\r\nThreadsPerChild     50\r\nMaxRequestsPerChild  50\r\n&lt;\/IfModule&gt;\r\n\r\n#\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3002\/var\/www\/html\u306e\u90e8\u5206\u306f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30eb\u30fc\u30c8\u3092\u9069\u5b9c\u66f8\u304d\u63db\u3048\u308b\u3002\r\n&lt;Directory &quot;\/var\/www\/html&quot;&gt;\r\nExpiresActive On\r\nExpiresByType image\/gif &quot;access plus 30 days&quot;\r\nExpiresByType image\/jpeg &quot;access plus 30 days&quot;\r\nExpiresByType image\/png &quot;access plus 30 days&quot;\r\nExpiresByType image\/icon &quot;access plus 60 days&quot;\r\nExpiresByType image\/ico &quot;access plus 60 days&quot;\r\n\r\nExpiresByType text\/html &quot;access plus 60 minutes&quot;\r\nExpiresByType text\/css &quot;access plus 10 days&quot;\r\nExpiresByType text\/xml &quot;access plus 60 minutes&quot;\r\nExpiresByType text\/javascript &quot;access plus 10 days&quot;\r\nExpiresByType application\/javascript &quot;access plus 10 days&quot;\r\nExpiresByType application\/x-javascript &quot;access plus 10 days&quot;\r\n&lt;\/Directory&gt;<\/pre>\n<p>\u307e\u305f\u3001\u30b5\u30d6\u30c9\u30e1\u30a4\u30f3\u3092\u8a2d\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u5909\u66f4\u3082\u5fc5\u8981\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">#\u2193\u2193\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u4ed8\u3044\u3066\u3044\u308b\u5834\u5408\u306f\u5916\u3059\r\nNameVirtualHost *:80\r\n\r\n#\u2193\u2193\u4e0b\u8a18\u3092\u8ffd\u8a18\r\n&lt;VirtualHost *:80&gt;\r\n    ServerAdmin domain.com\r\n    DocumentRoot \/var\/www\/html\/domain.com\r\n    ServerName domain.com\r\n    ErrorLog logs\/error_log\r\n    CustomLog logs\/access_log common\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p>\u4ee5\u4e0b\u3067Apache\u3092\u518d\u8d77\u52d5\u3055\u305b\u3066\u5b8c\u4e86\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">service httpd restart<\/pre>\n<p>\u5c1a\u3001\u3053\u306e\u6642\u70b9\u3067IP\u30a2\u30c9\u30ec\u30b9\u3092\u53c2\u7167\u3059\u308b\u3068Apache\u306e\u30c6\u30b9\u30c8\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3002\u306a\u306e\u3067\u3001<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">vi \/etc\/httpd\/conf.d\/welcome.conf<\/pre>\n<p>\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u3001<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">&lt;LocationMatch \u201c^\/+$\u201d&gt;\r\nOptions -Indexes\r\nErrorDocument 403 \/error\/noindex.html\r\n&lt;\/LocationMatch&gt;<\/pre>\n<p>\u4e0a\u8a18\u306e\u90e8\u5206\u3092\u5168\u3066#\u3067\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u4fdd\u5b58\u3059\u308b\u3002\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u306f\u518d\u5ea6Apache\u306e\u518d\u8d77\u52d5\u304c\u5fc5\u8981\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>PHP\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a<\/strong><\/h2>\n<p>\u5148\u306bepel\u3068remi\u30ec\u30dd\u30b8\u30c8\u30ea\u3092\u5165\u308c\u308b\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">rpm -ivh  http:\/\/ftp-srv2.kddilabs.jp\/Linux\/distributions\/fedora\/epel\/5\/x86_64\/epel-release-5-4.noarch.rpm\r\nrpm -ivh http:\/\/rpms.famillecollet.com\/enterprise\/remi-release-5.rpm<\/pre>\n<p>PHP\u3068\u5fc5\u8981\u305d\u3046\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u5165\u308c\u308b\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">yum -y install --enablerepo=remi --enablerepo=remi-php55 php php-devel php-mbstring php-mcrypt php-mysql php-gd<\/pre>\n<p>PHP\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3059\u308b\u3002\u4ee5\u4e0b\u3067\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">vi \/etc\/php.ini<\/pre>\n<p>\u4ee5\u4e0b\u5909\u66f4\u3092\u884c\u3046\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">#memory_limit = 128M\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\r\nmemory_limit = 32M<\/pre>\n<p>\u5c1a\u3001\u3082\u3057\u5927\u304d\u3044\u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3084\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u5909\u66f4\u3082\u5fc5\u8981\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">#upload_max_filesize = 2M\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\u3002memory_limit\u4ee5\u4e0b\u4e14\u3064post_max_size\u4ee5\u4e0b\u306e\u6570\u5024\u3067\u597d\u304d\u306a\u8a2d\u5b9a\u306b\u3059\u308b\u3002\r\nupload_max_filesize = 8M\r\n\r\n#post_max_size = 8M\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\u3002memory_limit\u4ee5\u4e0b\u306e\u6570\u5024\u3067\u597d\u304d\u306a\u8a2d\u5b9a\u306b\u3059\u308b\u3002\r\npost_max_size = 16M<\/pre>\n<p>\u300cmemory_limit &gt; post_max_size &gt; upload_max_filesize\u300d\u306b\u306a\u3089\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u6ce8\u610f\u3002<\/p>\n<p>\u3042\u3068\u30ad\u30e3\u30c3\u30b7\u30e5\u5bfe\u7b56\u3068\u3057\u3066opcache\u3092\u4ee5\u4e0b\u3067\u5c0e\u5165\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">yum -y install php-opcache --enablerepo=remi-php55,remi<\/pre>\n<p>opcache\u306e\u72b6\u6cc1\u3092\u8996\u899a\u7684\u306b\u78ba\u8a8d\u3057\u3084\u3059\u3044\u3088\u3046\u3001ocp.php\u3092\u5c0e\u5165\u3059\u308b\u3068\u826f\u3044\u3002<\/p>\n<p><a href=\"https:\/\/gist.github.com\/ck-on\/4959032\" target=\"_blank\" rel=\"noopener\">https:\/\/gist.github.com\/ck-on\/4959032<\/a><\/p>\n<p>FTP\u95a2\u9023\u306e\u8a2d\u5b9a\u304c\u7d42\u308f\u3063\u305f\u5f8c\u3001\u4e0a\u8a18\u30da\u30fc\u30b8\u306e\u30bd\u30fc\u30b9\u3092\u9069\u5f53\u306a\u540d\u524d\u3092\u3064\u3051\u3066\u4fdd\u5b58\u3057\u3066\u3001\u9069\u5f53\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30a2\u30c3\u30d7\u3059\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>MySQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a<\/strong><\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">yum -y install mysql-server<\/pre>\n<p>\u3067MySQL\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">\/sbin\/chkconfig mysqld on\r\nservice mysqld restart<\/pre>\n<p>\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\u3068\u518d\u8d77\u52d5\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">mysql_secure_installation<\/pre>\n<p>\u3067\u521d\u671f\u8a2d\u5b9a\u3002root\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3060\u3051\u5165\u308c\u3066\u3001\u5f8c\u306fYes\u306e\u9078\u629e\u80a2\u3067OK\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">mysql -u root -p<\/pre>\n<p>\u3067MySQL\u306b\u63a5\u7d9a\u3057\u3066\u3001<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">GRANT ALL PRIVILEGES ON *.* TO testuser IDENTIFIED BY &#039;testpass&#039;;\r\nGRANT ALL PRIVILEGES ON *.* TO testuser@localhost IDENTIFIED BY &#039;testpass&#039;;<\/pre>\n<p>\u3067MySQL\u7528\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3002\u4e0b\u304clocalhost\u3067\u4e0a\u304c\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u6307\u5b9a\u3002testuser\u3068testpass\u306f\u9069\u5b9c\u66f8\u304d\u63db\u3048\u308b\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">vi \/etc\/my.cnf<\/pre>\n<p>\u3067MySQL\u7528\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u5168\u90e8\u524a\u9664\u3057\u3001\u4ee5\u4e0b\u3092\u8a18\u8ff0\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">[mysqld]\r\ndatadir=\/var\/lib\/mysql\r\nsocket=\/var\/lib\/mysql\/mysql.sock\r\nuser=mysql\r\ncharacter-set-server=utf8\r\nskip-character-set-client-handshake\r\nquery_cache_limit=1M\r\nquery_cache_min_res_unit=4k\r\nquery_cache_size=24M\r\nquery_cache_type=1\r\nkey_buffer = 16M\r\nsort_buffer_size = 1M\r\nread_buffer_size = 256K\r\n\r\n\r\n# Disabling symbolic-links is recommended to prevent assorted security risks\r\nsymbolic-links=0\r\n\r\n[mysqld_safe]\r\nlog-error=\/var\/log\/mysqld.log\r\npid-file=\/var\/run\/mysqld\/mysqld.pid\r\n\r\n[client]\r\ndefault-character-set=utf8\r\n[mysql]\r\ndefault-character-set=utf8\r\n[mysqldump]\r\ndefault-character-set=utf8<\/pre>\n<p>\u4ee5\u4e0b\u3067MySQL\u3092\u518d\u8d77\u52d5\u3057\u3066\u5b8c\u4e86\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">service mysqld restart<\/pre>\n<p>&nbsp;<\/p>\n<h2><strong>FTP\u30b5\u30fc\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a<\/strong><\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">yum -y install vsftpd<\/pre>\n<p>\u3067FTP\u30b5\u30fc\u30d0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">vi \/etc\/vsftpd\/vsftpd.conf<\/pre>\n<p>\u3067\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">#anonymous_enable=YES\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\r\nanonymous_enable=NO\r\n\r\n#ascii_upload_enable=NO\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\r\nascii_upload_enable=YES\r\n\r\n#ascii_download_enable=NO\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\r\nascii_download_enable=YES\r\n\r\n#ls_recurse_enable=NO\r\n#\u2193\u2193\u306b\u66f8\u304d\u63db\u3048\r\nls_recurse_enable=YES\r\n\r\n#\u4ee5\u4e0b\u3092\u8ffd\u8a18\r\nuse_localtime=YES\r\nlocal_root=\/var\/www\/html\r\nforce_dot_files=YES<\/pre>\n<p>\u8ffd\u8a18\u306elocal_root\u306f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30eb\u30fc\u30c8\u3092\u9069\u5b9c\u66f8\u304d\u63db\u3048\u308b\u3002<\/p>\n<p>\u4ee5\u4e0b\u3067\u81ea\u52d5\u8d77\u52d5\u3068\u518d\u8d77\u52d5\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">\/sbin\/chkconfig vsftpd on\r\nservice vsftpd restart<\/pre>\n<p>\u5c1a\u3001\u6240\u6709\u6a29\u306e\u554f\u984c\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u3001<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">chown testuser:testuser \/var\/www\/html<\/pre>\n<p>\u3067\u6240\u6709\u6a29\u3092\u5909\u66f4\u3059\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>\u30b5\u30fc\u30d0\u81ea\u4f53\u306e\u518d\u8d77\u52d5\u3068\u78ba\u8a8d<\/strong><\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"\">reboot<\/pre>\n<p>\u3067\u30b5\u30fc\u30d0\u306e\u518d\u8d77\u52d5\u3092\u304b\u3051\u308b\u3002<\/p>\n<p>\u78ba\u8a8d\u9805\u76ee\u3068\u3057\u3066\u306f\u3001<\/p>\n<ul>\n<li>FTP\u3067\u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u51fa\u6765\u308b\u304b\uff1f<\/li>\n<li>root\u3067SSH\u63a5\u7d9a\u4e0d\u53ef\u306b\u306a\u3063\u3066\u3044\u308b\u304b\uff1f<\/li>\n<li>SSH\u63a5\u7d9a\u6642\u306b\u6307\u5b9a\u3057\u305f\u30dd\u30fc\u30c8\u4ee5\u5916\u3067\u306f\u30ed\u30b0\u30a4\u30f3\u4e0d\u53ef\u306b\u306a\u3063\u3066\u3044\u308b\u304b\uff1f<\/li>\n<li>Adminer.php\u5165\u308c\u3066PHP\u3068MySQL\u52d5\u3044\u3066\u3044\u308b\u304b\uff1f<\/li>\n<li>ocp.php\u3067opcache\u304c\u52d5\u3044\u3066\u3044\u308b\u304b\uff1f<\/li>\n<li>Apache\u306e\u30c6\u30b9\u30c8\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u306a\u3044\u304b\uff1f<\/li>\n<\/ul>\n<p>\u8fba\u308a\u3092\u898b\u3066\u304a\u304f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e45\u3057\u3076\u308a\u306bVPS\u3067\u65b0\u3057\u304f\u30b5\u30fc\u30d0\u3092\u69cb\u7bc9\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u3063\u305f\u3002\u904e\u53bb\u8a18\u4e8b\u3092\u898b\u3066\u8a2d\u5b9a\u3057\u3088\u3046\u3068 ... <\/p>\n","protected":false},"author":1,"featured_media":2233,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[46],"tags":[],"class_list":["post-2251","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/2251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/comments?post=2251"}],"version-history":[{"count":0,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/2251\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media\/2233"}],"wp:attachment":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media?parent=2251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/categories?post=2251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/tags?post=2251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}