Child pages
  • Wordpress on Debian

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Code Block
SET @username = 'bluelight';
SET @password = MD5('BlueLight@WP');
SET @fullname = 'Blue Light Admin';
SET @email = '';
SET @url = '';
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_status`, `display_name`) VALUES (@username, @password, @fullname, @email, @url, NOW(), '0', @fullname);
SET @userid = LAST_INSERT_ID();
INSERT INTO `wp_usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES (@userid, 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `wp_usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES (@userid, 'wp_user_level', '10');

Change domain name

Scenario: the site at is to be changed to .

Step 1: Wordpress config

Code Block
mv /etc/wordpress/ /etc/wordpress/

Step 2: Wordpress DB

The connection parameters can be found in {{/etc/wordpress/}} :

Code Block
mysql -u user_name -h localhost --password=secret db_name << EOF
UPDATE wp_options SET option_value = '' WHERE option_name = 'home' OR option_name = 'siteurl';

Step 3: nginx config

Nginx can instruct browsers to use the new domain name, add this snippet in /etc/nginx/sites-available/wordpress_site_config_file

Code Block
server {
    rewrite ^ $scheme://$request_uri permanent;

And, change the {{server_name}} attribute in the main server  block to:

Step 4: Nginx frontend (web2)

Add (and eventually {{*}}) to the server_name attribute in the relevant file in web2:/etc/nginx/sites-enabled/.