WordPress/Installation/CentOS

From r00tedvw.com wiki
(Difference between revisions)
Jump to: navigation, search
(Configure Wordpress)
Line 32: Line 32:
 
==Configure Wordpress==
 
==Configure Wordpress==
 
  <nowiki>~$ cp /var/www/html/website.com/wp-config-sample.php /var/www/html/website.com/wp-config.php
 
  <nowiki>~$ cp /var/www/html/website.com/wp-config-sample.php /var/www/html/website.com/wp-config.php
 +
~$ ~$ vim /var/www/html/website.com/wp-config.php
 +
...
 +
// ** MySQL settings - You can get this info from your web host ** //
 +
/** The name of the database for WordPress */
 +
define('DB_NAME', 'database_name_here');
 +
 +
/** MySQL database username */
 +
define('DB_USER', 'username_here');
 +
 +
/** MySQL database password */
 +
define('DB_PASSWORD', 'password_here');
 +
 +
/** MySQL hostname */
 +
define('DB_HOST', 'localhost');
 +
</nowiki>
 +
it would also be a good idea to SALT your authentication and cookies. go to https://api.wordpress.org/secret-key/1.1/salt/ and it will auto generate random salts. You can change these at any time to invalidate all cookies given out forcing users to log back in.

Revision as of 18:20, 5 February 2018

Ubuntu Installation | CentOS Installation
Installation done on CentOS 6.9

Contents

Download required packages

~$ sudo yum install mysql-server php php-mysql -y 

Setup MySQL

Start MySQL

~$ sudo service mysqld start

Set the root password

~$ sudo /usr/bin/mysql_secure_installation 
Enter current password for root (enter for none):
Set root password? [Y/n] y
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

Configure MySQL

~$ mysql -u root -p
~$ mysql> CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'THISpasswordSHOULDbeCHANGED';
~$ mysql> CREATE DATABASE wordpress;
~$ mysql> GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost' IDENTIFIED BY 'wordpressuserpassword' WITH GRANT OPTION;

Install Wordpress

~$ sudo mkdir /opt/wordpress && sudo wget -O /opt/wordpress/wordpress-4.9.2.tar.gz https://wordpress.org/latest.tar.gz
~$ mkdir /var/www/html/website.com
~$ tar -C /var/www/html/website.com/ -zxf /opt/wordpress/wordpress-4.9.2.tar.gz
~$ sudo cp -r /var/www/html/website.com/wordpress/* /var/www/html/website.com/
~$ sudo rm -r var/www/html/website.com/wordpress/

Configure Wordpress

~$ cp /var/www/html/website.com/wp-config-sample.php /var/www/html/website.com/wp-config.php
~$ ~$ vim /var/www/html/website.com/wp-config.php
...
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');

/** MySQL database username */
define('DB_USER', 'username_here');

/** MySQL database password */
define('DB_PASSWORD', 'password_here');

/** MySQL hostname */
define('DB_HOST', 'localhost');

it would also be a good idea to SALT your authentication and cookies. go to https://api.wordpress.org/secret-key/1.1/salt/ and it will auto generate random salts. You can change these at any time to invalidate all cookies given out forcing users to log back in.

Personal tools
Namespaces

Variants
Actions
Navigation
Mediawiki
Confluence
DevOps Tools
Open Source Products
Ubuntu
Ubuntu 22
Mac OSX
Oracle Linux
AWS
Windows
OpenVPN
Grafana
InfluxDB2
TrueNas
MagicMirror
OwnCloud
Pivotal
osTicket
OTRS
phpBB
WordPress
VmWare ESXI 5.1
Crypto currencies
HTML
CSS
Python
Java Script
PHP
Raspberry Pi
Canvas LMS
Kaltura Media Server
Plex Media Server
MetaSploit
Zoneminder
ShinobiCE
Photoshop CS2
Fortinet
Uploaded
Certifications
General Info
Games
Meal Plans
NC Statutes
Politics
Volkswagen
Covid
NCDMV
Toolbox