User Tools

Site Tools


computing:selfhostedwp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
computing:selfhostedwp [2023/06/29 05:40] oemb1905computing:selfhostedwp [2023/06/29 06:10] oemb1905
Line 98: Line 98:
  
   ssh root@wordpress.com   ssh root@wordpress.com
 +  mkdir Downloads
   cd ~/Downloads   cd ~/Downloads
   mkdir wpdownload   mkdir wpdownload
Line 112: Line 113:
   sudo mv ~/Downloads/wpdownload/wordpress /var/www/site1.com/public_html   sudo mv ~/Downloads/wpdownload/wordpress /var/www/site1.com/public_html
  
-Nowlet's set up permissions and ownership:+When the website is in productionuse these permissions:
  
   sudo chown -R www-data:www-data /var/www/wordpress.com/public_html   sudo chown -R www-data:www-data /var/www/wordpress.com/public_html
Line 126: Line 127:
   <Replace the example salts with those you just downloaded using copy/paste>   <Replace the example salts with those you just downloaded using copy/paste>
      
-Let's also add the following line to the ''wp-config.php'' file for updatesMake sure to add this within the body of the php document. //This is required if you are not using libapache2-mod-php//.+Sometimes, for reasons I am not sure about, WordPress does not allow users direct uploading. If/when that happens, add the entry to wp-config.php. If anyone knows why this is needed, please let me know!
  
   sudo nano /var/www/site1.com/public_html/wp-config.php   sudo nano /var/www/site1.com/public_html/wp-config.php
   <define('FS_METHOD','direct');>   <define('FS_METHOD','direct');>
  
-Let's now visit site1.com in a web browser. Enter the credentials that you created for the database above. Choose the settings you prefer and set up an admin account and record your credentials securely. You should now have a proper WordPress site! Now that you have a WordPress, check the SiteHealth tab and follow its advice and/or know why you don't. In my case, I typically adjust cache, rewrites, expiry +Let's now visit site1.com in a web browser. Enter the credentials that you created for the database above. Choose the settings you prefer and set up an admin account and record your credentials securely. You should now have a proper WordPress site! Now that you have a WordPress, check the SiteHealth tab and follow its advice and/or know why you don't. In my case, I typically adjust cache, rewrites, and headers.
- +
-  apt install memcached +
-  nano /etc/default/memcached +
-  a2enmod cache +
- +
-Optimizing and securing WordPress usually boils down to some cache and header settingsCache and/or page expiry settings:+
  
   apt install memcached   apt install memcached
Line 143: Line 138:
   a2enmod cache   a2enmod cache
   a2enmod expires   a2enmod expires
 +  a2enmod headers
  
   <IfModule mod_expires.c>   <IfModule mod_expires.c>
Line 174: Line 170:
 Enable headers: Enable headers:
  
-  a2enmod headers 
   <IfModule mod_headers.c>   <IfModule mod_headers.c>
           Header always set X-Content-Type-Options "nosniff"           Header always set X-Content-Type-Options "nosniff"
Line 230: Line 225:
 Refresh WordPress and it should see the sftp server and allow you to make changes that way. Note: The sftp server is public and anyone can access this with proper credentials even if it not for WordPress so use a proper password and make sure your TLS configuration is working. Your instance should now be pretty solid. The only other thing you might want is more than one WordPress site subdomain, for example, site1.cooldomain.com, site2.cooldomain.com, etc. If that's the case, then hop on over to my [[https://wiki.haacksnetworking.com/doku.php?id=computing:wpmultisite|Word Press Multisite]] tutorial.  Refresh WordPress and it should see the sftp server and allow you to make changes that way. Note: The sftp server is public and anyone can access this with proper credentials even if it not for WordPress so use a proper password and make sure your TLS configuration is working. Your instance should now be pretty solid. The only other thing you might want is more than one WordPress site subdomain, for example, site1.cooldomain.com, site2.cooldomain.com, etc. If that's the case, then hop on over to my [[https://wiki.haacksnetworking.com/doku.php?id=computing:wpmultisite|Word Press Multisite]] tutorial. 
  
- --- //[[jonathan@haacksnetworking.org|oemb1905]] 2023/06/29 04:29//+ --- //[[jonathan@haacksnetworking.org|oemb1905]] 2023/06/29 06:03//
computing/selfhostedwp.txt · Last modified: 2023/12/16 20:33 by oemb1905