Install WordPress via SSH

Note: change “/var/www/marketing” to the directory where you want WordPress installed. Also, change “www-data:www-data” to the correct user:group for your flavor of Apache.

Ubuntu:

cd /

mkdir tmp

cd tmp

wget https://wordpress.org/latest.tar.gz (OR) curl -O https://wordpress.org/latest.tar.gz

tar xzvf latest.tar.gz

touch wordpress/.htaccess

mkdir wordpress/wp-content/upgrade

mkdir /var/www/marketing/**newnamehere**

sudo mv  -v /tmp/wordpress/* /var/www/marketing/**newnamehere**

sudo chown -R www-data:www-data /var/www/marketing/**newnamehere** && sudo chmod -R g+w /var/www/marketing/**newnamehere** && sudo find /var/www/marketing/**newnamehere** -type d -exec chmod 755 {} \; && sudo find /var/www/marketing/**newnamehere** -type f -exec chmod 644 {} \;

Go to your new location and run through the steps to set up WordPress (if you need to set up a database, instructions can be found here). After installation, you can run the following 2 commands to harden your install:

sudo chmod 660 /var/www/marketing/**newnamehere**/wp-config.php

sudo chmod 666 /var/www/marketing/**newnamehere**/.htaccess

Lastly, add these two lines to your wp-config.php file to make sure the new installation point uses the correct universal plugins directory:

define( 'WP_PLUGIN_DIR', '/var/www/marketing/wp-content/plugins' );

define( 'WP_PLUGIN_URL', 'https://marketing.mdpweb.net/wp-content/plugins');

Leave a comment

Your email address will not be published. Required fields are marked *