Conventions/vdomain: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
m (Woozle moved page Setups/vdomain to Conventions/vdomain: reorganizing)
No edit summary
Line 1: Line 1:
=Apache Config=
I have a set of include files and templates that I use for Apache configuration, as well as a utility for verifying that virtual domains are being served correctly.
* [https://gitlab.com/woozalia/server-bits Server Bits]
** [https://gitlab.com/woozalia/server-bits/-/tree/main/apache/includes Apache includes]: these have individual version folders instead of using git branches because I don't necessarily migrate all the vhosts on a server at once
** [https://gitlab.com/woozalia/server-bits/-/tree/main/utils test utilities]: a few specific test-scripts
*** [https://gitlab.com/woozalia/server-bits/-/tree/main/utils/vhost-tests vhost tests]: <code>run.php</code> tests all the vhosts as defined in <code>local/vhosts.php</code>. Tests include:
**** Apache is running the correct virtual-host user?
**** Apache is using the correct version of PHP (or other language)?
**** SSL certificate is working?
**** Scripts can only be executed via https (not http)?
=Virtual Domain Setup=
=Virtual Domain Setup=
This is how I typically set up virtual domains.
This is how I typically set up virtual domains.

Revision as of 13:56, 13 December 2021

Apache Config

I have a set of include files and templates that I use for Apache configuration, as well as a utility for verifying that virtual domains are being served correctly.

  • Server Bits
    • Apache includes: these have individual version folders instead of using git branches because I don't necessarily migrate all the vhosts on a server at once
    • test utilities: a few specific test-scripts
      • vhost tests: run.php tests all the vhosts as defined in local/vhosts.php. Tests include:
        • Apache is running the correct virtual-host user?
        • Apache is using the correct version of PHP (or other language)?
        • SSL certificate is working?
        • Scripts can only be executed via https (not http)?

Virtual Domain Setup

This is how I typically set up virtual domains.

Definitions

  • <$HOME> is the home folder of the virtual domain's user account
    • e.g. /home/wvbz/
  • <$USER> is the system user that Apache will run as
    • e.g. wvbz
  • <$WEB> is the base folder of files that will be served to the web
    • Typically <$HOME>/public_html
    • e.g. /home/wvbz/public_html

File Structure

  • <$HOME> - domain user's home folder
    • /site - all site-specific stuff
      • /config - any configuration stuff that might change
        • there's a folder for each project that has configurable files, typically in lowercase
          • e.g. <$HOME>/site/config/vbzcart
      • /git - Git repositories being used for this domain/project
        • Repositories are directly under this, e.g. <$HOME>/site/git/ferreteria.
        • Nothing in this folder should be edited, unless doing development on the repository itself.
      • /apps for applications (e.g. MediaWiki) whose code is delivered via some method other than git clone
        • For Mediawiki specifically, where there are no other apps I've been just using mw instead of apps/mw.
        • A lot of web apps mix together site-config files and read-only code files, so this folder may need to be writeable.
    • /public_html is <$WEB>, i.e. files to be served on the web
      • Personally I'd prefer /web or /www, but this ↑ is VirtualMin's default

Wherever possible, I will make links inside <$WEB> to files/folders in <$HOME>/site rather than copying them, in order to minimize scattering of edit-targets and simplify updates a bit.