search by tags

for the user

adventures into the land of the command line

installing wordpress

from wikipedia: WordPress is a free and open-source content management system (CMS) based on PHP and MySQL. features include a plugin architecture and a template system. WordPress was used by more than 23.3% of the top 10 million websites as of January 2015. WordPress is the most popular blogging system in use on the web, at more than 60 million websites

prerequisites: a lamp server

downloading and extracting wordpress

$ wget http://wordpress.org/latest.tar.gz
$ tar -xvzf latest.tar.gz -C /var/www/html

make sure the wordpress directory is owned by the same user that owns apache

$ chown -R apache:apache /var/www/html/wordpress

setup mysql for wordpress

$ mysqladmin -u root -p create wordpress
$ mysql -u root -p
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO [email protected] IDENTIFIED BY 'password123';
mysql> FLUSH PRIVILEGES;

create a mysql database for the site

mysql> create database wordpress;
mysql> grant all privileges on wordpress.* to "user"@"10.1.2.3" identified by 'password123';
mysql> flush privileges;
mysql> grant all privileges on wordpress.* to "wordpress"@"10.1.2.3" identified by 'password123';
mysql> flush privileges;
mysql> select user,host from mysql.user;
mysql> show grants for 'user'@'10.1.2.3';
mysql> quit

to revoke privileges if required

mysql> REVOKE ALL PRIVILEGES ON wordpress .* FROM 'user'@'10.1.2.3';

configure the wp-config.php file required by wordpress and add/edit the below lines in the config file

$ cd /var/www/html/wordpress/
$ cp wp-config-sample.php wp-config.php
$ vim wp-config.php

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

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

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

/** 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', '');

run the wordpress installation script from a web browser

http://myserveripaddress/wordpress/wp-admin/install.php

follow the gui and you’re done. wordpress away.