Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/j3k0/wp-hosting
Manage your wordpress hosting
https://github.com/j3k0/wp-hosting
Last synced: 22 days ago
JSON representation
Manage your wordpress hosting
- Host: GitHub
- URL: https://github.com/j3k0/wp-hosting
- Owner: j3k0
- Created: 2015-10-09T19:50:34.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-01-12T07:21:53.000Z (10 months ago)
- Last Synced: 2024-04-08T00:24:14.989Z (7 months ago)
- Language: Shell
- Size: 2.11 MB
- Stars: 8
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wp-hosting
Set of scripts to manage virtual wordpress servers for different clients.
Each server consists in a wordpress installation, phpmyadmin, mysql and an automated backup tool.
## Architecture
All sites are in subdirectories of the wp-hosting directories. I generally like to call them `wp..` (example: wp.microsoft.live.com).
In each directory:
- backups
- config
- docker-compose.yml
- nginx-site
- php.ini
- ssl/nginx.crt ssl/nginx.key`config` contains the high level informations used to generate all other files.
- `DOMAIN` is a list of domain names.
- `*_PORT` different ports to use for the services.
- `ROOT_PASSWORD` database superuser password.
- `ADMIN_PASSWORD` normal user and wordpress admin password.
- `SALT` wordpress authentication salt.When you __create__ a project, the `config` file is generated.
When you __initialize__ a project, the other files are generated.
When you __start__ a project, service are started using the configuration files in the project folder. You can also customize them before if needed.
## Tasks
#### Deploy a new site
We need to __create__, __initialize__ then __start__ a new project.
The project is for client `albert` that want to start a website for domain `hellokitty.com`. So we call the project `wp.albert.hellokitty.com`.
./create.sh wp.albert.hellokitty.com hellokitty.com
It'll generate a self-generated ssl certificate, you can fill real information of just go with the defaults. (ENTER ENTER ENTER...)
Let's check the configuration with `cat wp.albert.hellokitty.com/config`. Seems good, we can initialize the project.
./initialize.sh wp.albert.hellokitty.com
This will take a bit more than a minute to complete. Hopefully everything went fine. The project directory now contains a handful of new config files.
You might want to edit the `nginx-site` file if your website has additional domain names (see the `server_name` options).
We can now start the services.
./start.sh wp.albert.hellokitty.com
Once started, we need to reload the nginx configuration.
sudo service nginx reload
Last thing last, send the configuration details to the appropriate IT department.
./info.sh wp.albert.hellokitty
Send it by email!
## Scripts
For the most up-to-date documentation, use `--help` options.
#### create.sh <project>
Generate a new project with a config file.
Use the first available port and generate random passwords.
#### initialize.sh <project>
Initialize a server from its config file.
Generates a docker-compose.yml file, prepare the database.
#### start.sh <project>
Starts the server.
#### stop.sh <project>
Stops the server.
#### cleanup.sh <project>
Delete a server. All run-time files will be deleted.
Backups will not be removed.
#### backup.sh <project>
Force a new backup.
Note that when a server is running, daily backups are performed.
#### restore.sh <project> <date>
Restore a backup.
#### logs.sh <project>
Display server logs.
#### import.sh <project> <date>
Import a project just copied from another host.
Will update the config file to use available port on this host and restore the specified backup.
## Import an existing website
## Migrate a website to another server
# Troubleshooting
## AIO-related error when starting mysql..
http://johanlouwers.blogspot.com/2010/02/aio-max-nr-parameter-for-oracle.html
echo 1048576 > /proc/sys/fs/aio-max-nr