|
| 1 | + |
| 2 | +# Install Lean |
| 3 | +wget -q https://raw.githubusercontent.com/leanprover-community/mathlib4/master/scripts/install_debian.sh && bash install_debian.sh ; rm -f install_debian.sh && source ~/.profile |
| 4 | + |
| 5 | +# Install NPM |
| 6 | +``` |
| 7 | +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash |
| 8 | +source ~/.bashrc |
| 9 | +nvm install node npm |
| 10 | +
|
| 11 | +npm install -g http-server |
| 12 | +``` |
| 13 | + |
| 14 | +# Clone NNG interface |
| 15 | + |
| 16 | +``` |
| 17 | +git clone https://github.com/hhu-adam/NNG4.git |
| 18 | +``` |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +# Install PM2 |
| 23 | + |
| 24 | +``` |
| 25 | +sudo npm i -g pm2 |
| 26 | +
|
| 27 | +pm2 start ecosystem.config.js |
| 28 | +pm2 save |
| 29 | +pm2 startup |
| 30 | +pm2 install pm2-logrotate |
| 31 | +
|
| 32 | +``` |
| 33 | + |
| 34 | + |
| 35 | +# Nginx installieren |
| 36 | +``` |
| 37 | +sudo apt update |
| 38 | +sudo apt upgrade |
| 39 | +sudo apt install nginx nginx-extras |
| 40 | +``` |
| 41 | + |
| 42 | +Konfigurieren als reverse proxy: |
| 43 | +``` |
| 44 | +sudo unlink /etc/nginx/sites-enabled/default |
| 45 | +cd /etc/nginx/sites-available |
| 46 | +sudo vim reverse-proxy.conf |
| 47 | +``` |
| 48 | + |
| 49 | +``` |
| 50 | +
|
| 51 | +# Anonymize IP addresses |
| 52 | +map $remote_addr $remote_addr_anon { |
| 53 | + ~(?P<ip>\d+\.\d+\.\d+)\. $ip.0; |
| 54 | + ~(?P<ip>[^:]+:[^:]+): $ip::; |
| 55 | + 127.0.0.1 $remote_addr; |
| 56 | + ::1 $remote_addr; |
| 57 | + default 0.0.0.0; |
| 58 | +} |
| 59 | +
|
| 60 | +log_format main '$remote_addr_anon - $remote_user [$time_local] "$request" ' |
| 61 | + '$status $body_bytes_sent "$http_referer" ' |
| 62 | + '"$http_user_agent" "$http_x_forwarded_for"'; |
| 63 | +
|
| 64 | +server { |
| 65 | + server_name lean.math.hhu.de; |
| 66 | + location / { |
| 67 | + proxy_pass http://localhost:8001; |
| 68 | + proxy_set_header Host $host; |
| 69 | + proxy_set_header X-Real-IP $remote_addr; |
| 70 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 71 | +
|
| 72 | + proxy_http_version 1.1; |
| 73 | + proxy_set_header Upgrade $http_upgrade; |
| 74 | + proxy_set_header Connection "upgrade"; |
| 75 | + } |
| 76 | + client_max_body_size 0; |
| 77 | +
|
| 78 | + access_log /var/log/nginx/access.log main; |
| 79 | + error_log /dev/null crit; |
| 80 | +
|
| 81 | + listen 443 ssl; |
| 82 | + ssl_certificate /home/adam/adam_math_hhu_de_cert.cer; |
| 83 | + ssl_certificate_key /etc/ssl/private/private.pem; |
| 84 | +} |
| 85 | +
|
| 86 | +server { |
| 87 | + server_name adam.math.hhu.de; |
| 88 | + location / { |
| 89 | + proxy_pass http://localhost:8002; |
| 90 | + proxy_set_header Host $host; |
| 91 | + proxy_set_header X-Real-IP $remote_addr; |
| 92 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 93 | + proxy_http_version 1.1; |
| 94 | + proxy_set_header Upgrade $http_upgrade; |
| 95 | + proxy_set_header Connection "upgrade"; |
| 96 | +
|
| 97 | + } |
| 98 | + client_max_body_size 0; |
| 99 | +
|
| 100 | + listen 443 ssl; |
| 101 | + ssl_certificate /home/adam/adam_math_hhu_de_cert.cer; |
| 102 | + ssl_certificate_key /etc/ssl/private/private.pem; |
| 103 | +
|
| 104 | + access_log /var/log/nginx/access.log main; |
| 105 | + error_log /dev/null crit; |
| 106 | +} |
| 107 | +
|
| 108 | +server { |
| 109 | + server_name adam-dev.math.hhu.de; |
| 110 | + location / { |
| 111 | + proxy_pass http://localhost:8003; |
| 112 | + proxy_set_header Host $host; |
| 113 | + proxy_set_header X-Real-IP $remote_addr; |
| 114 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 115 | + proxy_http_version 1.1; |
| 116 | + proxy_set_header Upgrade $http_upgrade; |
| 117 | + proxy_set_header Connection "upgrade"; |
| 118 | +
|
| 119 | + } |
| 120 | + client_max_body_size 0; |
| 121 | +
|
| 122 | + listen 443 ssl; |
| 123 | + ssl_certificate /home/adam/adam_math_hhu_de_cert.cer; |
| 124 | + ssl_certificate_key /etc/ssl/private/private.pem; |
| 125 | +
|
| 126 | + access_log /var/log/nginx/access.log main; |
| 127 | + error_log /dev/null crit; |
| 128 | +} |
| 129 | +
|
| 130 | +# Redirect HTTP to HTTPS |
| 131 | +server { |
| 132 | + listen 80 default_server; |
| 133 | + server_name _; |
| 134 | + return 301 https://$host$request_uri; |
| 135 | +} |
| 136 | +``` |
| 137 | + |
| 138 | +Activate config: |
| 139 | +``` |
| 140 | + sudo ln -s /etc/nginx/sites-available/reverse-proxy.conf /etc/nginx/sites-enabled/reverse-proxy.conf |
| 141 | + sudo nginx -t |
| 142 | + sudo nginx -s reload |
| 143 | +``` |
| 144 | + |
| 145 | + |
| 146 | +## Install bubblewrap (bwrap) |
| 147 | +``` |
| 148 | +sudo apt-get install bubblewrap |
| 149 | +``` |
0 commit comments