-
Notifications
You must be signed in to change notification settings - Fork 0
/
sites
85 lines (65 loc) · 3.35 KB
/
sites
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
# for setting up a vps to host websites
# -- assuming you already set up a user
# -- targeting a linode vps environment
# -- don't run this, it's for reference
#############################################################################
echo "EDITOR=nano" > /etc/environment
sudo pacman -Syu # update your databases and packages
# Install an AUR helper
sudo pacman -S wget git expac jshon # dependencies
mkdir packer && cd packer # create and enter a directory
sudo wget -O PKGBUILD # download PKGBUILD script
https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=packer
makepkg # make package
sudo pacman -U packer- [tab to autocomplete] [enter] # install package from local build
cd .. && sudo rm -dR packer # exit directory and cleanup
#############################################################################
# === LEMP server with nginx / mariadb / php7 ===
packer -S nginx-mainline mariadb php-fpm
## check versions, if you want to verify the install
nginx -v
mysql --version
php --version
## systemd service management - replace $ with nginx, mariadb, php-fpm
sudo systemctl start $
sudo systemctl status $
sudo systemctl enable $
## mariadb
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo mysql_secure_installation
## configs - idk what exact changes i made, but... you can
## see sample configs in my repo trwnh/nginx-config-hacks
### /etc/nginx/nginx.conf
#### - include sites/*.conf (see ..hacks/nginx.conf)
#### - php location blocks (see ..hacks/snippets/php.conf)
#### - server blocks in sites/ (see ..hacks/sites/*.conf)
### /etc/php/php.ini
#### - uncomment extension=mysqli.so
#### - uncomment extension=pdo_mysql.so
#### - uncomment/add any other extensions? imagemagick, gd, exif, etc etc
sudo mkdir /etc/nginx/sites
sudo mkdir /etc/nginx/snippets
sudo systemctl reload $ # reload services for configs to take effect - replace $
# === symlinks to make management easier ===
cd /srv/http
sudo ln -s /etc/nginx/sites sites
sudo ln -s /etc/nginx/snippets snippets
sudo ln -s /etc/nginx/nginx.conf nginx.conf
sudo ln -s /etc/php/php.ini php.ini
sudo ln -s /usr/share/webapps webapps # if you install webapps from pacman/AUR
#############################################################################
# extras
# -- feel free to install postgresql instead of mariadb
# -- or apache instead of nginx (but why tho)
## symlinks if you installed apache
sudo ln -s /etc/httpd/conf/httpd.conf httpd.conf
sudo ln -s /etc/httpd/conf/extra/httpd-vhosts.conf vhosts.conf
## optional webapps
packer -S adminer # adminer.conf from ..hacks/sites/adminer.conf or from arch wiki
packer -S dokuwiki # nginx conf taken directly from arch wiki, just fix server name
## other programming languages / tools
packer -S hugo # static site generator
## optional dependencies/etc that might not have gotten installed?
packer -S $ # imagemagick? openssl? idk but maybe doublecheck later. php-gd, php-mcrypt...
packer -S htop nmap archey3 # rice