{"id":54,"date":"2025-05-16T23:29:51","date_gmt":"2025-05-16T15:29:51","guid":{"rendered":"https:\/\/blog.zjfahhdsh.top\/?p=54"},"modified":"2025-05-28T22:27:06","modified_gmt":"2025-05-28T14:27:06","slug":"arm%e5%bc%80%e5%8f%91%e6%9d%bf%e4%bd%9cweb%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/blog.zjfahhdsh.top\/?p=54","title":{"rendered":"Arm\u5f00\u53d1\u677f\u642d\u5efa\u4e2a\u4eba\u535a\u5ba2"},"content":{"rendered":"\n<p>\u4f7f\u7528\u7684\u5f00\u53d1\u677f\u662f\u6b63\u70b9\u539f\u5b50\u7684STM32MP157,\u4e4b\u524d\u5c1d\u8bd5\u8fc7\u4e0d\u4f7f\u7528docker\u90e8\u7f72\uff0c\u4f46\u662f\u7531\u4e8e\u5404\u79cd\u4f9d\u8d56\u4e0d\u517c\u5bb9\uff0c\u6240\u4ee5\u653e\u5f03\u4e86\u3002<br><strong>1.docker<\/strong>\u5b89\u88c5<br>\u4e0b\u8f7ddocker<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget <a href=\"https:\/\/download.docker.com\/linux\/static\/stable\/armhf\/docker-28.1.1.tgz\">https:\/\/download.docker.com\/linux\/static\/stable\/armhf\/docker-28.1.1.tgz<\/a><\/code><\/pre>\n\n\n\n<p>\u89e3\u538b\u7f29<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar -zxvf docker-28.1.1.tgz<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5(\u6ca1\u6709\u6743\u9650\u52a0sudo)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv -r docker \/opt<\/code><\/pre>\n\n\n\n<p>\u6dfb\u52a0\u81f3\u73af\u5883\u53d8\u91cf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/etc\/profile\nexport PATH=\/opt\/docker\/:$PATH\nsource  \/etc\/profile<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6210<\/p>\n\n\n\n<p><strong>2.\u4e0b\u8f7ddocker\u955c\u50cf<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker pull  arm32v7\/nginx\ndocker pull arm32v7\/wordpress\ndocker pull lsioarmhf\/mariadb\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>root@ATK-MP157:~# docker images\nREPOSITORY          TAG          IMAGE ID       CREATED         SIZE\narm32v7\/nginx       alpine       8d8ef889c1f9   5 weeks ago     33.9MB\narm32v7\/wordpress   php8.0-fpm   49f97d182d5f   18 months ago   494MB\nlsioarmhf\/mariadb   latest       814ef92c8d93   6 years ago     296MB<\/code><\/pre>\n\n\n\n<p><br><strong>3.\u914d\u7f6eNginx<\/strong><\/p>\n\n\n\n<p>\u5148\u914d\u7f6eNginx<br>\u590d\u5236Nginx\u914d\u7f6e\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p \/usr\/local\/share\/nginx &amp;&amp; cp \/etc\/nginx\/nginx.conf \/usr\/local\/share\/nginx\/\n#\u628auser www;pid \/run\/nginx\/nginx.pid;\u6ce8\u91ca\u6389\nvi \/usr\/local\/share\/nginx\/nginx.conf\n#user www;\n#pid \/run\/nginx\/nginx.pid;<\/code><\/pre>\n\n\n\n<p>\u4fdd\u5b58\u9000\u51fa<br>\u521b\u5efawordpress\u7684Nginx\u914d\u7f6e\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir \/usr\/local\/share\/nginx\/conf.d\nvi \/usr\/local\/share\/nginx\/conf.d\/wordpress.conf<\/code><\/pre>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-cyan-blue-color\">wordpress.conf<\/mark><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n    listen 80;\n    server_name localhost;\n\n    root \/var\/www\/html;\n    index index.php index.html;\n\n    location \/ {\n        try_files $uri $uri\/ \/index.php?$args;\n    }\n\n    location ~ \\.php$ {\n        include fastcgi.conf;\n        fastcgi_pass wordpress:9000;\n        fastcgi_index index.php;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n    }\n\n    location ~ \/\\.ht {\n        deny all;\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>4.\u914d\u7f6edocker\u5bb9\u5668<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker run -it --name wordpress -p 9999:80 -v \/usr\/local\/share\/wordpress:\/var\/www\/html -d arm32v7\/wordpress:php8.0-fpm\ndocker run -d --name wordpress-nginx --link wordpress -v \/usr\/local\/share\/nginx\/nginx.conf:\/etc\/nginx\/nginx.conf:ro -v \/usr\/local\/share\/nginx\/conf.d:\/etc\/nginx\/conf.d:ro -v \/usr\/local\/share\/wordpress:\/var\/www\/html -p 9000:80 arm32v7\/nginx:alpine\ndocker run -d --name mysql -v \/usr\/local\/share\/mysql\/data:\/var\/lib\/mysql -v \/usr\/local\/share\/mysql\/conf:\/etc\/mysql\/conf.d -v \/usr\/local\/share\/mysql\/logs:\/var\/log\/mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 lsioarmhf\/mariadb:latest<\/code><\/pre>\n\n\n\n<p>\u914d\u7f6e\u5141\u8bb8\u5916\u90e8\u8bbf\u95ee<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker exec -it mysql \/bin\/bash<\/code><\/pre>\n\n\n\n<p>\u8fdb\u5165 mysql \u6570\u636e\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<p>\u8f93\u5165\u5bc6\u7801\uff0c\u5c31\u662f\u524d\u9762\u7684MYSQL_ROOT_PASSWORD<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;\nFLUSH PRIVILEGES;\ncreate database wordpress;<\/code><\/pre>\n\n\n\n<p>\u9000\u51famysql\uff0c\u4e4b\u540e\u9000\u51fa\u5bb9\u5668\u3002<\/p>\n\n\n\n<p>\u83b7\u53d6mysql\u5bb9\u5668\u7684IP<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@ATK-MP157:~# docker inspect mysql | grep IPAddress\n            \"SecondaryIPAddresses\": null,\n            \"IPAddress\": \"172.17.0.4\",\n                    \"IPAddress\": \"172.17.0.4\",<\/code><\/pre>\n\n\n\n<p>\u521b\u5efawp-config.php<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/\/usr\/local\/share\/wordpress<\/code><\/pre>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-cyan-blue-color\">wp-config.php<\/mark><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\/** WordPress \u57fa\u672c\u914d\u7f6e\u6587\u4ef6 *\/\n\n\/** \u6570\u636e\u5e93\u7684\u540d\u79f0 *\/\ndefine( 'DB_NAME', 'wordpress' );\n\n\/** \u6570\u636e\u5e93\u7528\u6237\u540d *\/\ndefine( 'DB_USER', 'root' );\n\n\/** \u6570\u636e\u5e93\u5bc6\u7801 *\/\ndefine( 'DB_PASSWORD', 'your_password_here' );\n\n\/** \u6570\u636e\u5e93\u4e3b\u673a\u5730\u5740\uff0c\u901a\u5e38\u662f\u5bb9\u5668\u540d\u6216 mysql *\/\ndefine( 'DB_HOST', 'wordpress-mysql' );\n\n\/** \u6570\u636e\u5e93\u5b57\u7b26\u96c6\uff0c\u5efa\u8bae\u4fdd\u6301\u9ed8\u8ba4 *\/\ndefine( 'DB_CHARSET', 'utf8' );\n\n\/** \u6570\u636e\u5e93\u6574\u7406\u7c7b\u578b *\/\ndefine( 'DB_COLLATE', '' );\n\n\/**#@+\n * \u8eab\u4efd\u8ba4\u8bc1\u5bc6\u94a5\n * \u53ef\u8bbf\u95ee https:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/ \u83b7\u53d6\u4e00\u7ec4\u65b0\u7684\u5bc6\u94a5\n *\/\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n\/**#@-*\/\n\n\/** WordPress \u6570\u636e\u8868\u524d\u7f00 *\/\n$table_prefix = 'wp_';\n\n\/** \u5f00\u542f\u8c03\u8bd5\u6a21\u5f0f *\/\ndefine( 'WP_DEBUG', false );\n\n\/** \u8bbe\u7f6e\u6587\u4ef6\u6743\u9650\u548c\u8def\u5f84 *\/\nif ( !defined('ABSPATH') )\n    define( 'ABSPATH', __DIR__ . '\/' );\n\nrequire_once ABSPATH . 'wp-settings.php';\n<\/code><\/pre>\n\n\n\n<p>\u521b\u5efa\u542f\u52a8\u811a\u672c\uff0c\u65b9\u4fbf\u4e0b\u6b21\u4f7f\u7528\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi start_wordpress.sh\ndockerd &amp;\nsleep 5\ndocker start wordpress\ndocker start wordpress_nginx\ndocker start mysql<\/code><\/pre>\n\n\n\n<p>\u6ce8\u610f\u4e00\u5b9a\u8981\u6309\u987a\u5e8f\u542f\u52a8\uff0c\u5426\u5219mysql\u5bb9\u5668\u7684IP\u5730\u5740\u4e0d\u5bf9\uff0c\u4f1a\u5bfc\u81f4wordpress\u6253\u4e0d\u5f00<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528\u7684\u5f00\u53d1\u677f\u662f\u6b63\u70b9\u539f\u5b50\u7684STM32MP157,\u4e4b\u524d\u5c1d\u8bd5\u8fc7\u4e0d\u4f7f\u7528docker\u90e8\u7f72\uff0c\u4f46\u662f\u7531\u4e8e\u5404\u79cd\u4f9d\u8d56\u4e0d\u517c\u5bb9\uff0c\u6240\u4ee5\u653e [&hellip;]<\/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-54","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.zjfahhdsh.top\/index.php?rest_route=\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.zjfahhdsh.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zjfahhdsh.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zjfahhdsh.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zjfahhdsh.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=54"}],"version-history":[{"count":57,"href":"https:\/\/blog.zjfahhdsh.top\/index.php?rest_route=\/wp\/v2\/posts\/54\/revisions"}],"predecessor-version":[{"id":149,"href":"https:\/\/blog.zjfahhdsh.top\/index.php?rest_route=\/wp\/v2\/posts\/54\/revisions\/149"}],"wp:attachment":[{"href":"https:\/\/blog.zjfahhdsh.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zjfahhdsh.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zjfahhdsh.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}