Some informal notes WordPress

Setting up a new Server

We've had a recent spate of throwing up new, single use, VMs running WordPress to quickly get a web site up and running. eg for the CDTs.

This is just a note of what I did to get them going.

Starting with the profile for blogvm, I updated and stripped some RPMs to give a more vanilla install - see blether and haver profiles.

That installs everything, but you need to do some MySQL and WordPress bootstrapping to get things going. That's really what I'm covering here. Which is more or less just following the instructions in /usr/share/doc/wordpress-VERSION/ .

So as the mysql root user on the machine do:

create database sitewp;
grant all privileges on sitewp.* to 'someuser'@localhost identified by 'SomePasword';
flush privileges;
Where sitewp is the name you give to the database, someuser and SomePasword are a username and password of your choice. I used mktemp to come up with a random password, but you're going to stash it in a file, so how secure is that!

Next edit /usr/share/wordpress/wp-config.php which is probably a symlink to /etc/wordpress/wp-config.php and update the following lines with the details you supplied above, eg:

define('DB_NAME', 'sitewp');
define('DB_USER', 'someuser');
define('DB_PASSWORD', 'SomePasword');

You should also update the key and salt phrases as it suggests in that file. ie go to https://api.wordpress.org/secret-key/1.1/salt/ and cut and paste the output into wp-config.php, possibly changing some chars if you are really paranoid.

Also, if you choose to have your database in a non-standard location, you'll want to point WP at the location of the socket, eg:

define('DB_HOST', 'localhost:/disk/data/mysql/mysql.sock');

Having done that, you should now find that http://yoursite.inf.ed.ac.uk/wp-admin/install.php now works.

Enabling through the web updates/installs

Generally we are trying to maintain Wordpress via RPMs, but this means us packaging up tarballs etc. Sometimes user want more direct and instant control over their site. By doing updates and installs via the WP dashboard will prompt the user for FTP details. Which isn't going to work. If you do want to enable through the web updates and installs, then you need to make the wp-content/ directory (and sub dirs) writeable by the apache user, and also add:

define('FS_METHOD', 'direct');
to the wp-config.php file.

Other useful things to look at are:

define('DISALLOW_FILE_MODS', false);
The EPEL WordPress RPM sets that to true, which stops WP warning you about out of date versions of WP, plugins, etc. Setting it to false turns that back on (even though the user may not be able to do anything about it)

-- NeilBrown - 05 Dec 2013

Topic revision: r3 - 22 Jul 2014 - 14:12:45 - NeilBrown
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
This Wiki uses Cookies