{"id":4595,"date":"2023-02-21T15:00:01","date_gmt":"2023-02-21T07:00:01","guid":{"rendered":"https:\/\/km94.com\/?p=4595"},"modified":"2023-02-21T15:00:01","modified_gmt":"2023-02-21T07:00:01","slug":"hostwinds%e6%95%99%e7%a8%8b%ef%bc%9a%e5%a6%82%e4%bd%95%e5%9c%a8%e4%ba%91vps%e4%b8%8a%e5%ae%89%e8%a3%85drupal","status":"publish","type":"post","link":"https:\/\/dy208.cn\/index.php\/2023\/02\/21\/hostwinds%e6%95%99%e7%a8%8b%ef%bc%9a%e5%a6%82%e4%bd%95%e5%9c%a8%e4%ba%91vps%e4%b8%8a%e5%ae%89%e8%a3%85drupal\/","title":{"rendered":"Hostwinds\u6559\u7a0b\uff1a\u5982\u4f55\u5728\u4e91VPS\u4e0a\u5b89\u88c5Drupal"},"content":{"rendered":"<p>Drupal\u662f\u4e00\u4e2a\u65e2\u5b9a\u548c\u9ad8\u5ea6\u88ab\u8ba4\u4e3a\u7684CSM\uff08\u5185\u5bb9\u7ba1\u7406\u7cfb\u7edf\uff09\uff0c\u5728\u7ba1\u7406\u7f51\u7ad9\u65f6\u63d0\u4f9b\u7075\u6d3b\u6027\u548c\u6613\u7528\u6027\uff0c\u4e3a\u5927\u89c4\u6a21\u7cfb\u7edf\u63d0\u4f9b\u51fa\u8272\u7684\u6027\u80fd\u548c\u5b89\u5168\u6027\u3002Hostwinds\u662f\u8fd1\u51e0\u5e74\u5907\u53d7\u6b22\u8fce\u7684\u7f8e\u56fd\u4e91\u670d\u52a1\u5668\u63d0\u4f9b\u5546\uff0c\u90a3\u4e48Hostwinds\u4e91VPS\u5982\u4f55\u5b89\u88c5Drupal\uff0c\u672c\u6587\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u4e0bHostwinds\u4e91VPS\u5b89\u88c5Drupal\u6559\u7a0b\u3002<\/p>\n<p><strong>\u4e00\u3001\u66f4\u65b0\u5e76\u786e\u8ba4\u60a8\u7684\u7cfb\u7edf\u662f\u6700\u65b0\u7684<\/strong><\/p>\n<p>\u901a\u8fc7\u8fd0\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u66f4\u65b0\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u3002<\/p>\n<pre><code class=\"language-plaintext\">yum update<\/code><\/pre>\n<p><strong>\u4e8c\u3001\u5b89\u88c5Apache<\/strong><\/p>\n<p>1\u3001\u00a0\u5c06Apache\u5b89\u88c5\u4e3aWeb\u670d\u52a1\u5668\u3002\u51fa\u73b0\u63d0\u793a\u65f6\u8f93\u5165&#8221;Y&#8221;\u3002<\/p>\n<pre><code class=\"language-plaintext\">yum install httpd<\/code><\/pre>\n<p>2\u3001 \u542f\u7528Apache<\/p>\n<pre><code class=\"language-plaintext\">systemctl enable httpd<\/code><\/pre>\n<p>3\u3001\u8bbe\u7f6eapache\u4ee5\u542f\u52a8\u542f\u52a8<\/p>\n<pre><code class=\"language-plaintext\">systemctl start httpd<\/code><\/pre>\n<p>4\u3001\u00a0\u68c0\u67e5Apache\uff08httpd\uff09\u7684\u72b6\u6001<\/p>\n<pre><code class=\"language-plaintext\">systemctl status httpd<\/code><\/pre>\n<p>5\u3001\u4e00\u65e6Apache\u5b89\u88c5\u548c\u9a8c\u8bc1\uff0c\u8bf7\u9a8c\u8bc1\u5b83\u901a\u8fc7\u5728URL\u4e2d\u5bfc\u822a\u5230\u670d\u52a1\u5668\u7684IP\u800c\u6b63\u5e38\u5de5\u4f5c\u3002\u73b0\u5728\u5e94\u8be5\u51fa\u73b0HTTP\u670d\u52a1\u5668\u6d4b\u8bd5\u9875\u9762\u3002<\/p>\n<p>\n\t<figure class=\"wp-block-image size-full\"><img decoding=\"async\" class=\"wp-image-4597\" alt=\"Hostwinds\u4e91VPS\u5b89\u88c5Drupal\u6559\u7a0b\" src=\"https:\/\/km94.com\/wp-content\/uploads\/2023\/02\/hostwdru.jpg\"><\/figure>\n\t<\/p>\n<p><strong>\u4e09\u3001\u5b89\u88c5MySQL<\/strong><\/p>\n<p>1\u3001\u00a0\u5f00\u59cb\u901a\u8fc7\u5b89\u88c5MySQL\u5f00\u59cb\u4e3aDrupal\u51c6\u5907\u6570\u636e\u5e93\u3002<\/p>\n<pre><code class=\"language-plaintext\">yum -y install @mysql<\/code><\/pre>\n<p>2\u3001\u00a0\u901a\u8fc7\u8f93\u5165\u4e0b\u9762\u7684\u547d\u4ee4\u542f\u7528MySQL\u3002<\/p>\n<pre><code class=\"language-plaintext\">systemctl enable --now mysqld<\/code><\/pre>\n<p>3\u3001\u00a0\u5c06mysql\u8bbe\u7f6e\u4e3a\u5728\u670d\u52a1\u5668\u542f\u52a8\u65f6\u542f\u52a8\u3002<\/p>\n<pre><code class=\"language-plaintext\">systemctl start mysqld<\/code><\/pre>\n<p>4\u3001\u9a8c\u8bc1MySQL\u662f\u5426\u6709\u6548\u3002<\/p>\n<pre><code class=\"language-plaintext\">systemctl status mysqld<\/code><\/pre>\n<p>5\u3001\u00a0\u4fdd\u62a4\u4f60\u7684mysql\u3002<\/p>\n<pre><code class=\"language-plaintext\">mysql_secure_installation<\/code><\/pre>\n<p>\u51fa\u73b0\u63d0\u793a\u60a8\u7684MySQL\u5bc6\u7801\u65f6\uff0c\u8bf7\u9009\u62e90\u52302\u4e4b\u95f4\u7684\u5bc6\u7801\u5f3a\u5ea6\u3002\u63a5\u4e0b\u6765\uff0c\u6839\u636e\u60a8\u6240\u9700\u7684\u5b9e\u529b\u8f93\u5165\u60a8\u7684\u5bc6\u7801\u3002HostWinds\u59cb\u7ec8\u5efa\u8bae\u4f7f\u7528\u5f3a\u5bc6\u7801\u6765\u4fdd\u6301\u7cfb\u7edf\u5b89\u5168\u3002<\/p>\n<p>6\u3001\u00a0\u767b\u5f55\u5df2\u5b89\u88c5MySQL\u3002<\/p>\n<pre><code class=\"language-plaintext\">mysql -u root -p<\/code><\/pre>\n<p>7\u3001\u00a0\u4e3aDrupal\u5b89\u88c5\u521b\u5efa\u6570\u636e\u5e93\u4ee5\u53ca\u5177\u6709\u6743\u9650\u7684\u7528\u6237\u3002\u6ce8\u610f\uff0c\u6211\u4eec\u4f7f\u7528&#8221;drupaluser&#8221;\u548c&#8221;\u5bc6\u7801&#8221;\u4f5c\u4e3aDrupal\u6570\u636e\u5e93\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002\u968f\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u60a8\u7684\u8981\u6c42\u4e92\u6362\u8fd9\u4e9b\u3002<\/p>\n<p><strong>\u6ce8\u610f<\/strong>\uff1a\u8fd0\u884cmysql\u547d\u4ee4\uff0c&#8221;drupal_db&#8221;\u5c06\u662fdrupal\u6570\u636e\u5e93\uff0c&#8221;drupaluser&#8221;\u5c06\u662fDrupal\u6570\u636e\u5e93\u7528\u6237\u540d\uff0c\u5e76\u4e14\u5728Drupal GUI\u4e2d\u7684Drupal\u8bbe\u7f6e\u671f\u95f4\u9700\u8981&#8221;\u5bc6\u7801&#8221;\u6570\u636e\u5e93\u7684\u5bc6\u7801\u3002<\/p>\n<pre><code class=\"language-plaintext\">CREATE DATABASE drupal_db;\nCREATE USER drupaluser@localhost IDENTIFIED BY 'password';\nGRANT ALL PRIVILEGES ON * . * TO 'drupaluser'@'localhost';\nFLUSH PRIVILEGES;<\/code><\/pre>\n<p><strong>\u56db\u3001\u5b89\u88c5PHP<\/strong><\/p>\n<p>1\u3001\u00a0Drupal\u9700\u8981PHP\u5e76\u5728\u6b63\u5f0f\u5b89\u88c5CRM\u4e4b\u524d\u8fdb\u884c\u8bbe\u7f6e\u3002\u9996\u5148\u8fd0\u884c\u4ee5\u4e0b\u5185\u5bb9\u5e76\u5728\u51fa\u73b0\u63d0\u793a\u65f6\u7b54\u6848&#8221;Y&#8221;\u3002<\/p>\n<pre><code class=\"language-plaintext\">yum install php<\/code><\/pre>\n<p>2\u3001\u5b89\u88c5\u5176\u4ed6PHP\u6269\u5c55\u548c\u5e94\u7528\u7a0b\u5e8f\u3002\u5728\u63d0\u793a\u65f6\uff0c\u56de\u7b54&#8221;Y&#8221;\u4e3a&#8221;\u662f&#8221;<\/p>\n<pre><code class=\"language-plaintext\">yum install php-pear php-mysqlnd php-curl php-mbstring php-gd php-xml php-pear php-fpm php-pdo php-opcache php-json php-zip php-cli<\/code><\/pre>\n<p>3\u3001 \u542f\u7528PHP<\/p>\n<pre><code class=\"language-plaintext\">systemctl enable php-fpm<\/code><\/pre>\n<p>4\u3001\u786e\u4fddPHP\u542f\u52a8\u540e\u542f\u52a8<\/p>\n<pre><code class=\"language-plaintext\">systemctl start php-fpm<\/code><\/pre>\n<p><strong>\u4e94\u3001\u5b89\u88c5drupal<\/strong><\/p>\n<p>1\u3001\u00a0\u53bbDrupal\u7684\u4e0b\u8f7d\u9875\u9762\u00a0https:\/\/www.drupal.org\/download\u00a0\u548c\u53ef\u7528\u7684\u7248\u672c\u3002\u5c06\u60a8\u6240\u9700\u7684\u7248\u672c\u66ff\u6362\u4e3a\u4e0b\u9762\u7684\u547d\u4ee4\u7ed3\u675f\u3002\u6211\u4eec\u5728\u6b64\u793a\u4f8b\u4e2d\u5b89\u88c58.8.5\u7248\u3002<\/p>\n<pre><code class=\"language-plaintext\">wget https:\/\/ftp.drupal.org\/files\/projects\/drupal-8.8.5.tar.gz\u00a0<\/code><\/pre>\n<p>2\u3001\u00a0\u63d0\u53d6\u60a8\u7684Drupal\u4e0b\u8f7d\u3002<\/p>\n<pre><code class=\"language-plaintext\">tar -xvf drupal-8.8.5.tar.gz<\/code><\/pre>\n<p>3\u3001\u5c06\u63d0\u53d6\u7684\u6587\u4ef6\u5939\u79fb\u52a8\u5230Apache\u6587\u6863\u6839\u76ee\u5f55<\/p>\n<pre><code class=\"language-plaintext\">mv drupal-8.8.5 \/var\/www\/html\/drupal<\/code><\/pre>\n<p>4\u3001\u5141\u8bb8Apache\u8bbf\u95ee\u901a\u8fc7\u4fee\u6539\u6743\u9650\u6765\u8bbf\u95ee\u672a\u538b\u7f29\u7684Drupal\u6839\u76ee\u5f55<\/p>\n<pre><code class=\"language-plaintext\">chown -R apache:apache \/var\/www\/html\/drupal<\/code><\/pre>\n<p><strong>\u516d\u3001\u914d\u7f6eDrupal\u8bbe\u7f6e<\/strong><\/p>\n<p>1\u3001\u914d\u7f6eDrupal\u8bbe\u7f6e\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95ee\u9ed8\u8ba4\u6587\u4ef6\u5939\u6765\u6267\u884c\u6b64\u64cd\u4f5c\u3002<br>\nCD \/ var \/ www \/ html \/ drupal \/ sites \/\u9ed8\u8ba4<\/p>\n<p>2\u3001\u5c06\u9ed8\u8ba4\u8bbe\u7f6e\u590d\u5236\u5230\u8bbe\u7f6e\u6587\u4ef6\u4e2d<\/p>\n<pre><code class=\"language-plaintext\">cp -p default.settings.php settings.php<\/code><\/pre>\n<p>\u60a8\u73b0\u5728\u53ef\u4ee5\u8bbf\u95eesettings.php\u6587\u4ef6\u4ee5\u8fdb\u4e00\u6b65\u914d\u7f6e\u4efb\u4f55\u6eda\u52a8\u8bbe\u7f6e\u3002<\/p>\n<p><strong>\u4e03\u3001\u4f7f\u7528Apache\u521b\u5efaDrupal\u914d\u7f6e\u6587\u4ef6<\/strong><\/p>\n<p>\u8981\u8bbf\u95eeDrupal GUI\uff0c\u60a8\u9700\u8981\u5728Apache\u4e2d\u521b\u5efa\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\uff0c\u4ee5\u4fbf\u544a\u8bc9\u60a8\u7684Web\u670d\u52a1\u5668\u67e5\u770b\u548c\u8bbf\u95ee\u6240\u9700\u7684\u6587\u4ef6\u5939\u548c\u6587\u4ef6\u3002<\/p>\n<p>1\u3001\u00a0\u5728\u4ee5\u4e0b\u6587\u4ef6\u4e0a\u8fd0\u884cnano\u4ee5\u8f93\u5165\u6587\u672c\u7f16\u8f91\u5668\u6a21\u5f0f\u3002<\/p>\n<pre><code class=\"language-plaintext\">nano \/etc\/httpd\/conf.d\/drupal.conf<\/code><\/pre>\n<p>2\u3001 \u6dfb\u52a0\u4ee5\u4e0b\u6807\u51c6Apache\u914d\u7f6e\u6587\u672c\u3002\u8bf7\u6ce8\u610f\uff0c\u60a8\u9700\u8981\u624b\u52a8\u5c06serveradmin\u548cservername\u5217\u4e2d\u7684&#8221;domainexample.com&#8221;\u66f4\u6539\u4e3a\u60a8\u7684\u57df\u3002<\/p>\n<pre><code class=\"language-plaintext\">&lt;VirtualHost *:80&gt;\n    ServerAdmin webmaster@domainexample.com\n    ServerName domainexample.com\n    DocumentRoot \/var\/www\/html\/drupal\n    &lt;Directory \/var\/www\/html\/drupal\/&gt;\n        Options Indexes FollowSymLinks\n        AllowOverride All\n        Require all granted\n    &lt;\/Directory&gt;\n    ErrorLog \/var\/log\/httpd\/drupal_error.log\n    CustomLog \/var\/log\/httpd\/drupal_access.log combined\n&lt;\/VirtualHost&gt;<\/code><\/pre>\n<p>3\u3001\u00a0\u91cd\u65b0\u542f\u52a8Apache Web\u670d\u52a1\u5668\u4ee5\u5b8c\u6210\u6b64\u64cd\u4f5c\u3002<\/p>\n<pre><code class=\"language-plaintext\">systemctl restart httpd<\/code><\/pre>\n<p>\u5728Web\u6d4f\u89c8\u5668\u7684URL\u4e2d\u8f93\u5165\u670d\u52a1\u5668\u7684IP\u73b0\u5728\u5e94\u8be5\u63d0\u793aDrupal\u7684\u5b89\u88c5\u5411\u5bfc\u3002<\/p>\n<p>\n\t<figure class=\"wp-block-image size-full\"><img decoding=\"async\" class=\"wp-image-4598\" alt=\"Hostwinds\u4e91VPS\u5b89\u88c5Drupal\u6559\u7a0b\" src=\"https:\/\/km94.com\/wp-content\/uploads\/2023\/02\/hostwd.png\"><\/figure>\n\t<\/p>\n\n<div>\n<div>\n\n\n\n<\/div>\n<div>\n\n\n\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Drupal\u662f\u4e00\u4e2a\u65e2\u5b9a\u548c\u9ad8\u5ea6\u88ab\u8ba4\u4e3a\u7684CSM\uff08\u5185\u5bb9\u7ba1\u7406\u7cfb\u7edf\uff09\uff0c\u5728\u7ba1\u7406\u7f51\u7ad9\u65f6\u63d0\u4f9b\u7075\u6d3b\u6027\u548c\u6613\u7528\u6027\uff0c\u4e3a\u5927\u89c4\u6a21\u7cfb\u7edf\u63d0\u4f9b\u51fa&hellip;<\/p>\n","protected":false},"author":1,"featured_media":4596,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,2],"tags":[],"class_list":["post-4595","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-zjjc","category-jc","entry"],"_links":{"self":[{"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/posts\/4595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/comments?post=4595"}],"version-history":[{"count":0,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/posts\/4595\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/media?parent=4595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/categories?post=4595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/tags?post=4595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}