{"id":190,"date":"2024-05-02T22:26:44","date_gmt":"2024-05-02T14:26:44","guid":{"rendered":"https:\/\/ch.book2022.top\/?p=190"},"modified":"2026-04-01T15:11:02","modified_gmt":"2026-04-01T07:11:02","slug":"docker%e5%ae%89%e8%a3%85almalinux9-3%e5%ae%b9%e5%99%a8%e5%b9%b6%e6%89%8b%e5%8a%a8%e9%83%a8%e7%bd%b2lnmp%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/txt.book2020.top\/?p=190","title":{"rendered":"Docker\u5b89\u88c5almalinux9.3\u5bb9\u5668\u5e76\u624b\u52a8\u90e8\u7f72LNMP\u73af\u5883"},"content":{"rendered":"\n<p>connect\u7cfb \u5b89\u88c5docker\uff0cdnf\u4e0d\u652f\u6301connect7\uff0c\u76f4\u63a5\u7528yum\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install -y yum-utils<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>yum-config-manager \\\n    --add-repo \\\n    https:&#47;&#47;download.docker.com\/linux\/centos\/docker-ce.repo<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b89\u88c5 Docker Engine-Community<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;Debian Docker \u5b89\u88c5&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install \\\n    apt-transport-https \\\n    ca-certificates \\\n    curl \\\n    gnupg2 \\\n    software-properties-common<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684 Docker Engine-Community \u548c containerd<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install docker-ce docker-ce-cli containerd.io<\/code><\/pre>\n\n\n\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;Ubuntu Docker \u5b89\u88c5&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install \\\n    apt-transport-https \\\n    ca-certificates \\\n    curl \\\n    gnupg-agent \\\n    software-properties-common<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5 Docker Engine-Community<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install docker-ce docker-ce-cli containerd.io<\/code><\/pre>\n\n\n\n<p>\u542f\u52a8 Docker\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl start docker<\/code><\/pre>\n\n\n\n<p>\u5f00\u673a\u81ea\u52a8\u542f\u52a8\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable docker<\/code><\/pre>\n\n\n\n<p> pull \u8f7d\u5165 almalinux:9.3 \u955c\u50cf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker pull almalinux:9.3<\/code><\/pre>\n\n\n\n<p>\u5217\u51fa\u672c\u5730\u4e3b\u673a\u4e0a\u7684\u955c\u50cf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker images<\/code><\/pre>\n\n\n\n<p>\u8fd0\u884c\u5bb9\u5668\uff0c-p \u662f\u5bb9\u5668\u7aef\u53e3\u6620\u5c04\u5230\u672c\u5730\uff0c&#8211;restart=always \u5f00\u673a\u81ea\u542f\uff0c-v \u5bb9\u5668\u8def\u5f84\u4e0b\u7684\u5185\u5bb9\u6620\u5c04\u5230\u672c\u5730\u8def\u5f84\u4e0b\uff0c\u76f4\u63a5\u5728\u672c\u5730\/etc\/nginx\/\u4fee\u6539\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker run --privileged -itd -p 80:80 -p 443:443 --restart=always -v \/etc\/nginx\/ssl:\/etc\/nginx\/ssl -v \/etc\/nginx\/html:\/etc\/nginx\/html -v \/etc\/nginx\/logs:\/etc\/nginx\/logs -v \/etc\/nginx\/conf\/conf.d:\/etc\/nginx\/conf\/conf.d --restart=always --name almalinux eecc3c913b1e \/usr\/sbin\/init<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b89\u88c5bbr<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"net.core.default_qdisc=fq\" &gt;&gt; \/etc\/sysctl.conf &amp;&amp; echo \"net.ipv4.tcp_congestion_control=bbr\" &gt;&gt; \/etc\/sysctl.conf &amp;&amp; sysctl -p &amp;&amp; lsmod | grep bbr<\/code><\/pre>\n\n\n\n<p>\u67e5\u770b\u8fd0\u884c\u7684\u5bb9\u5668<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker ps<\/code><\/pre>\n\n\n\n<p>\u505c\u6b62\u4e00\u4e2a\u5bb9\u5668<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker stop \u5bb9\u5668ID<\/code><\/pre>\n\n\n\n<p>\u542f\u52a8\u4e00\u4e2a\u5df2\u505c\u6b62\u7684\u5bb9\u5668\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker start \u5bb9\u5668ID<\/code><\/pre>\n\n\n\n<p>\u8fdb\u5165\u5bb9\u5668<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker exec -it almalinux \/bin\/bash<\/code><\/pre>\n\n\n\n<p>docker\u4fee\u6539\u65f6\u95f4\u4e0d\u51c6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rpm -ivh https:\/\/rpmfind.net\/linux\/almalinux\/9.6\/BaseOS\/x86_64\/os\/Packages\/tzdata-2025b-1.el9.noarch.rpm<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"Asia\/Shanghai\" &gt; \/etc\/timezone<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>ln -sf \/usr\/share\/zoneinfo\/Asia\/Shanghai \/etc\/localtime<\/code><\/pre>\n\n\n\n<p>\u9000\u51fa docker\u4e0b\u955c\u50cf\u8fd8\u4fdd\u6301\u955c\u50cf\u8fd0\u884c<br>\u952e\u76d8\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Ctrl+P+Q<\/code><\/pre>\n\n\n\n<p>\u8fdb\u5165\u5bb9\u5668\u540e\uff0c\u8fdb\u5165\u5bb9\u5668\u540e\uff0c\u8fdb\u5165\u5bb9\u5668\u540e\uff0c\u624b\u52a8\u90e8\u7f72LNMP\u73af\u5883<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dnf update &amp;&amp; dnf install gcc gcc-c++ zlib zlib-devel pcre pcre-devel openssl openssl-devel libxslt libxslt-devel gd gd-devel make perl perl-devel tar vim nano wget<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>rpm -ivh https:\/\/rpmfind.net\/linux\/opensuse\/distribution\/leap\/16.0\/repo\/oss\/x86_64\/geoipupdate-7.0.1-160000.2.1.x86_64.rpm<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>rpm -ivh https:\/\/www.rpmfind.net\/linux\/opensuse\/distribution\/leap\/15.6\/repo\/oss\/noarch\/GeoIP-data-1.6.12-6.3.1.noarch.rpm<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>rpm -ivh https:\/\/rpmfind.net\/linux\/remi\/enterprise\/9\/remi\/x86_64\/GeoIP-1.6.12-9.el9.remi.x86_64.rpm<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>rpm -ivh https:\/\/rpmfind.net\/linux\/remi\/enterprise\/9\/remi\/x86_64\/GeoIP-devel-1.6.12-9.el9.remi.x86_64.rpm<\/code><\/pre>\n\n\n\n<p>\u4e0b\u8f7d\/\u5b89\u88c5 openssl-3.5.2<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget -nc --no-check-certificate https:\/\/github.com\/openssl\/openssl\/releases\/download\/openssl-3.5.2\/openssl-3.5.2.tar.gz &amp;&amp; tar -zxvf openssl-3.5.2.tar.gz<\/code><\/pre>\n\n\n\n<p>\u4e0b\u8f7d nginx-1.28.0\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget -nc --no-check-certificate https:\/\/nginx.org\/download\/nginx-1.28.0.tar.gz &amp;&amp; tar -zxvf nginx-1.28.0.tar.gz<\/code><\/pre>\n\n\n\n<p>\u5220\u9664 nginx-1.28.0.tar.gz\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rm -rf nginx-1.28.0.tar.gz &amp;&amp; rm -rf openssl-3.5.2.tar.gz &amp;&amp; cd nginx-1.28.0<\/code><\/pre>\n\n\n\n<p>\u6dfb\u52a0\u7f16\u8bd1\u63d2\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/configure --prefix=\/etc\/nginx \\\n    --with-threads \\\n    --with-file-aio \\\n    --with-http_ssl_module \\\n    --with-http_v2_module \\\n    --with-http_v3_module \\\n    --with-http_realip_module \\\n    --with-http_addition_module \\\n    --with-http_xslt_module=dynamic \\\n    --with-http_image_filter_module=dynamic \\\n    --with-http_geoip_module=dynamic \\\n    --with-http_sub_module \\\n    --with-http_dav_module \\\n    --with-http_flv_module \\\n    --with-http_mp4_module \\\n    --with-http_gunzip_module \\\n    --with-http_gzip_static_module \\\n    --with-http_auth_request_module \\\n    --with-http_random_index_module \\\n    --with-http_secure_link_module \\\n    --with-http_degradation_module \\\n    --with-http_slice_module \\\n    --with-http_stub_status_module \\\n    --with-cc-opt='-O3' \\\n    --with-cpu-opt=CPU \\\n    --with-pcre \\\n    --with-stream \\\n    --with-stream_ssl_module \\\n    --with-stream_realip_module \\\n    --with-stream_geoip_module \\\n    --with-stream_geoip_module=dynamic \\\n    --with-stream_ssl_preread_module \\\n    --with-compat \\\n    --with-pcre-jit \\\n    --with-openssl-opt=enable-tls1_3 \\\n    --with-openssl=..\/openssl-3.5.2<\/code><\/pre>\n\n\n\n<p>\u7f16\u8bd1\/\u5b89\u88c5 nginx-1.28.0\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make &amp;&amp; make install<\/code><\/pre>\n\n\n\n<p>\u914d\u7f6enginx-1.28.0\u670d\u52a1\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat &gt;\/etc\/systemd\/system\/nginx.service &lt;&lt;EOF\n&#91;Unit]\nDescription=A high performance web server and a reverse proxy server\nDocumentation=man:nginx(8)\nAfter=network.target nss-lookup.target\n\n&#91;Service]\nType=forking\nPIDFile=\/etc\/nginx\/logs\/nginx.pid\nExecStartPre=\/etc\/nginx\/sbin\/nginx -t -q -g 'daemon on; master_process on;'\nExecStart=\/etc\/nginx\/sbin\/nginx -g 'daemon on; master_process on;'\nExecReload=\/etc\/nginx\/sbin\/nginx -g 'daemon on; master_process on;' -s reload\nExecStop=-\/sbin\/start-stop-daemon --quiet --stop --retry QUIT\/5 --pidfile \/etc\/nginx\/logs\/nginx.pid\nTimeoutStopSec=5\nKillMode=mixed\n\n&#91;Install]\nWantedBy=multi-user.target\nEOF<\/code><\/pre>\n\n\n\n<p>\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p \/etc\/nginx\/ssl \/etc\/systemd\/system\/nginx.service.d &amp;&amp; printf \"&#91;Service]\\nExecStartPost=\/bin\/sleep 0.1\\n\" &gt; \/etc\/systemd\/system\/nginx.service.d\/override.conf<\/code><\/pre>\n\n\n\n<p>\u8fd4\u56de\u5217\u8868\u5220\u9664\u6587\u4ef6\u5939<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd .. &amp;&amp; rm -rf nginx-1.28.0 openssl-3.5.2<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5wordpress<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/etc\/nginx\/html &amp;&amp; wget https:\/\/cn.wordpress.org\/latest-zh_CN.zip &amp;&amp; unzip latest-zh_CN.zip &amp;&amp; mv wordpress\/* \/etc\/nginx\/html &amp;&amp; rm -rf latest-zh_CN.zip wordpress &amp;&amp; cd<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5nginx\u914d\u7f6e\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim \/etc\/nginx\/conf\/nginx.conf<\/code><\/pre>\n\n\n\n<p>\u5728\u7b2c\u4e00\u884c\u6dfb\u52a0<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>load_module \/etc\/nginx\/modules\/ngx_stream_module.so;\nuser  root;<\/code><\/pre>\n\n\n\n<p>http {<\/p>\n\n\n\n<p>\u6dfb\u52a0<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>include conf.d\/default.conf;<\/code><\/pre>\n\n\n\n<p>include mime.types;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/nginx\/conf\/conf.d\/default.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># generated 2025-09-04, Mozilla Guideline v5.6, nginx 1.28.0, OpenSSL 3.5.2, intermediate config\n# https:\/\/ssl-config.mozilla.org\/#server=nginx&amp;version=1.28.0&amp;config=intermediate&amp;openssl=3.5.2&amp;guideline=5.6\n\n#\tinclude conf.d\/stream.conf;\n#\tinclude conf.d\/default.conf;\n\n    fastcgi_connect_timeout 300;\n    fastcgi_send_timeout 300;\n    fastcgi_read_timeout 300;\n    fastcgi_buffer_size 64k;\n    fastcgi_buffers 4 64k;\n    fastcgi_busy_buffers_size 128k;\n    fastcgi_temp_file_write_size 256k;\n\n    log_format  main  '$remote_addr - $remote_user &#91;$time_local] \"$request\" '\n                      '$status $body_bytes_sent \"$http_referer\" '\n                      '\"$http_user_agent\" \"$http_x_forwarded_for\"';\n\n#    access_log  logs\/access.log combined buffer=512k flush=1m;\n    access_log off;\n    error_log  logs\/error.log;\n\n    tcp_nopush     on;\n    client_max_body_size 10240M;\n\n    # \u9632\u6b62\u7f51\u7ad9\u88ab\u5d4c\u5165\u6076\u610f\u7f51\u9875\u4e2d\uff0c\u907f\u514d\u70b9\u51fb\u52ab\u6301\n    add_header X-Frame-Options \"SAMEORIGIN\";\n\n    # \u542f\u7528\u6d4f\u89c8\u5668XSS\u9632\u62a4\u529f\u80fd\uff0c\u5e76\u5728\u68c0\u6d4b\u5230\u653b\u51fb\u65f6\uff0c\u505c\u6b62\u6e32\u67d3\u9875\u9762\n    add_header X-XSS-Protection \"1; mode=block\";\n\n    # \u7981\u6b62\u6d4f\u89c8\u5668\u731c\u6d4b\uff08\u55c5\u63a2\uff09\u8d44\u6e90\u7684MIME\u7c7b\u578b\uff0c\u9632\u6b62\u8d44\u6e90\u7c7b\u578b\u6df7\u6dc6\u653b\u51fb\n    add_header X-Content-Type-Options \"nosniff\";\n\n    # \u63a7\u5236\u5f15\u7528\u5730\u5740\u4fe1\u606f\u7684\u4f20\u9012\uff0c\u589e\u5f3a\u9690\u79c1\u4fdd\u62a4\n    add_header Referrer-Policy \"strict-origin-origin-when-cross-origin\";\n\n    server {\n        listen 443 ssl;\n        listen &#91;::]:443 ssl;\n        http2 on;\n        ssl_certificate \/etc\/nginx\/ssl\/cert.pem;\n        ssl_certificate_key \/etc\/nginx\/ssl\/key.pem;\n\n        # HSTS (ngx_http_headers_module is required) (63072000 seconds)\n        add_header Strict-Transport-Security \"max-age=63072000\" always;\n\t\tlocation ~ \\.php$ {\n            fastcgi_pass   unix:\/run\/php-fpm\/www.sock;\n            fastcgi_index  index.php;\n            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;\n            include        fastcgi_params;\n        }\n        location \/ {\n            if ($host ~* \"\\d+\\.\\d+\\.\\d+\\.\\d+\") {\n                return 500;\n            }\n            if ($host != \"www.xxxxx.com\"){\n                return 500;\n            }\n            root   html;\n            index  index.php index.html index.htm;\n\t\t}\n    }\n\n    # intermediate configuration\n    ssl_protocols TLSv1.2 TLSv1.3;\n    ssl_ecdh_curve X25519:prime256v1:secp384r1;\n    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;\n    ssl_prefer_server_ciphers off;\n\n    # see also ssl_session_ticket_key alternative to stateful session cache\n    ssl_session_timeout 1d;\n    ssl_session_cache shared:MozSSL:10m;  # about 40000 sessions\n\n    # curl https:\/\/ssl-config.mozilla.org\/ffdhe2048.txt &gt; \/etc\/nginx\/ssl\/dhparam\n    ssl_dhparam \"\/etc\/nginx\/ssl\/dhparam\";\n\n    # HSTS\n    server {\n        listen 80 default_server;\n        listen &#91;::]:80 default_server;\n        location \/ {\n            if ($host ~* \"\\d+\\.\\d+\\.\\d+\\.\\d+\") {\n                return 500;\n            }\n            if ($host != \"www.xxxxx.com\"){\n                return 500;\n            }\n            return 301 https:\/\/$host$request_uri;\n\t\t}\n\n    }<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5 php\uff1a<\/p>\n\n\n\n<p>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u5b89\u88c5EPEL\u5b58\u50a8\u5e93<\/p>\n\n\n\n<p><s>dnf install -y https:\/\/mirrors.aliyun.com\/remi\/enterprise\/remi-release-9.rpm<\/s><\/p>\n\n\n\n<p>\u5b89\u88c5yum utils\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u7528remi-repository<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dnf install -y https:\/\/rpms.remirepo.net\/enterprise\/remi-release-9.rpm<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5<s>dnf-utils<\/s>\u548cRemi-packages\u4e4b\u540e\uff0c\u901a\u8fc7\u8fd0\u884c\u547d\u4ee4\u641c\u7d22\u53ef\u4e0b\u8f7d\u7684PHP\u6a21\u5757\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dnf module list php<\/code><\/pre>\n\n\n\n<p>\u542f\u7528PHP 8.3\u6a21\u5757\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dnf module enable php:remi-8.3<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5PHP \u53ca\u6269\u5c55<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dnf install php php-fpm php-bcmath php-cli php-common php-gd php-imap php-mbstring php-mcrypt php-mysql php-mysqlnd php-pdo php-soap php-tidy php-xml php-xmlrpc php-opcache php-redis php-pecl-mcrypt -y<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\u68c0\u67e5\u7248\u672c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php --version<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5 MariaDB<\/p>\n\n\n\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cRocky9 \u57fa\u7840\u5b58\u50a8\u5e93\u4e2d\u63d0\u4f9b\u4e86 MariaDB\u3002\u73b0\u5728\u6211\u4eec\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5c06 MariaDB \u5b89\u88c5\u5230\u60a8\u7684\u7cfb\u7edf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dnf install mariadb-server<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\u68c0\u67e5\u7248\u672c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mariadb --version<\/code><\/pre>\n\n\n\n<p>\u4fee\u6539\/etc\/php-fpm.d\/www.conf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sed -i 's\/^user = apache\/user = nginx\/' \/etc\/php-fpm.d\/www.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sed -i 's\/^group = apache\/group = nginx\/' \/etc\/php-fpm.d\/www.conf<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>user = apache<\/li>\n\n\n\n<li>group = apache<\/li>\n\n\n\n<li>\u6539\u4e3a<\/li>\n\n\n\n<li>user = nginx<\/li>\n\n\n\n<li>group = nginx<\/li>\n<\/ul>\n\n\n\n<p>\u8d4b\u4e88html\u6587\u4ef6\u5939\u6743\u9650<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chown -R nginx:nginx \/etc\/nginx\/html<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u73b0\u5728\u542f\u7528 PHP MariaDB\uff08\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\uff09\uff0c\u542f\u52a8 MariaDB\uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1\u72b6\u6001\uff1a<\/p>\n\n\n\n<p>\u5f00\u542fphp\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl start php-fpm<\/code><\/pre>\n\n\n\n<p>\u5f00\u542f\u72b6\u6001\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status php-fpm<\/code><\/pre>\n\n\n\n<p>\u5f00\u673a\u81ea\u52a8\u542f\u52a8\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable php-fpm<\/code><\/pre>\n\n\n\n<p>\u91cd\u65b0\u542f\u52a8\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart php-fpm<\/code><\/pre>\n\n\n\n<p>\u5f00\u542fmariadb\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl start mariadb<\/code><\/pre>\n\n\n\n<p>\u5f00\u542f\u72b6\u6001\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status mariadb<\/code><\/pre>\n\n\n\n<p>\u5f00\u673a\u81ea\u52a8\u542f\u52a8\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable mariadb<\/code><\/pre>\n\n\n\n<p>\u91cd\u65b0\u542f\u52a8\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart mariadb<\/code><\/pre>\n\n\n\n<p>mysql\u6216MariaDB\u5b89\u5168\u52a0\u56fa\uff1a<br>\u4f1a\u8bbe\u7f6e\u5bc6\u7801\uff0c\u754c\u97621\u76f4\u63a5\u56de\u8f66\uff0c\u5269\u7684\u90fd\u9009Y\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql_secure_installation<\/code><\/pre>\n\n\n\n<p>root\u767b\u5f55\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<p>\u521b\u5efa\u6570\u636e\u5e93\u975eroot\u7528\u6237\u540d\u5bc6\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create database wordpress; create user name@localhost identified by 'password';<\/code><\/pre>\n\n\n\n<p>\u6388\u4e88\u6743\u9650\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grant all privileges on wordpress.* to name@localhost; flush privileges;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4fee\u6539\u767b\u5f55\u5bc6\u7801\u65e0\u6548<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>ALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD(\"password\");<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u67e5\u770b\u5f53\u524d\u7684\u6570\u636e\u5e93\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>show databases;<\/code><\/pre>\n\n\n\n<p>\u9000\u51fa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>exit<\/code><\/pre>\n\n\n\n<p>\u52a0\u8f7d\u5355\u5143\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl daemon-reload<\/code><\/pre>\n\n\n\n<p>\u5f00\u542fnginx\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl start nginx<\/code><\/pre>\n\n\n\n<p>\u5f00\u542f\u72b6\u6001\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status nginx<\/code><\/pre>\n\n\n\n<p>\u5f00\u673a\u81ea\u52a8\u542f\u52a8\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable nginx<\/code><\/pre>\n\n\n\n<p>\u91cd\u65b0\u542f\u52a8\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart nginx<\/code><\/pre>\n\n\n\n<p>\u505c\u6b62nginx\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>service nginx stop<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>connect\u7cfb \u5b89\u88c5docker\uff0cdnf\u4e0d\u652f\u6301connect7\uff0c\u76f4\u63a5\u7528yum\u547d\u4ee4 &#8212;&#038;#8212&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-190","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/txt.book2020.top\/index.php?rest_route=\/wp\/v2\/posts\/190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/txt.book2020.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/txt.book2020.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/txt.book2020.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/txt.book2020.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=190"}],"version-history":[{"count":1,"href":"https:\/\/txt.book2020.top\/index.php?rest_route=\/wp\/v2\/posts\/190\/revisions"}],"predecessor-version":[{"id":238,"href":"https:\/\/txt.book2020.top\/index.php?rest_route=\/wp\/v2\/posts\/190\/revisions\/238"}],"wp:attachment":[{"href":"https:\/\/txt.book2020.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/txt.book2020.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/txt.book2020.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}