summarylogtreecommitdiffstats
path: root/aegir.install
diff options
context:
space:
mode:
authorJames An2015-02-12 05:20:46 -0500
committerJames An2015-06-30 07:27:49 -0400
commitc4c2ecc7a9ee7b4e294a1457ecb3bce7c445fa69 (patch)
treef255c2ddaee3cdc097d4f8045f69c370e4648774 /aegir.install
parent5cc3b9e228fe5019aabc7b4cdb52e9dc89412681 (diff)
downloadaur-c4c2ecc7a9ee7b4e294a1457ecb3bce7c445fa69.tar.gz
Changed aegir config files and rewrote the install file with consistent instructions.
Diffstat (limited to 'aegir.install')
-rw-r--r--aegir.install36
1 files changed, 36 insertions, 0 deletions
diff --git a/aegir.install b/aegir.install
new file mode 100644
index 00000000000..996fb8b16b9
--- /dev/null
+++ b/aegir.install
@@ -0,0 +1,36 @@
+post_install() {
+ post_upgrade
+
+ echo ">>> 1. Ensure this machine's hostname is a FQDN that resolves one of its IP addresses:"
+ echo " $ ip addr | grep inet | sed --regexp-extended 's/ *inet6? ([^\\/]*).*/\1/' | \\"
+ echo " grep --quiet $(resolveip $(hostname) | cut --fields=6 --delimiter=' ') && echo Success!"
+ echo ">>> 2. Ensure the http user and group exist (i.e. uid=gid=33):"
+ echo " $ test \$(id --user http) -eq 33 -a \$(id --group http) -eq 33 && echo Success!"
+ echo ">>> 3. Setup the MySQL instance (by running mysql_secure_installation, or the following shell commands):"
+ echo " # systemctl start mysqld"
+ echo " $ mysql --user=root --execute=\""
+ echo " DELETE FROM mysql.user WHERE User='';"
+ echo " DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
+ echo " DROP DATABASE IF EXISTS test;"
+ echo " DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';"
+ echo " FLUSH PRIVILEGES;\""
+ echo ">>> 4. (opt) Create a aegir MySQL user:"
+ echo " $ mysql --user=root \\"
+ echo " --execute=\"GRANT ALL PRIVILEGES ON *.* TO 'aegir'@'%' IDENTIFIED BY 'passwd' WITH GRANT OPTION;\""
+ echo ">>> 5. Install hostmaster as the aegir user through its drush provision command:"
+ echo " # su aegir -c \\"
+ echo " \"drush hostmaster-install --yes --web_group=http --http_service_type=nginx \\"
+ echo " --root=/var/lib/aegir/hostmaster --aegir_db_user=aegir --aegir_db_pass=passwd \\"
+ echo " --aegir_host=\$(hostname) --client_email=aegir@\$(hostname) \$(hostname)\""
+ echo ">>> 6. Connect nginx to the Unix socket used by php-fpm:"
+ echo " # su aegir -c \"sed -i 's/127.0.0.1:9000/unix:\\/run\\/php-fpm\\/php-fpm.sock/' /var/lib/aegir/config/includes/nginx_vhost_common.conf\""
+ echo ">>> 7. Start the entire web stack:"
+ echo " # systemctl start mysqld nginx php-fpm"
+ echo ">>> 8. (opt) Enable and start the hosting queue daemon:"
+ echo " # su aegir -c \"drush @hostmaster pm-enable hosting_queued\" && systemctl start aegir"
+}
+
+post_upgrade() {
+ getent group aegir || groupadd --non-unique --gid $(id --group http) aegir
+ getent passwd aegir || useradd --non-unique --uid $(id --user http) --gid $(id --group http) --home-dir /var/lib/aegir aegir
+}