18.11.2015 Views

Beginning Drupal 8

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 21 ■ Building a Community Site<br />

After expanding the archive file, you’ll note that what you have is a top-level directory named something<br />

like commons-8.x-3.12. You will need to move all of the files up one directory to keep from having to enter<br />

example.com/commons-8.x-3.12 to get to your site. On Linux or OS X, you can move the files by navigating<br />

to the commons-8.x-3.12 directory (note your directory will likely be named something different depending<br />

on the version that you’ve downloaded) and using the following commands:<br />

mv * ../<br />

mv .* ../<br />

It’s important to note that using mv * ../ does not move key files like .htaccess. The second move<br />

command does move those hidden files up a level.<br />

After moving all the files, you are free to delete the distribution directory that was created when you<br />

expanded the <strong>Drupal</strong> Commons archive file. While working with the files, you’ll also need to create a<br />

settings.php file. Navigate to your site’s site/default directory and copy the default.settings.php file<br />

to settings.php. You also need to create a files directory. For both of these items, you’ll also need to set<br />

the permissions so that the web server can read and write to the file and directory.<br />

After getting the files in place, it’s time to create a new empty database, database user ID, and password,<br />

and assign the rights to the user so that they can modify the content and structure of the database. Check<br />

with your hosting provider’s documentation or, if you’re installing the site locally, the LAMP, MAMP, or<br />

WAMP stack provider’s documentation on how to create a new MySQL database and create users (e.g., using<br />

PHPMyAdmin).<br />

After performing the preliminary setup tasks, it’s time to install <strong>Drupal</strong> Commons. The installation<br />

process for Commons begins the same as with <strong>Drupal</strong> 8 core, visiting the URL of where the site is installed.<br />

You may encounter an error stating that the PHP Max Execution Time value is too low. If you are using a<br />

typical MAMP, LAMP, or WAMP stack, the PHP Max Execution Time is often set to 30 seconds. Due to longrunning<br />

jobs that are associated with the tasks performed on a <strong>Drupal</strong> Commons site, that value will need to<br />

be increased to 120 seconds. You can make that change through several venues, but the easiest is to add the<br />

following line of code to the bottom of your sites/default/settings.php file:<br />

ini_set('max_execution_time', 120);<br />

The first form that appears in the installation process is the standard <strong>Drupal</strong> 8 installation form for<br />

setting database information (Set up the database). Enter the appropriate values in the Database name,<br />

Database username, and Database password fields and click the “Save and continue” button.<br />

The next form is the standard <strong>Drupal</strong> 8 site information configuration form (Configure site). Enter the<br />

appropriate values for the Site name, Site e-mail address, Site maintenance account, Default country, and<br />

Timezone. The Site maintenance account is equivalent to the standard <strong>Drupal</strong> 8 administrator’s account but<br />

with a larger role in managing the community as a whole.<br />

The next step is to pick the color palette for the site (Choose site color palette). This is the first major<br />

deviation from the standard <strong>Drupal</strong> 8 core installation process. Pick the palette and save it to continue to the<br />

next step.<br />

Next you are prompted to enter the welcome text for the homepage (see Figure 21-1). On this page<br />

you are prompted to enter a Welcome headline, Welcome body text, and determine whether to install the<br />

example content. For demonstration purposes, I’m going to install the example content, but when you<br />

are creating a new site, if you don’t want to try out Commons with content, uncheck the “Install example<br />

content” check box.<br />

232

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!