WordPress

From Earlham CS Department
Revision as of 13:48, 17 November 2016 by Craigje (Talk | contribs) (Created page with "This is how to create a WordPress site. Assumes you have permissions on the CS web server (see admins if not). === WordPress Setup === 1. Unzip the file and name it “ word...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is how to create a WordPress site. Assumes you have permissions on the CS web server (see admins if not).

WordPress Setup

1. Unzip the file and name it “ wordpress-site name”

  • tar -xvzf wp_download.tar.gz // This file lies in /var/www b. mv wordpress/ wordpress-sitename

2. Create a mysql database with the name “w p_ sitename”

  • mysql -u root -p // You will need the password
  • MariaDB [(none)]> create database w p _sitename;
  • MariaDB [(none)]> exit

3. Rename the config file and edit it

  • cd wordpress-sitename/
  • mv wp-config-sample.php wp-config.php
  • vi wp-config.php // Here you will be editing the Mysql settings

You will need the name of the database, username (root or wpadmin should work) and the corresponding password:

The edited version should look like:

  • // ** MySQL settings - You can get this info from your web host ** //
  • /** The name of the database for WordPress */
  • define('DB_NAME', 'wp_sitename');
  • /** MySQL database username */
  • define('DB_USER', username);
  • /** MySQL database password */
  • define('DB_PASSWORD', password);
  • /** MySQL hostname */
  • define('DB_HOST', 'localhost');
  • /** Database Charset to use in creating database tables. */ define('DB_CHARSET', 'utf8');
  • /** The Database Collate type. Don't change this if in doubt. */ define('DB_COLLATE', );

Everything else in this file should remain the same.

  • You can also view similar files to make sure the config file is setup properly, and copy the username and password for database from there.
  • view ../wordpress-datascience/wp-config.php

4. Change owner and permissions

  • chown -R www-data:www-data wordpress-sitename/
  • chmod -R 755 wordpress-sitename/
  • mkdir -p /var/www/wordpress-sitename/wp-content/uploads
  • chown -R :www-data /var/www/wordpress-sitename/wp-content/uploads/

5. Setting up the website and ssl cert

  • cd /etc/apache2/sites-available/
  • cp datascience.cs.earlham.edu-ssl.conf sitename.cs.earlham.edu-ssl.conf
  • Edit the .conf file and change the word datascience to your sitename

vi sitename.cs.earlham.edu-ssl.conf

  • Create a link from sites-available to sites-enabled

- ln -s sitename.cs.earlham.edu-ssl.conf /etc/apache2/sites-enabled/sitename.cs.earlham.edu-ssl.conf

6. Enable the site

  • a2ensite sitename.cs.earlham.edu-ssl.conf b. service apache2 reload
  • service apache2 restart

This will enable the website - ask admins to create DNS entry

7. Install WordPress and enjoy!