Saturday, June 17, 2023

Wordpress installation on Ubuntu 22.04 with S3 bucket/Azure Storage for content files

https://linux.how2shout.com/how-to-install-wordpress-on-ubuntu-22-04-lts-server/

Created user etc as per

https://hnsws.blogspot.com/2023/05/dot-net-core-ubuntu-linux-server.html

Apparently there were some unmet dependencies,
https://ubuntu.com/tutorials/install-and-configure-wordpress#2-install-dependencies

Still got the error "Please check that the mysqli PHP extension is installed and enabled." For fixing this, uncommented the mysqli extension line in
/etc/php/8.0/apache2/php.ini 

We need sudo rights to chown a resource to other users (who have different permissions than the user we are logged on).

So, instead chmod 777 for the public html folder for WP to be able to write to the configuration file. 

Connecting to an existing S3 bucket for auto-moving content files there, and all the advantages of using an S3 bucket -
https://www.codeinwp.com/blog/wordpress-s3-guide/

Using WP CLI to make changes like installing plugins, templates etc -
https://mediatemple.zendesk.com/hc/en-us/articles/360056149791-how-to-install-wp-cli
because otherwise, WP needs FTP or FTPS access - not SFTP by default. Apparently we can add SFTP support by
sudo apt install php-ssh2
https://stackoverflow.com/questions/53203050/how-to-use-sftp-instead-of-ftp-when-updating-wordpress-plugins

I may add more to this as the configuration progresses.

Edit: 27 June - 
Instead of WP CLI, in order to facilitate plugin installation, updates etc from the WP console, we just need to chown the wp files and the directory to www-data. Not make its permissions 777.

If using Azure storage for content files, even though some how-tos indicate that using our own custom domain requires the use of Azure CDN, we can actually use Cloudflare to proxy traffic with our custom domain and https - we need to first disable proxying and verify the custom domain after setting the CNAME, at the Azure portal -> Storage Account -> Security + networking -> Networking, Custom domain tab. After verification, we can turn on proxying.

For getting the Primary Access key, we need to go to the Azure portal -> Storage Account -> Security + networking -> Access keys.

 



No comments:

Post a Comment