Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/profiles/webserver.json
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-07-06 22:23:29 +0200
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-07-06 22:23:29 +0200
commitd723dcf0d7c64f686fc6234a7da9649346d1f56f (patch)
tree36dceb8cd0dcb2d71294cf0d2bec8d76bee86756 /profiles/webserver.json
parent4167946d815f2ab9c6ebf0c597f3b5f5f9723b1e (diff)
Renaming deployments to profiles
Diffstat (limited to 'profiles/webserver.json')
-rw-r--r--profiles/webserver.json41
1 files changed, 41 insertions, 0 deletions
diff --git a/profiles/webserver.json b/profiles/webserver.json
new file mode 100644
index 00000000..6925ab00
--- /dev/null
+++ b/profiles/webserver.json
@@ -0,0 +1,41 @@
+{
+ "args" : {
+ "password" : "0000",
+ "post" : "stay"
+ },
+ "post" : {
+ "Setup webserver build env": {
+ "pacman -Syy --noconfirm git wget" : null,
+ "useradd -m -G wheel builder" : null,
+ "sed -i 's/# %wheel ALL=(ALL) NO/%wheel ALL=(ALL) NO/' /etc/sudoers" : null
+ },
+ "install lighttpd2-git and PHP": {
+ "git clone https://aur.archlinux.org/lighttpd2-git.git /home/builder/lighttpd2" : null,
+ "chown -R builder.builder /home/builder/lighttpd2" : null,
+ "su - builder -c \"(cd /home/builder/lighttpd2/; /usr/bin/makepkg -s --noconfirm)\"" : null,
+ "sh -c 'pacman -U --noconfirm /home/builder/lighttpd2/*.xz'" : null,
+ "pacman -Syy --noconfirm spawn-fcgi php-cgi php" : null
+ },
+ "Remove webserver build env": {
+ "rm -rf /home/builder/lighttpd2" : null,
+ "sed -i 's/%wheel ALL=(ALL) NO/# %wheel ALL=(ALL) NO/' /etc/sudoers" : null
+ },
+ "Configure lighttpd2": {
+ "wget https://raw.githubusercontent.com/Torxed/Scripts/master/bash/spawn_php -O /etc/lighttpd2/spawn_php" : null,
+ "wget https://raw.githubusercontent.com/Torxed/Scripts/master/systemd/php.service -O /etc/systemd/system/php.service" : null,
+ "chmod +x /etc/lighttpd2/spawn_php" : null,
+ "touch /etc/lighttpd2/vhost.conf" : null,
+ "sed -i 's/static/#static/' /mnt/etc/lighttpd2/lighttpd.conf" : {"no-chroot" : true, "debug" : true},
+ "sed -i 's/\"mod_dirlist\"/\"mod_dirlist\",\\n\\t\\t\"mod_fastcgi\",\\n\\t\\t\"mod_vhost\"/' /mnt/etc/lighttpd2/lighttpd.conf" : {"no-chroot" : true, "debug" : true},
+ "echo 'include \"/etc/lighttpd2/php.conf\";' >> //mnt/etc/lighttpd2/lighttpd.conf": {"no-chroot" : true},
+ "echo 'include \"/etc/lighttpd2/vhost.conf\";' >> //mnt/etc/lighttpd2/lighttpd.conf": {"no-chroot" : true},
+ "echo 'if phys.path =$ \".php\" { fastcgi \"unix:/tmp/php.sock\"; }' >> /mnt/etc/lighttpd2/php.conf": {"no-chroot" : true},
+ "echo '<?php print(\"Welcome!\"); ?>' >> /mnt/srv/http/index.php": {"no-chroot" : true}
+ },
+ "Setup webserver autostarts": {
+ "systemctl enable dhcpcd" : null,
+ "systemctl enable lighttpd2" : null,
+ "systemctl enable php" : null
+ }
+ }
+}