{"id":33,"date":"2018-12-18T16:00:38","date_gmt":"2018-12-18T07:00:38","guid":{"rendered":"https:\/\/wordpress.k8s.yukiafronia.com\/?p=33"},"modified":"2020-08-10T16:13:45","modified_gmt":"2020-08-10T07:13:45","slug":"%e5%88%9d%e3%82%81%e3%81%a6%e3%81%aevhost-with-nginx","status":"publish","type":"post","link":"https:\/\/blog.yukiafronia.com\/?p=33","title":{"rendered":"\u521d\u3081\u3066\u306evhost with Nginx"},"content":{"rendered":"<p>\u3053\u3053\u6700\u8fd1\u3001\u3081\u3063\u304d\u308azabbix!! , zabbix!! \u3068\u3044\u3046\u611f\u3058\u3067\u3057\u305f\u304c\u30a4\u30f3\u30bf\u30fc\u30b7\u30c3\u30d7\u5148\u3067nginx\u3092\u5f04\u308b\u6a5f\u4f1a\u304c\u3042\u308a\u307e\u3057\u3066\u3001\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u306e\u3064\u3044\u3067\u306bvhost\u3082\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3068\u3044\u3046\u79c1\u306e\u904a\u3073\u5fc3\u3042\u3075\u308c\u305f\u3082\u306e\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3058\u3083\u3001\u65e9\u901f\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046!<\/p>\n<h2>vhost\u3063\u3066\u4f55?<\/h2>\n<p>vhost\u3068\u306f\u3001nginx\u3084apache\u306a\u3069\u306eweb\u30b5\u30fc\u30d0\u3067\u8907\u6570\u306e\u30c9\u30e1\u30a4\u30f3\u3092\u4e00\u3064\u306eweb\u30b5\u30fc\u30d0\u3067\u52d5\u304b\u3059\u3068\u3044\u3046\u6280\u8853\u3067\u3059\u3002<br \/>\n\u5177\u4f53\u7684\u306b\u306f\u3001\u5f0a\u5b66\u306e\u30b5\u30fc\u30af\u30eb\u3067\u4f7f\u7528\u3057\u3066\u3044\u308b\u306e\u304cwordpress\u306a\u308f\u3051\u3067\u3059\u304c1\u3064\u306enginx\u4e0a\u3067\u30b5\u30fc\u30af\u30eb\u306e\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u3082\u81ea\u5206\u306e\u30d6\u30ed\u30b0\u3082\u30c9\u30e1\u30a4\u30f3\u3060\u3051\u5909\u66f4\u3055\u305b\u3066\u3046\u307e\u3044\u611f\u3058\u3067\u516c\u958b\u3057\u307e\u3057\u3087\u3046 \u3063\u3066\u611f\u3058\u3067\u3059\u3002  (\u308f\u304b\u308a\u306b\u304f\u3044\u3067\u3059\u306d...\u30b5\u30fc\u30bb\u30f3)<\/p>\n<h2>\u4f55\u306f\u3068\u3082\u3042\u308c\u5b9f\u969b\u3084\u3063\u3066\u307f\u308b\u3002<\/h2>\n<p>\u4eca\u56de\u306e\u74b0\u5883\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002  <\/p>\n<p>CentOS7.5  minimal<\/p>\n<ul>\n<li>Nginx 1.14  <\/li>\n<li>php 7.2.11<\/li>\n<li>wordpress 4.9.8<br \/>\n\u3053\u3061\u3089\u306e\u74b0\u5883\u3067\u3001\u691c\u8a3c\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\nCentOS7.5\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u4f55\u3082\u9762\u767d\u304f\u306a\u3044\u306e\u3067\u7701\u7565\u3057\u3061\u3083\u3063\u3066\u3082\u3044\u3044\u3067\u3059\u304b?<br \/>\n\u307e\u3001\u3068\u308a\u3042\u3048\u305a\u8f09\u305b\u3066\u304a\u304d\u307e\u3059\u306d\u3002<\/p>\n<p>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/23439178\/47345037-c7562800-d6e4-11e8-9cff-d8b2f62f22e7.png\" alt=\"tmp-2018-10-23-16-55-03\" \/><\/p>\n<p>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/23439178\/47345046-cd4c0900-d6e4-11e8-9261-e7399218060b.png\" alt=\"tmp-2018-10-23-16-55-52\" \/><\/p>\n<p>\n\u8a00\u8a9e\u306f\u3001\u65e5\u672c\u8a9e\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<p>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/23439178\/47345062-d50bad80-d6e4-11e8-8288-94e93cb45641.png\" alt=\"tmp-2018-10-23-16-55-57\" \/><\/p>\n<p>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u306e\u30a2\u30a4\u30b3\u30f3\u3092\u62bc\u4e0b\u3059\u308b\u3068\u4e0b\u8a18\u753b\u9762\u304c\u51fa\u307e\u3059\u3002<\/p>\n<p>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/23439178\/47345069-d937cb00-d6e4-11e8-9923-08008f0f5ff6.png\" alt=\"tmp-2018-10-23-16-56-14\" \/><\/p>\n<p>\n\u5de6\u4e0a\u306e\u5b8c\u4e86\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u623b\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/23439178\/47345073-dccb5200-d6e4-11e8-8067-7a95bc694f89.png\" alt=\"tmp-2018-10-23-16-56-18\" \/><\/p>\n<p>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/23439178\/47345079-dfc64280-d6e4-11e8-8b02-2c5fa0794c57.png\" alt=\"tmp-2018-10-23-16-56-28\" \/><\/p>\n<p>\n\u6b21\u306b\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<br \/>\n\u53f3\u5074\u3001\u6700\u521d\u306f\u30aa\u30d5\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u30aa\u30f3\u306b\u5207\u308a\u66ff\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/23439178\/47345095-e5bc2380-d6e4-11e8-9e16-dcb171b85f1b.png\" alt=\"tmp-2018-10-23-16-57-08\" \/><\/p>\n<p>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/23439178\/47345098-e94faa80-d6e4-11e8-9be5-b795964cfb70.png\" alt=\"tmp-2018-10-23-16-57-23\" \/><\/p>\n<p>\n\u6700\u5f8c\u306b\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u3066\u7d42\u4e86\u3067\u3059\u3002<\/p>\n<p>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/23439178\/47345109-ece33180-d6e4-11e8-8fa7-8eb66dc0a8dc.png\" alt=\"tmp-2018-10-23-16-57-31\" \/><\/p>\n<p>\n\u6700\u5f8c\u306b\u53f3\u4e0b\u306e\u518d\u8d77\u52d5\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<p>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/23439178\/47345455-bf4ab800-d6e5-11e8-98e3-85571e56f580.png\" alt=\"tmp-2018-10-23-17-04-40\" \/><\/p>\n<p>\n\u3053\u3053\u304b\u3089\u306f\u3001SSH\u3067\u30ea\u30e2\u30fc\u30c8\u3067\u306e\u4f5c\u696d\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\nTeraterm \u304b Putty \u3067\u306e\u4f5c\u696d\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u3069\u3061\u3089\u304b\u306e\u30bd\u30d5\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3054\u7528\u610f\u304f\u3060\u3055\u3044\u3001Mac\u306e\u5834\u5408\u306fterminal\u3067\u3082ssh\u304c\u3064\u306a\u304c\u308b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u305d\u3061\u3089\u3092\u5229\u7528\u3057\u3066\u3044\u305f\u3060\u3044\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002<\/p>\n<h2>Nginx \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>Nginx\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u4e0a\u3067\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u6574\u3048\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002  <\/p>\n<pre><code>root@localhost ~# vi \/etc\/yum.repos.d\/nginx.repo  <\/code><\/pre>\n<p>insert\u30ad\u30fc or i \u30ad\u30fc\u3092\u62bc\u3057\u3066\u7de8\u96c6\u30e2\u30fc\u30c9\u306b\u3057\u307e\u3059\u3002  <\/p>\n<\/li>\n<\/ul>\n<pre><code>[nginx]\nname=nginx repo  \nbaseurl=http:\/\/nginx.org\/packages\/centos\/$releasever\/$basearch\/  \ngpgcheck=0  \nenabled=1  <\/code><\/pre>\n<pre><code>root@localhost ~# yum -y install nginx  \nroot@localhost ~# systemctl enable nginx  <\/code><\/pre>\n<p>\u3053\u3053\u307e\u3067\u3067\u3001nginx\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u3067\u304d\u307e\u3057\u305f\u3002  <\/p>\n<p>  <\/p>\n<h2>\u4e00\u5fdc php-fpm\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/h2>\n<p>\u4f55\u306f\u3068\u3082\u3042\u308c\u3001remi\u3055\u3093\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u767b\u9332\u3057\u3066\u304a\u304b\u306a\u3051\u308c\u3070\u3067\u3059\u306d\u3002  <\/p>\n<pre><code>root@localhost ~# yum -y install http:\/\/rpms.famillecollet.com\/enterprise\/remi-release-7.rpm  <\/code><\/pre>\n<pre><code>root@localhost ~# vi \/etc\/yum.repos.d\/remi-php72.repo  \n\n[remi-php72]\u3000\u3000\nname=Remi&#039;s PHP 7.2 RPM repository for Enterprise Linux 7 - $basearch \u3000\n#baseurl=http:\/\/rpms.remirepo.net\/enterprise\/7\/php72\/$basearch\/\u3000\u3000\n#mirrorlist=https:\/\/rpms.remirepo.net\/enterprise\/7\/php72\/httpsmirror  \nmirrorlist=http:\/\/cdn.remirepo.net\/enterprise\/7\/php72\/mirror  \nenabled=0       \u2190enabled=1 \u306b\u5909\u66f4\u3000\u3000<\/code><\/pre>\n<pre><code>root@localhost ~# yum -y install php72 php72-php php php-fpm php-mysql  \n\nroot@localhost ~# systemctl enable php-fpm  <\/code><\/pre>\n<p>\u6b21\u306b\u3001php-fpm\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u3042\u308buser\u3068group\u3092\u5909\u66f4\u3057\u3066\u304a\u304d\u307e\u3059\u3002  <\/p>\n<pre><code>root@localhost ~# vi \/etc\/php-fpm.d\/www.conf  <\/code><\/pre>\n<p>insert\u30ad\u30fc or i\u30ad\u30fc\u3092\u62bc\u4e0b\u3057\u3066\u7de8\u96c6\u30e2\u30fc\u30c9\u306b\u3059\u308b\u3002  <\/p>\n<pre><code>; RPM: apache user chosen to provide access to the same   directories as httpd  \nuser = apache               \u2190Nginx\u306b\u5909\u3048\u308b\u3002  \n; RPM: Keep a group allowed to write in log dir.  \ngroup = apache              \u2190Nginx\u306b\u5909\u3048\u308b\u3002  <\/code><\/pre>\n<p>  <\/p>\n<h2>MariaDB\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304f<\/h2>\n<pre><code>root@localhost ~# vi \/etc\/yum.repos.d\/mariadb.repo  <\/code><\/pre>\n<p>insert\u30ad\u30fc or i\u30ad\u30fc\u3092\u62bc\u4e0b\u3057\u3066\u7de8\u96c6\u30e2\u30fc\u30c9\u306b\u3002  <\/p>\n<pre><code># MariaDB 10.3 CentOS repository list - created 2018-10-23 08:27 UTC  \n# http:\/\/downloads.mariadb.org\/mariadb\/repositories\/  \n[mariadb]  \nname = MariaDB  \nbaseurl = http:\/\/yum.mariadb.org\/10.3\/centos7-amd64  \ngpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB  \ngpgcheck=1  <\/code><\/pre>\n<pre><code>root@localhost ~# yum -y install MariaDB-server MariaDB-client  \nroot@localhost ~# systemctl enable mariadb  <\/code><\/pre>\n<p>  <\/p>\n<h2>Nginx\u3067vhost\u3059\u308b\u305f\u3081\u306econfig\u306b\u79fb\u308b\u3088\uff5e<\/h2>\n<pre><code>root@localhost ~# vi \/etc\/nginx\/conf.d\/default.conf  <\/code><\/pre>\n<p>\u958b\u3044\u305f\u3089\u3068\u308a\u3042\u3048\u305a\u3001\u66f8\u304b\u308c\u3066\u3044\u308b\u5185\u5bb9\u3092\u6d88\u3057\u307e\u3057\u3087\u3046\u3002<br \/>\n\u4ed6\u30d6\u30ed\u30b0\u30b5\u30a4\u30c8\u3067\u3082\u69d8\u3005\u306aconfig\u304c\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u65e2\u5b58\u3067\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u5185\u5bb9\u3092\u6d88\u3055\u306a\u3044\u3068\u6587\u6cd5\u30a8\u30e9\u30fc\u3067\u52d5\u304b\u306a\u3044\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002  <\/p>\n<pre><code>server {\n    listen       80;\n    server_name  localhost2;\n    keepalive_timeout  65;\n    client_max_body_size 1024M;\n\n    location \/ {\n         root \/usr\/share\/nginx\/html\/vhost1;\n         index index.php index.html;\n    }\n\n    location ~ .php$ {\n         root          \/usr\/share\/nginx\/html\/vhost1;\n         fastcgi_pass  127.0.0.1:9000;\n         fastcgi_index index.php;\n         fastcgi_param SCRIPT_FILENAME $document_root\/$fastcgi_script_name;\n         include       fastcgi_params;\n     }\n}\n\nserver {\n    listen       81;\n    server_name  localhost3;\n    keepalive_timeout   65;\n    client_max_body_size 1024M;\n\n    location \/ {\n         root \/usr\/share\/nginx\/html\/vhost2;\n         index index.php index.html;\n    }\n\n    location ~ .php$ {\n         root          \/usr\/share\/nginx\/html\/vhost2;\n         fastcgi_pass  127.0.0.1:9000;\n         fastcgi_index index.php;\n         fastcgi_param SCRIPT_FILENAME $document_root\/$fastcgi_script_name;\n         include       fastcgi_params;\n     }\n}<\/code><\/pre>\n<p>\u6b21\u306b\u3001nginx\u306ehello world\u3067\u3042\u308bindex.html\u306a\u3069\u3092\u524a\u9664\u3057\u3066\u304a\u304d\u307e\u3059\u3002  <\/p>\n<pre><code>root@localhost ~# rm -f \/usr\/share\/nginx\/html\/index.html  \n\nroot@localhost ~# rm -f \/usr\/share\/nginx\/html\/50x.html  <\/code><\/pre>\n<h2>php.ini\u3067\u3001upload\u30b5\u30a4\u30ba\u306e\u5909\u66f4\u3092\u52a0\u3048\u307e\u3059\u3002<\/h2>\n<p>\u5b9f\u306f\u3001wordpress\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c0\u30fc\u306f\u305d\u3053\u307e\u3067\u5927\u5bb9\u91cf\u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002<br \/>\n\u3088\u3063\u3066\u3001php.ini\u3067\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u5bb9\u91cf\u306e\u4e0b\u9650\u3092\u5f15\u304d\u4e0a\u3052\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002  <\/p>\n<pre><code>root@localhost ~# vi \/etc\/php.ini  \n\n; Maximum allowed size for uploaded files.\n; http:\/\/php.net\/upload-max-filesize\nupload_max_filesize = 2M   \u21901024M\u306b\u5909\u66f4\n\n; Maximum size of POST data that PHP will accept.\n; Its value may be 0 to disable the limit. It is ignored if POST data reading\n; is disabled through enable_post_data_reading.\n; http:\/\/php.net\/post-max-size\npost_max_size = 8M       \u2190 1024M\u306b\u5909\u66f4  \n<\/code><\/pre>\n<p>\u3053\u3053\u3089\u3078\u3093\u3067\u3001\u3044\u3063\u305f\u3093reboot\u3092\u304b\u3051\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>wordpress\u7528\u306b\u3001database\u3092\u4f5c\u308b\u3002<\/h2>\n<p>\u4eca\u56de\u306f\u3001vhost1 , vhost2\u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u308a\u305d\u3053\u306bwordpress\u3092\u305d\u308c\u305e\u308c\u914d\u7f6e\u3059\u308b\u4e88\u5b9a\u3067\u3059\u3002<br \/>\n\u30dd\u30fc\u30c8\u756a\u53f7\u306f\u524d\u8005\u304c80 , \u5f8c\u8005\u304c81\u306e\u4e88\u5b9a\u3067\u3059\u3002<\/p>\n<p>\n\u3067\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\nvhost1 \u7528  <\/p>\n<pre><code>root@localhost ~# mysql -u root\n\nMariaDB [(none)]&gt; CREATE DATABASE wordpress1; #wordpress1 \u304cvhost1\u7528\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d  \n\nMariaDB [(none)]&gt; GRANT ALL PRIVILEGES ON wordpress1.* TO wp_user1@localhost IDENTIFIED BY &quot;password1&quot;;  \n#\u3053\u306e\u5834\u5408\u3001\u30e6\u30fc\u30b6\u540d : wp_user1 , \u30d1\u30b9\u30ef\u30fc\u30c9 : password1\u306b\u306a\u308b\u3002  \n\nMariaDB [(none)]&gt; exit  <\/code><\/pre>\n<p>vhost2\u7528\u306b\u7e70\u308a\u8fd4\u3057\u307e\u3059\u3002  <\/p>\n<pre><code>root@localhost ~# mysql -u root\n\nMariaDB [(none)]&gt; CREATE DATABASE wordpress2; #wordpress2 \u304cvhost2\u7528\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d  \n\nMariaDB [(none)]&gt; GRANT ALL PRIVILEGES ON wordpress2.* TO wp_user2@localhost IDENTIFIED BY &quot;password2&quot;;  \n#\u3053\u306e\u5834\u5408\u3001\u30e6\u30fc\u30b6\u540d : wp_user2 , \u30d1\u30b9\u30ef\u30fc\u30c9 : password2\u306b\u306a\u308b\u3002  \n\nMariaDB [(none)]&gt; exit  <\/code><\/pre>\n<h2>wordpress\u5c0e\u5165<\/h2>\n<pre><code>root@localhost ~# curl -LO https:\/\/ja.wordpress.org\/latest-ja.tar.gz  \n\n#vhost1\u7528  \nroot@localhost ~# tar -xzvf latest-ja.tar.gz  \nroot@localhost ~# mv \/root\/wordpress\/ \/root\/vhost1\/  \nroot@localhost ~# mv \/root\/vhost1 \/usr\/share\/nginx\/html  \n\n#vhost2\u7528  \nroot@localhost ~# tar -xzvf latest-ja.tar.gz  \nroot@localhost ~# mv \/root\/wordpress\/ \/root\/vhost2\/  \nroot@localhost ~# mv \/root\/vhost2 \/usr\/share\/nginx\/html  \n<\/code><\/pre>\n<p>\u3067\u306f\u3001wordpress \u306econfig\u8a2d\u5b9a\u3092\u81ea\u52d5\u3067\u8a18\u8f09\u3057\u3066\u3082\u3089\u3046\u305f\u3081\u306b\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u6240\u6301\u8005\u5909\u66f4\u53ca\u3073\u3001\u30a2\u30af\u30bb\u30b9\u6a29\u9650\u306e\u5909\u66f4\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre><code>#vhost1\u7528(\u6240\u6709\u8005\u30e6\u30fc\u30b6\u5909\u66f4)  \nroot@localhost ~# chown -R nginx:nginx \/usr\/share\/nginx\/html\/vhost1  \n\n#vhost2\u7528(\u6240\u6709\u8005\u30e6\u30fc\u30b6\u5909\u66f4)  \nroot@localhost ~# chown -R nginx:nginx \/usr\/share\/nginx\/html\/vhost2  \n\n#vhost1\u7528(\u6a29\u9650\u5909\u66f4)  \nroot@localhost ~# chmod -R 777 \/usr\/share\/nginx\/html\/vhost1  \n\n#vhost2\u7528(\u6a29\u9650\u5909\u66f4)  \nroot@localhost ~# chmod -R 777 \/usr\/share\/nginx\/html\/vhost2  \n<\/code><\/pre>\n<p>\u6700\u5f8c\u306b\u3001SELinux \u3068 firewalld\u3092\u7121\u52b9\u5316\u3059\u308b\u3002  <\/p>\n<pre><code>root@localhost ~# vi \/etc\/sysconfig\/selinux  \n\n#     permissive - SELinux prints warnings instead of enforcing.\n#     disabled - No SELinux policy is loaded.\nSELINUX=disabled\n# SELINUXTYPE= can take one of three two values:\n#     targeted - Targeted processes are protected,  \n\nroot@localhost ~# systemctl disable firewalld  <\/code><\/pre>\n<p>\u3046\u307e\u304f\u3044\u304f\u3068\u3001\u3053\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n\u63a5\u7d9a\u5148 vhost1 : IP\/wp-admin<br \/>\n\u63a5\u7d9a\u5148 vhost2 : IP:81\/wp-admin<\/p>\n<p>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/23439178\/47350397-c4613480-d6f0-11e8-9827-2ada3bad5406.jpg\" alt=\"default\" \/><\/p>\n<p>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/23439178\/47350589-202bbd80-d6f1-11e8-8bf3-ab43c862b9ad.jpg\" alt=\"default\" \/><\/p>\n<p>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/23439178\/47351642-5e29e100-d6f3-11e8-90d9-d4c12be9867e.jpg\" alt=\"default\" \/><\/p>\n<p>\n\u3053\u306e\u3088\u3046\u306b\u3001Nginx1\u3064\u3067wordpress2\u3064\u7acb\u3061\u4e0a\u3052\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002!!<\/p>\n<h2>\u6240\u611f<\/h2>\n<p>\u3044\u3084\u3041\u30011\u5e74\u534a\u3050\u3089\u3044\u524d\u304b\u3089vhost\u3067\u304d\u306d\u3047\u3068twitter\u4e0a\u3067\u5606\u3044\u3066\u3044\u307e\u3057\u305f\u304c\u3064\u3044\u306b\u81ea\u5206\u306e\u529b\u3060\u3051\u3067\u7acb\u3061\u4e0a\u3052\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002!!<br \/>\n\u3053\u308c\u3067\u3001\u30b5\u30fc\u30af\u30eb\u306e\u30b5\u30fc\u30d0\u306b\u5bc4\u751f\u3067\u304d\u3000\uff79\uff9e\uff8c\uff9d\uff79\uff9e\uff8c\uff9d...  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3053\u6700\u8fd1\u3001\u3081\u3063\u304d\u308azabbix!! , zabbix!! \u3068\u3044\u3046\u611f\u3058\u3067\u3057\u305f\u304c\u30a4\u30f3\u30bf\u30fc\u30b7\u30c3\u30d7\u5148\u3067nginx\u3092\u5f04\u308b\u6a5f\u4f1a\u304c\u3042\u308a\u307e\u3057\u3066\u3001\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u306e\u3064\u3044\u3067\u306bvhost\u3082\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3068\u3044\u3046\u79c1\u306e\u904a\u3073\u5fc3\u3042\u3075\u308c\u305f\u3082\u306e\u306b\u306a\u3063\u3066\u3044&hellip; <span class=\"clear\"><\/span><a href=\"https:\/\/blog.yukiafronia.com\/?p=33\" class=\"more-link read-more\" rel=\"bookmark\"><span class=\"screen-reader-text\">\u521d\u3081\u3066\u306evhost with Nginx<\/span><i class=\"fa fa-arrow-right\"><\/i> \u306e\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":34,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-33","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.yukiafronia.com\/index.php?rest_route=\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.yukiafronia.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.yukiafronia.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.yukiafronia.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.yukiafronia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=33"}],"version-history":[{"count":2,"href":"https:\/\/blog.yukiafronia.com\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":36,"href":"https:\/\/blog.yukiafronia.com\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions\/36"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.yukiafronia.com\/index.php?rest_route=\/wp\/v2\/media\/34"}],"wp:attachment":[{"href":"https:\/\/blog.yukiafronia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.yukiafronia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.yukiafronia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}