{"id":33140,"date":"2022-11-04T07:21:34","date_gmt":"2023-04-12T18:35:56","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82\/"},"modified":"2024-04-28T22:55:34","modified_gmt":"2024-04-28T14:55:34","slug":"%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82\/","title":{"rendered":"\u5728Amazon Linux 2\u4e0a\uff0c\u901a\u8fc7Extras Library\u5b89\u88c5nginx\uff0c\u5e76\u4f7f\u7528systemd\u8fdb\u884c\u542f\u52a8"},"content":{"rendered":"<h1>\u73af\u5883<\/h1>\n<ul class=\"post-ul\">Amazon Linux 2<\/ul>\n<h1>\u603b\u7ed3<\/h1>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Extras Library \u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>\u53c2\u7167\u5148: https:\/\/aws.amazon.com\/jp\/premiumsupport\/knowledge-center\/ec2-install-extras-library-software\/<\/p>\n<p>systemd \u3092\u4f7f\u3063\u3066\u8d77\u52d5\u3001\u53ca\u3073\u81ea\u52d5\u8d77\u52d5\u306e\u8a2d\u5b9a\u3092\u884c\u3046<\/p>\n<h1>\u6b65\u9aa4<\/h1>\n<h2>\u786e\u8ba4 nginx \u5b58\u5728\u4e8e Extras \u5e93\u4e2d\u3002<\/h2>\n<pre class=\"post-pre\"><code>$ amazon-linux-extras | grep nginx\r\n 38  nginx1=latest            enabled      [ =stable ]\r\n<\/code><\/pre>\n<h2>\u8bf7\u786e\u8ba4\u8be6\u7ec6\u4fe1\u606f\u3002<\/h2>\n<pre class=\"post-pre\"><code>$ amazon-linux-extras info nginx1\r\nnginx1 recommends nginx                      # yum install nginx\r\n<\/code><\/pre>\n<h2>\u5b89\u88c5<\/h2>\n<pre class=\"post-pre\"><code>$ sudo amazon-linux-extras install nginx1\r\n<\/code><\/pre>\n<h2>\u786e\u8ba4\u7248\u672c\u548c\u7f16\u8bd1\u9009\u9879<\/h2>\n<pre class=\"post-pre\"><code>$ nginx -V\r\nnginx version: nginx\/1.18.0\r\nbuilt by gcc 7.3.1 20180712 (Red Hat 7.3.1-8) (GCC)\r\nbuilt with OpenSSL 1.0.2k-fips  26 Jan 2017\r\nTLS SNI support enabled\r\nconfigure arguments: --prefix=\/usr\/share\/nginx --sbin-path=\/usr\/sbin\/nginx --modules-path=\/usr\/lib64\/nginx\/modules --conf-path=\/etc\/nginx\/nginx.conf --error-log-path=\/var\/log\/nginx\/error.log --http-log-path=\/var\/log\/nginx\/access.log --http-client-body-temp-path=\/var\/lib\/nginx\/tmp\/client_body --http-proxy-temp-path=\/var\/lib\/nginx\/tmp\/proxy --http-fastcgi-temp-path=\/var\/lib\/nginx\/tmp\/fastcgi --http-uwsgi-temp-path=\/var\/lib\/nginx\/tmp\/uwsgi --http-scgi-temp-path=\/var\/lib\/nginx\/tmp\/scgi --pid-path=\/run\/nginx.pid --lock-path=\/run\/lock\/subsys\/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-stream_ssl_preread_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-http_auth_request_module --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=\/usr\/lib\/rpm\/redhat\/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=\/usr\/lib\/rpm\/redhat\/redhat-hardened-ld -Wl,-E'\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u662f\u6309\u6362\u884c\u5206\u9694\u7684\u914d\u7f6e\u53c2\u6570\u3002<\/p>\n<pre class=\"post-pre\"><code>--prefix=\/usr\/share\/nginx\r\n--sbin-path=\/usr\/sbin\/nginx\r\n--modules-path=\/usr\/lib64\/nginx\/modules\r\n--conf-path=\/etc\/nginx\/nginx.conf\r\n--error-log-path=\/var\/log\/nginx\/error.log\r\n--http-log-path=\/var\/log\/nginx\/access.log\r\n--http-client-body-temp-path=\/var\/lib\/nginx\/tmp\/client_body\r\n--http-proxy-temp-path=\/var\/lib\/nginx\/tmp\/proxy\r\n--http-fastcgi-temp-path=\/var\/lib\/nginx\/tmp\/fastcgi\r\n--http-uwsgi-temp-path=\/var\/lib\/nginx\/tmp\/uwsgi\r\n--http-scgi-temp-path=\/var\/lib\/nginx\/tmp\/scgi\r\n--pid-path=\/run\/nginx.pid\r\n--lock-path=\/run\/lock\/subsys\/nginx\r\n--user=nginx\r\n--group=nginx\r\n--with-file-aio\r\n--with-ipv6\r\n--with-http_ssl_module\r\n--with-http_v2_module\r\n--with-http_realip_module\r\n--with-stream_ssl_preread_module\r\n--with-http_addition_module\r\n--with-http_xslt_module=dynamic\r\n--with-http_image_filter_module=dynamic\r\n--with-http_geoip_module=dynamic\r\n--with-http_sub_module\r\n--with-http_dav_module\r\n--with-http_flv_module\r\n--with-http_mp4_module\r\n--with-http_gunzip_module\r\n--with-http_gzip_static_module\r\n--with-http_random_index_module\r\n--with-http_secure_link_module\r\n--with-http_degradation_module\r\n--with-http_slice_module\r\n--with-http_stub_status_module\r\n--with-http_perl_module=dynamic\r\n--with-http_auth_request_module\r\n--with-mail=dynamic\r\n--with-mail_ssl_module\r\n--with-pcre\r\n--with-pcre-jit\r\n--with-stream=dynamic\r\n--with-stream_ssl_module\r\n--with-google_perftools_module\r\n--with-debug\r\n--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=\/usr\/lib\/rpm\/redhat\/redhat-hardened-cc1 -m64 -mtune=generic'\r\n--with-ld-opt='-Wl,-z,relro -specs=\/usr\/lib\/rpm\/redhat\/redhat-hardened-ld -Wl,-E'\r\n<\/code><\/pre>\n<h2>\u8bf7\u786e\u8ba4\u542f\u52a8\u6587\u4ef6\u3002<\/h2>\n<pre class=\"post-pre\"><code>$ ll \/usr\/lib\/systemd\/system\/nginx.service\r\n-rw-r--r-- 1 root root 616 Aug 30 06:40 \/usr\/lib\/systemd\/system\/nginx.service\r\n\r\n$ cat \/usr\/lib\/systemd\/system\/nginx.service\r\n[Unit]\r\nDescription=The nginx HTTP and reverse proxy server\r\nAfter=network.target remote-fs.target nss-lookup.target\r\n\r\n[Service]\r\nType=forking\r\nPIDFile=\/run\/nginx.pid\r\n# Nginx will fail to start if \/run\/nginx.pid already exists but has the wrong\r\n# SELinux context. This might happen when running `nginx -t` from the cmdline.\r\n# https:\/\/bugzilla.redhat.com\/show_bug.cgi?id=1268621\r\nExecStartPre=\/usr\/bin\/rm -f \/run\/nginx.pid\r\nExecStartPre=\/usr\/sbin\/nginx -t\r\nExecStart=\/usr\/sbin\/nginx\r\nExecReload=\/bin\/kill -s HUP $MAINPID\r\nKillSignal=SIGQUIT\r\nTimeoutStopSec=5\r\nKillMode=mixed\r\nPrivateTmp=true\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/code><\/pre>\n<p>\u53c2\u8003\uff1aCentOS 7\u4e2dsystemd\u7684\u6587\u4ef6\u5939\u7ed3\u6784\u548c\u6587\u4ef6\u914d\u7f6e<\/p>\n<h2>\u4fee\u6539\u9ed8\u8ba4\u7684\u5355\u5143\u6587\u4ef6<\/h2>\n<p>\u203b \u53c2\u8003\uff1a\u4fee\u6539\u73b0\u6709\u7684\u5355\u5143\u6587\u4ef6<\/p>\n<h4>\u7531\u4e8e\u65e0\u6cd5\u76f4\u63a5\u7f16\u8f91\u4fdd\u5b58\u5728\/usr\/lib\/systemd\/system\/\u76ee\u5f55\u4e2d\u7684\u9ed8\u8ba4\u5355\u5143\u6587\u4ef6\uff0c\u56e0\u6b64\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4efb\u4e00\u65b9\u6cd5\u8fdb\u884c\u7f16\u8f91\u3002<\/h4>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u88dc\u52a9\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u3092 \/etc\/systemd\/system\/unit.d\/ \u306b\u4f5c\u6210\u3059\u308b\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b \/etc\/systemd\/system\/nginx.service.d\/ \u306f\u65e2\u306b\u51fa\u6765\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306b\u4efb\u610f\u306e\u540d\u524d\u3067 config \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u3001\u305d\u308c\u3092\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>  sudo touch \/etc\/systemd\/system\/nginx.service.d\/nginx.conf\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u5143\u306e\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb \/usr\/lib\/systemd\/system\/ \u306e\u30b3\u30d4\u30fc\u3092 \/etc\/systemd\/system\/ \u306b\u4f5c\u6210\u3057\u3001\u305d\u3053\u3067\u5909\u66f4\u3092\u884c\u3046\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>\u4f8b\u3048\u3070\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e pid \u30d5\u30a1\u30a4\u30eb\uff08\/run\/nginx.pid\uff09\u3092\u4e0a\u66f8\u304d\u3059\u308b\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>[Service]\r\n# When you install nginx from the Extras Library, the pid is configured to \/run\/nginx.pid.\r\n# It's overwritten here.\r\nPIDFile=\/var\/run\/nginx.pid\r\nExecStartPre=\/usr\/bin\/rm -f \/var\/run\/nginx.pid\r\n<\/code><\/pre>\n<h4>\u5c06\u8bbe\u7f6e\u66f4\u6539\u66f4\u65b0<\/h4>\n<pre class=\"post-pre\"><code>systemctl daemon-reload\r\nsystemctl reload nginx.service\r\n<\/code><\/pre>\n<h2>\u542f\u52a8<\/h2>\n<pre class=\"post-pre\"><code>$ sudo systemctl start nginx.service\r\n<\/code><\/pre>\n<h2>\u786e\u8ba4\u542f\u52a8<\/h2>\n<pre class=\"post-pre\"><code>$ sudo systemctl status nginx\r\n\u25cf nginx.service - The nginx HTTP and reverse proxy server\r\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/nginx.service; enabled; vendor preset: disabled)\r\n   Active: active (running) since Tue 2020-09-01 08:25:29 UTC; 46min ago\r\n Main PID: 4302 (nginx)\r\n   CGroup: \/system.slice\/nginx.service\r\n           \u251c\u25004302 nginx: master process \/usr\/sbin\/nginx\r\n           \u2514\u25004303 nginx: worker process\r\n\r\n\r\nSep 01 08:25:28 ip-10-0-1-96.ap-northeast-1.compute.internal systemd[1]: Starting The nginx HTTP and reverse proxy server...\r\nSep 01 08:25:29 ip-10-0-1-96.ap-northeast-1.compute.internal nginx[4295]: nginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\r\nSep 01 08:25:29 ip-10-0-1-96.ap-northeast-1.compute.internal nginx[4295]: nginx: configuration file \/etc\/nginx\/nginx.conf test is successful\r\nSep 01 08:25:29 ip-10-0-1-96.ap-northeast-1.compute.internal systemd[1]: Failed to read PID from file \/run\/nginx.pid: Invalid argument\r\nSep 01 08:25:29 ip-10-0-1-96.ap-northeast-1.compute.internal systemd[1]: Started The nginx HTTP and reverse proxy server.\r\n<\/code><\/pre>\n<h2>\u786e\u8ba4\u884c\u52a8<\/h2>\n<pre class=\"post-pre\"><code>$ curl -I localhost\r\nHTTP\/1.1 200 OK\r\n<\/code><\/pre>\n<h2>\u81ea\u52d5\u542f\u52a8\u8bbe\u7f6e<\/h2>\n<pre class=\"post-pre\"><code>$ systemctl is-enabled nginx.service\r\ndisabled\r\n\r\n$ sudo systemctl enable nginx.service\r\n\r\n$ systemctl is-enabled nginx.service\r\nenabled\r\n<\/code><\/pre>\n<h2>\u5c1d\u8bd5\u91cd\u65b0\u542f\u52a8\u64cd\u4f5c\u7cfb\u7edf\uff0c\u786e\u8ba4nginx\u80fd\u591f\u81ea\u52a8\u542f\u52a8\u3002<\/h2>\n<pre class=\"post-pre\"><code>$ sudo reboot\r\n<\/code><\/pre>\n<h2>\u65e5\u5fd7<\/h2>\n<h3>\u8bbf\u95ee\u65e5\u5fd7\u3001\u9519\u8bef\u65e5\u5fd7<\/h3>\n<pre class=\"post-pre\"><code>$ sudo ls -al \/var\/log\/nginx\/\r\ntotal 8\r\ndrwxrwx--- 2 nginx root   41 Sep  1 08:25 .\r\ndrwxr-xr-x 8 root  root 4096 Sep  6 07:53 ..\r\n-rw-r--r-- 1 root  root  298 Sep  6 07:59 access.log\r\n-rw-r--r-- 1 root  root    0 Sep  1 08:25 error.log\r\n<\/code><\/pre>\n<h2>\u5982\u679c\u66f4\u6539\u4e86\u7531 nginx \u542f\u52a8\u7684\u7528\u6237\uff0c\u5219\u9700\u8981\u91c7\u53d6\u76f8\u5e94\u63aa\u65bd\u3002<\/h2>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4e3b\u8fdb\u7a0b\u4ee5root\u8eab\u4efd\u542f\u52a8\uff0c\u5de5\u4f5c\u8fdb\u7a0b\u4ee5nginx\u7528\u6237\u8eab\u4efd\u542f\u52a8\u3002<\/p>\n<pre class=\"post-pre\"><code>$ ps -ef | grep nginx | grep -v grep\r\nroot      9064     1  0 06:26 ?        00:00:00 nginx: master process \/usr\/sbin\/nginx\r\nnginx     9065  9064  0 06:26 ?        00:00:00 nginx: worker process\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>$ grep nginx \/etc\/passwd\r\nnginx:x:996:994:Nginx web server:\/var\/lib\/nginx:\/sbin\/nologin\r\n<\/code><\/pre>\n<p>\u5982\u679c\u5728\u914d\u7f6e\u6216\u5176\u4ed6\u5730\u65b9\u6307\u5b9a\u4e86\u4e00\u4e2a\u4e0d\u540c\u4e8enginx\u7528\u6237\u7684\u7528\u6237\u5e76\u542f\u52a8\u7684\u8bdd\uff0c\u4f1a\u51fa\u73b0\u4ee5\u4e0b\u7684\u9519\u8bef\u3002<\/p>\n<pre class=\"post-pre\"><code>2020\/09\/11 12:39:37 [crit] 3504#0: *1 open() \"\/var\/lib\/nginx\/tmp\/proxy\/1\/00\/0000000001\" failed (13: Permission denied) while reading upstream, client: 120.51.41.11, server: localhost, request: \"GET ...\" \r\n<\/code><\/pre>\n<p>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u9012\u5f52\u66f4\u6539 \/var\/lib\/nginx \u7684\u6240\u6709\u8005\u3002<\/p>\n<pre class=\"post-pre\"><code>$ sudo chown -R &lt;new_user&gt; \/var\/lib\/nginx\r\n<\/code><\/pre>\n<h3>\u65b0\u95fb\u65e5\u5fd7<\/h3>\n<pre class=\"post-pre\"><code>$ sudo journalctl -u nginx.service\r\n<\/code><\/pre>\n<h2>\u5907\u5fd8\u5f55\uff08\u5404\u79cd\u6307\u4ee4\uff09<\/h2>\n<h3>\u542f\u7528\/\u7981\u7528<\/h3>\n<pre class=\"post-pre\"><code>$ sudo systemctl enable nginx.service\r\n\r\n$ systemctl is-enabled nginx.service\r\nenabled\r\n\r\n$ sudo systemctl disable nginx.service\r\nRemoved symlink \/etc\/systemd\/system\/multi-user.target.wants\/nginx.service.\r\n<\/code><\/pre>\n<h3>\u5f00\u59cb\/\u505c\u6b62\/\u91cd\u65b0\u52a0\u8f7d\/\u91cd\u65b0\u542f\u52a8<\/h3>\n<pre class=\"post-pre\"><code>$ sudo systemctl start nginx.service\r\n\r\n$ sudo systemctl stop nginx.service\r\n\r\n$ sudo systemctl reload nginx.service\r\n\r\n$ sudo systemctl restart nginx.service\r\n<\/code><\/pre>\n<h3>\u72b6\u6001<\/h3>\n<pre class=\"post-pre\"><code>$ sudo systemctl status nginx\r\n\u25cf nginx.service - The nginx HTTP and reverse proxy server\r\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/nginx.service; enabled; vendor preset: disabled)\r\n   Active: active (running) since Tue 2020-09-01 08:25:29 UTC; 46min ago\r\n Main PID: 4302 (nginx)\r\n   CGroup: \/system.slice\/nginx.service\r\n           \u251c\u25004302 nginx: master process \/usr\/sbin\/nginx\r\n           \u2514\u25004303 nginx: worker process\r\n\r\n\r\nSep 01 08:25:28 ip-10-0-1-96.ap-northeast-1.compute.internal systemd[1]: Starting The nginx HTTP and reverse proxy server...\r\nSep 01 08:25:29 ip-10-0-1-96.ap-northeast-1.compute.internal nginx[4295]: nginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\r\nSep 01 08:25:29 ip-10-0-1-96.ap-northeast-1.compute.internal nginx[4295]: nginx: configuration file \/etc\/nginx\/nginx.conf test is successful\r\nSep 01 08:25:29 ip-10-0-1-96.ap-northeast-1.compute.internal systemd[1]: Failed to read PID from file \/run\/nginx.pid: Invalid argument\r\nSep 01 08:25:29 ip-10-0-1-96.ap-northeast-1.compute.internal systemd[1]: Started The nginx HTTP and reverse proxy server.\r\n<\/code><\/pre>\n<h3>\u91cd\u65b0\u52a0\u8f7d\u5b88\u62a4\u7a0b\u5e8f\u914d\u7f6e<\/h3>\n<pre class=\"post-pre\"><code>sudo systemctl daemon-reload\r\n<\/code><\/pre>\n<h3>\u5217\u51fa\u5355\u4f4d\u6587\u4ef6<\/h3>\n<pre class=\"post-pre\"><code>sudo systemctl list-unit-files --type=service\r\n\r\nsystemd-modules-load.service                  static\r\nsystemd-nspawn@.service                       disabled\r\nsystemd-poweroff.service                      static\r\nsystemd-quotacheck.service                    static\r\nsystemd-random-seed.service                   static\r\nsystemd-readahead-collect.service             enabled\r\n<\/code><\/pre>\n<h3>\u5217\u51fa\u4f9d\u8d56\u9879\uff08\u786e\u8ba4\u542f\u52a8\u987a\u5e8f\uff09<\/h3>\n<pre class=\"post-pre\"><code>$ systemctl list-dependencies\r\n\r\n$ systemctl list-dependencies -a\r\n<\/code><\/pre>\n<h3>systemd-analyze verify \u7684\u672c\u5730\u5316\u4e2d\u6587\u91ca\u4e49<\/h3>\n<pre class=\"post-pre\"><code>$ sudo systemd-analyze verify \/etc\/systemd\/system\/unicorn.service\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u73af\u5883 Amazon Linux 2 \u603b\u7ed3 Extras Library \u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b \u53c2\u7167\u5148: htt [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-33140","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728Amazon Linux 2\u4e0a\uff0c\u901a\u8fc7Extras Library\u5b89\u88c5nginx\uff0c\u5e76\u4f7f\u7528systemd\u8fdb\u884c\u542f\u52a8 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728amazon-linux-2\u4e0a\uff0c\u901a\u8fc7extras-library\u5b89\u88c5nginx\uff0c\u5e76\u4f7f\u7528systemd\u8fdb\u884c\u542f\u52a8\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728Amazon Linux 2\u4e0a\uff0c\u901a\u8fc7Extras Library\u5b89\u88c5nginx\uff0c\u5e76\u4f7f\u7528systemd\u8fdb\u884c\u542f\u52a8\" \/>\n<meta property=\"og:description\" content=\"\u73af\u5883 Amazon Linux 2 \u603b\u7ed3 Extras Library \u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b \u53c2\u7167\u5148: htt [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728amazon-linux-2\u4e0a\uff0c\u901a\u8fc7extras-library\u5b89\u88c5nginx\uff0c\u5e76\u4f7f\u7528systemd\u8fdb\u884c\u542f\u52a8\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-12T18:35:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-28T14:55:34+00:00\" \/>\n<meta name=\"author\" content=\"\u9038, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u9038, \u79d1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82\/\",\"name\":\"\u5728Amazon Linux 2\u4e0a\uff0c\u901a\u8fc7Extras Library\u5b89\u88c5nginx\uff0c\u5e76\u4f7f\u7528systemd\u8fdb\u884c\u542f\u52a8 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-04-12T18:35:56+00:00\",\"dateModified\":\"2024-04-28T14:55:34+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728Amazon Linux 2\u4e0a\uff0c\u901a\u8fc7Extras Library\u5b89\u88c5nginx\uff0c\u5e76\u4f7f\u7528systemd\u8fdb\u884c\u542f\u52a8\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487\",\"name\":\"\u9038, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g\",\"caption\":\"\u9038, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keyi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5728Amazon Linux 2\u4e0a\uff0c\u901a\u8fc7Extras Library\u5b89\u88c5nginx\uff0c\u5e76\u4f7f\u7528systemd\u8fdb\u884c\u542f\u52a8 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728amazon-linux-2\u4e0a\uff0c\u901a\u8fc7extras-library\u5b89\u88c5nginx\uff0c\u5e76\u4f7f\u7528systemd\u8fdb\u884c\u542f\u52a8\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5728Amazon Linux 2\u4e0a\uff0c\u901a\u8fc7Extras Library\u5b89\u88c5nginx\uff0c\u5e76\u4f7f\u7528systemd\u8fdb\u884c\u542f\u52a8","og_description":"\u73af\u5883 Amazon Linux 2 \u603b\u7ed3 Extras Library \u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b \u53c2\u7167\u5148: htt [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728amazon-linux-2\u4e0a\uff0c\u901a\u8fc7extras-library\u5b89\u88c5nginx\uff0c\u5e76\u4f7f\u7528systemd\u8fdb\u884c\u542f\u52a8\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-04-12T18:35:56+00:00","article_modified_time":"2024-04-28T14:55:34+00:00","author":"\u9038, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u9038, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82\/","name":"\u5728Amazon Linux 2\u4e0a\uff0c\u901a\u8fc7Extras Library\u5b89\u88c5nginx\uff0c\u5e76\u4f7f\u7528systemd\u8fdb\u884c\u542f\u52a8 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-04-12T18:35:56+00:00","dateModified":"2024-04-28T14:55:34+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5728Amazon Linux 2\u4e0a\uff0c\u901a\u8fc7Extras Library\u5b89\u88c5nginx\uff0c\u5e76\u4f7f\u7528systemd\u8fdb\u884c\u542f\u52a8"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487","name":"\u9038, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g","caption":"\u9038, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keyi\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8amazon-linux-2%e4%b8%8a%ef%bc%8c%e9%80%9a%e8%bf%87extras-library%e5%ae%89%e8%a3%85nginx%ef%bc%8c%e5%b9%b6%e4%bd%bf%e7%94%a8systemd%e8%bf%9b%e8%a1%8c%e5%90%af%e5%8a%a8%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=33140"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33140\/revisions"}],"predecessor-version":[{"id":63209,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33140\/revisions\/63209"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=33140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=33140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=33140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}