- Install wp cli on cluster shellserver:
# Download wp cli
test -d ~/bin || mkdir ~/bin
wget -O ~/bin/wp-cli https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
- Install wordpress on a cluster domain in a subdir of the public webroot (ie: /blog/):
~/bin/wp-cli core download --force
~/bin/wp-cli core config --dbhost='dbhost' --dbname='dbname' --dbuser='dbuser' --dbpass='dbpass'
~/bin/wp-cli core install --title="blog" --admin_user="your-admin-user" --admin_password="your-admin-password" --admin_email="[email protected]" --url='https://www.magentotestpakket.nl/blog/'
~/bin/wp-cli plugin activate --all
~/bin/wp-cli core update-db
~/bin/wp-cli cache flush
- Create htaccess in webroot dir of the cluster domain:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
-
Enable "servicealias catchall" in byte SP section "subdomeinen"
-
Create the following config as
server.blog
:
location ^~ /blog {
expires off;
proxy_redirect off;
proxy_pass https://46.21.239.157;
proxy_set_header Host www.magentotestpakket.nl;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X_FORWARDED_PROTO "https";
proxy_set_header HTTP_X_FORWARDED_PROTO "https";
proxy_set_header X-Real-IP \$remote_addr;
}