This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server | |
{ | |
# Listen | |
listen 80; | |
listen [::]:80; | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
server_name subdomain.domain.tld; | |
root /var/www/subdomain.domain.tld; | |
index index.html index.php; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# wget -q https://gist.githubusercontent.com/amanjuman/8ad9e374cb970a352d08b950e3d3dbef/raw/ddf53d463c80dfe76f7594b3bb3a58df63cd2aad/default -O /etc/nginx/sites-available/default | |
server | |
{ | |
server_name ""; | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
#listen 443 ssl http2 default_server; | |
#listen [::]:443 ssl http2 default_server; | |
# Generate Self-Signed-SSL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server | |
{ | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
server_name ""; | |
location /health | |
{ | |
access_log off; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server | |
{ | |
# Port Listen | |
listen 80; | |
listen [::]:80; | |
#listen 443 ssl http2; | |
#listen [::]:443 ssl http2; | |
# Root Dir | |
root /usr/share/phpmyadmin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install nginx-full mysql-client apache2-utils php7.4-{apcu,bcmath,bz2,curl,fpm,intl,json,gd,mbstring,mysql,xml,zip} phpmyadmin -y | |
or | |
sudo wget https://files.phpmyadmin.net/phpMyAdmin/5.1.1/phpMyAdmin-5.1.1-english.zip && sudo unzip phpMyAdmin-5.1.1-english.zip | |
mv phpMyAdmin-5.1.1-english phpmyadmin | |
mv phpmyadmin /usr/share/ | |
sudo htpasswd -c /etc/nginx/.htpasswd username | |
wget -q https://gist.githubusercontent.com/amanjuman/595ba5ec6494a03e8b0544986cafb092/raw/2c078604ac65ee4aee2f58b89f3239817c89e2d3/phpmyadmin.conf -O /etc/nginx/conf.d/phpmyadmin.conf | |
sudo chown -R www-data:www-data /usr/share/phpmyadmin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hostnamectl set-hostname hostname.domain.tld | |
sudo add-apt-repository ppa:ondrej/php -y && sudo add-apt-repository ppa:certbot/certbot -y && wget -O - http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh | sudo bash | |
sudo apt-get update && sudo apt-get -y upgrade && sudo apt dist-upgrade -y && sudo apt-get autoremove -y | |
sudo apt install ufw openlitespeed certbot lsphp74 lsphp74-common lsphp74-dev lsphp74-curl lsphp74-imap lsphp74-mysql lsphp74-intl lsphp74-json lsphp74-opcache lsphp74-imagick lsphp74-memcached lsphp74-redis lsphp74-pgsql lsphp74-sqlite3 lsphp74-tidy lsphp74-snmp lsphp74-dbg mysql-server -y | |
sudo ufw allow 22,53,80,443,7080,8088/tcp | |
sudo ufw default reject | |
sudo ufw enable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#1) on https://console.developers.google.com/ register project, enable Groups Migration API, and create OAuth2 credentials. | |
#2) set the client_id and client_secret variables below to the values provided when creating the OAuth2 credentials. | |
#3) make copies of the Client ID and Client Secret for the OAuth2 credentials and use them | |
client_id="..." | |
client_secret="...." | |
#4) get authorization code at the following link using web browser | |
# (make sure you sign in with an account that has access to Google Groups you are importing to). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo systemctl disable systemd-resolved | |
sudo systemctl stop systemd-resolved | |
sudo nano /etc/systemd/resolved.conf | |
DNSStubListener=no | |
rm /etc/resolv.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
ServerName sql.domain.tld | |
DocumentRoot /usr/share/phpmyadmin | |
RewriteEngine on | |
RewriteCond %{SERVER_NAME} =sql.domain.tld | |
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Remove Existing Host Files | |
rm /etc/ssh/ssh_host_* | |
## Regenerate Host Files | |
ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -N "" | |
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N "" | |
## Enable Host Files | |
sed -i 's/^HostKey \/etc\/ssh\/ssh_host_\(dsa\|ecdsa\)_key$/\#HostKey \/etc\/ssh\/ssh_host_\1_key/g' /etc/ssh/sshd_config |