快速提示:在五分钟内使用Drupal 8进行启动和运行

tech2022-09-26  59

In this quick tip, we’ll be installing a local instance of Drupal 8, beta 1. By the end, you’ll have a copy of Drupal that’s not only ready to be extended with Symfony bundles and other packages, but also ready to accept content and display it to end users.

在这个快速提示中 ,我们将安装Drupal 8 beta 1的本地实例。 最后,您将获得一个Drupal副本,不仅可以使用Symfony捆绑包和其他软件包进行扩展,而且还可以接受内容并将其显示给最终用户。

步骤1:准备环境 (Step 1: Prepare Environment)

In order for everyone to have the same starting point, we’ll be using our trusty old Homestead Improved vagrant box. It’s important to note that even if this tip will be installing Drupal 8 into the Vagrant box, the procedure is absolutely identical for any Ubuntu based environment.

为了使每个人都有相同的起点,我们将使用可信赖的旧式宅基地改良型无家可归者包装盒。 重要的是要注意,即使本技巧将在Dr. Vagrant框中安装Drupal 8,该过程对于任何基于Ubuntu的环境也完全相同 。

So, somewhat optional, please clone a new Homestead Improved instance as per instructions in this tip. Then, add a new site and make sure you add the entry to your host machine’s hosts file. In my case, it’s test.app and Homestead.yaml looks like this:

因此,有些可选,请按照本技巧文章中的说明克隆一个新的Homestead Improvementd实例。 然后,添加一个新站点,并确保将条目添加到主机的hosts文件中。 就我而言,它是test.app和Homestead.yaml看起来像这样:

--- ip: "192.168.10.10" memory: 2048 cpus: 1 folders: - map: . to: /home/vagrant/Code sites: - map: homestead.app to: /home/vagrant/Code/Laravel/public - map: test.app to: /home/vagrant/Code/drupal variables: - key: APP_ENV value: local

步骤2:下载并解压缩Drupal 8 b1 (Step 2: Download and extract Drupal 8 b1)

If you’re using a VM, log into it and enter the folder where you keep your projects. In the case of the Homestead Improved installation above, that’ll be /home/vagrant/Code. If you’re using your own LAMP stack or whatever, just go into your projects folder.

如果您使用的是VM,请登录到该VM并输入保存项目的文件夹。 如果是上述的Homestead Improvementd安装, /home/vagrant/Code 。 如果您使用自己的LAMP堆栈或其他任何内容,只需进入您的项目文件夹。

wget http://ftp.drupal.org/files/projects/drupal-8.0.0-beta1.tar.gz

When downloading finishes, extract the archive and rename the resulting folder to drupal.

下载完成后,解压缩档案并将结果文件夹重命名为drupal 。

tar -xvzf drupal-8.0.0-beta1.tar.gz mv drupal-8.0.0-beta1 drupal

步骤3:创建数据库 (Step 3: Create the DB)

In this case we’ll be using MySQL. We’ll also be using Homestead-specific user/pass defaults. If you’ve got your own environment, adapt as needed. For PostgreSQL see here.

在这种情况下,我们将使用MySQL。 我们还将使用特定于Homestead的用户/密码默认值。 如果您有自己的环境,请根据需要进行调整。 对于PostgreSQL,请参见此处 。

mysqladmin -u homestead -psecret create drupaltest mysql -u homestead -psecret

Once in the MySQL console, execute the following:

进入MySQL控制台后,执行以下操作:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON drupaltest.* TO 'homestead'@'localhost' IDENTIFIED BY 'secret'; exit

步骤4:设定 (Step 4: Settings)

In this step, we create a settings and services file from the provided templates, and let the Drupal installer edit them by altering permissions.

在此步骤中,我们从提供的模板创建设置和服务文件,然后让Drupal安装程序通过更改权限来编辑它们。

cd drupal cp sites/default/default.settings.php sites/default/settings.php cp sites/default/default.services.yml sites/default/services.yml chmod a+w sites/default/settings.php chmod a+w sites/default/services.yml chmod a+w sites/default

步骤5:安装 (Step 5: Install)

In your host’s browser, enter the URL test.app:8000/install.php and follow the instructions of the wizard.

在主机的浏览器中,输入URL test.app:8000/install.php并按照向导的说明进行操作。

Choose a standard installation profile for the quickest setup. You can find out more about these profiles here, if interested.

选择标准安装配置文件以进行最快的设置。 如果有兴趣,可以在这里找到有关这些配置文件的更多信息。

可选的清理和调整 (Optional Cleanup and Tweaks)

Optional but recommended:

可选,但建议:

Remove the original downloaded archive to free up disk space

删除原始下载的存档以释放磁盘空间

Activate the cron

激活cron

Change the permissions back:

改回权限:

chmod 644 sites/default/settings.php chmod 644 sites/default/services.yml chmod 755 sites/default

chmod 644站点/默认/settings.php chmod 644站点/默认/services.yml chmod 755站点/默认

结论 (Conclusion)

As you can see, adding a new Drupal installation onto your server can be done in minutes from total zero to fully functional CMS. For more information on other aspects and edge cases of Drupal installation, see their installation guide.

如您所见,从完全零的CMS到功能全面的CMS,只需几分钟即可将新的Drupal安装添加到服务器上。 有关Drupal安装的其他方面和边缘情况的更多信息,请参阅其安装指南 。

翻译自: https://www.sitepoint.com/quick-tip-running-drupal-8-five-minutes/

相关资源:jdk-8u281-windows-x64.exe
最新回复(0)