Objective
This page is a notes for setting apache server for my digital ocean droplet
Setting
Apache2
in file
/etc/hosts
- change
127.0.0.1 localhost
to127.0.1.1 localhost WordPress-CaLP-LPSS
- change
change Port
- in file
/etc/apache2/port.conf
- add
ServerName localhost
- change the line
listen *:80
tolisten 127.0.0.1:4000
- disable other modules
<IfModule ssl_module>
and<IfModule mod_gnutls.c>
- in file
/etc/apache2/site-enabled/000-default.conf
- change the line
<VirtualHost *:80>
to<VirtualHost localhost:4000>
- in file
restart apache2
- run
sudo /etc/init.d/apache2 restart
- run
Wordpress
config WordPress to use proxy
- add the following lines in
/var/www/html/wp-config.php
define(‘WP_PROXY_HOST’, ‘careers.liping.edu.hk’);
define(‘WP_PROXY_PORT’, ’80’);`
define('WP_PROXY_BYPASS_HOSTS', 'localhost, careers.liping.edu.hk');
define('FORCE_SSL_ADMIN', true);
- add the following lines in `/var/www/html/wp-content/themes/yourTheme/function.php
update_option( 'siteurl', 'http://careers.liping.edu.hk' );
update_option( 'home', 'http://careers.liping.edu.hk' );
Caddy Server
careers.liping.edu.hk
proxy / localhost:4000 {
header_upstream Host {host}
}
using caddy
to run the server through tmux
TODO
Reference
- DenBeke – Running Caddy Server as a service with Upstart
- How To Configure the Apache Web Server on an Ubuntu or Debian VPS | DigitalOcean
- Is TLS Fast Yet?
- Proxy server - Wikiwand
- Webmaster - Wikiwand
Key Word
- reverse proxy
- Microservice
- load balancing