Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
server_configuration:apache [2021/01/13 17:02] – david | server_configuration:apache [2022/07/22 16:39] (current) – [Core configuration] david | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | So many problems with cache in browsers. | + | ====== Apache2 Configuration ====== |
- | Good to test with a browser which can have all data cleared, and do work in private browsing. | + | The configuration is built from a DigitalOcean Droplet, preconfigured with LAMP and WordPress: |
+ | * Droplet Information: | ||
+ | * The WordPress One-Click Quickstart guide: https://do.co/ | ||
- | Using wget to test the apache | + | ===== Core configuration |
+ | Note: If no site is " | ||
+ | |||
+ | Site configuration file location(s): | ||
<code bash> | <code bash> | ||
- | # Run a command to get the default page, and view the http redirects as returned by the server | + | # All configuration files |
- | wget --verbose datablog.roman-halliday.com | + | / |
- | # Reload apache configuration | + | # Enabled sites |
- | sudo service | + | /etc/apache2/ |
</ | </ | ||
- | https:// | + | Enable/disable configurations: |
- | - https:// | + | <code bash> |
- | + | # Disable | |
- | - Move apache base location | + | sudo a2dissite datablog.roman-halliday.com.conf |
- | + | ||
- | ====== SSL - Let's Encrypt ====== | + | |
- | + | ||
- | How To Secure Apache with Let's Encrypt on Ubuntu 20.04 | + | |
- | - https://www.digitalocean.com/ | + | |
+ | # Enable | ||
+ | sudo a2ensite datablog.roman-halliday.com.conf | ||
+ | </ | ||
+ | ===== File Ownership ===== | ||
+ | Make sure all files are owned correctly: | ||
<code bash> | <code bash> | ||
- | certbot | + | # Site content owned by www-data so webserver can modify files |
+ | chown -R www-data: | ||
+ | |||
+ | # Configuration owned by root for security | ||
+ | chown -R root:root / | ||
</ | </ | ||
+ | ===== Refresh Configuration ===== | ||
+ | Use one of: | ||
<code bash> | <code bash> | ||
systemctl reload apache2 | systemctl reload apache2 | ||
- | service | + | service |
</ | </ | ||
- | < | + | ===== SSL - Let's Encrypt ===== |
+ | SSL Encryption (the use of '' | ||
- | # All configuration files | + | * DigitalOcean Community Documentation: |
- | /etc/apache2/sites-available/ | + | |
- | # Enabled sites | + | If you configure the http (non secure) websites under '' |
- | / | + | |
- | </code> | + | |
- | Make sure all files are owned correctly: | ||
<code bash> | <code bash> | ||
- | # Site content owned by www-data so webserver can modify files | + | certbot |
- | chown -R ../ www-data: | + | |
- | + | ||
- | # Configuration owned by root | + | |
- | chown -R ../ root:root / | + | |
</ | </ | ||
+ | ====== Troubleshooting ====== | ||
- | Note: If no site is " | + | * https://help.servmask.com/ |
+ | |||
+ | |||
+ | ===== PHP testing page ===== | ||
Hosting can be tested with the file: | Hosting can be tested with the file: | ||
Line 61: | Line 69: | ||
</ | </ | ||
+ | ===== Managing Page redirects/ | ||
+ | So many problems with cache in browsers. Good to test with a browser which can have all data cleared, and do work in private browsing. | ||
+ | |||
+ | Using wget to test the apache configuration, | ||
+ | |||
+ | <code bash> | ||
+ | # Run a command to get the default page, and view the http redirects as returned by the server | ||
+ | wget --verbose datablog.roman-halliday.com | ||
+ | |||
+ | # Reload apache configuration | ||
+ | sudo service apache2 reload | ||
+ | </ | ||
- | ====== Bug: extra index ====== | + | ===== Bug: extra index ===== |
I had an extra '' | I had an extra '' | ||
<code html> | <code html> |