netstat -a -o -n
naar file : nestat -a -o -n > c:\log.txt
list services op server, ga naar dir:
c:\windows\system32\inetsrv\
gebruik: appcmd list site
om naar file te loggen: appcmd list site > d:\sites.log
blog van Patrick Vos
naar file : nestat -a -o -n > c:\log.txt
list services op server, ga naar dir:
c:\windows\system32\inetsrv\
gebruik: appcmd list site
om naar file te loggen: appcmd list site > d:\sites.log
How to apply base styles to Tailwind?
In tailwind all default styles are removed by the preflight functionality.
To add default style in your website/application
add a layer in the tailwind.css with the direction to base fe:
Get an SSL certificate via
https://www.sslforfree.com/ 90 days is for free, only domain ssl, card is paid subscription
download the certificate and create an directory on your host where you can store the certicates.
the downloaded certicate files are:
private.key
certicate.crt
ca_bundle.crt
for instance copy the files to "/var/certs/", rename them to domain_certicate.crt and domain_private.key or create a subdirectory for your domain.
enable ssl on your firewall via
ufw enable https or ufw enable 443
now edit you site configuration file in /etc/nginx/sites/available via nano.
following nginx configuration consists out of 3 parts to enforce ssl and https://www.
server1 : http incomming on //domain and www.domain with redirect to https://www
server2: https incomming on https://domain and redirect to https://www.domain and declaration for ssl cerficates.
server3: https incomming on https://www.domain which contains all configuation, in this example with no-cache for index.html and caching for images (react is used)
see: https://www.nginx.com/blog/creating-nginx-rewrite-rules/
server{
listen 80;
server_name domainname.com www.domainname.com
return 301 https://www.$server_name$request_uri;
}
server {
listen [::]:443 ssl;
listen 443 ssl;
ssl_certificate /var/certs/certificate.crt;
ssl_certificate_key /var/certs/private.key;
server_name domainname.com;
return 301 https://www.$server_name$request_uri;
}
server {
listen [::]:443 ssl http2 ipv6only=on;
listen 443 ssl http2;
ssl_certificate /var/certs/certificate.crt;
ssl_certificate_key /var/certs/private.key;
root /var/www/domainname/rootdir;
index index.html;
server_name www.domainname.com;
access_log /var/log/nginx/domainname.com.access.log;
error_log /var/log/nginx/domainname.com.error.log;
location ~* \.(jpg|jpeg|png|gif|ico|css|js|webp)$ {
expires 365d;
}
location / {
try_files $uri /index.html =404;
add_header Cache-Control "no-cache";
}
}
after saving reload nginx and restart.
update repositories:
sudo apt-get updateinstall nginx
sudo apt-get install nginxcheck version of nginx
nginx -vcheck status of nginx
sudo systemctl status nginxstart nginx
sudo systemctl start nginxstop nginx : sudo systemctl stop nginx
set nginx to start at reboot server / system starts:
sudo systemctl enable nginxwhen to disable at system start: sudo systemctl disable nginx
reload nginx after configuration is changed:
sudo systemctl reload nginxhard restart of nginx:
sudo systemctl restart nginxinstalleer firewall:
sudo apt-get install ufw
start/enable firewall:
sudo ufw enable
check apps in firewall:
sudo ufw app list
Enable nginx http calls through the firewall:
sudo ufw allow 'nginx http'Enable nginx https: sudo ufw allow 'nginx https'
to enable http and https: sudo ufw allow 'nginx full'
after setting reload firewall: sudo ufw reload
DON'T FORGET TO OPEN PORT 22 for SSH
sudo ufw allow 22/tcp
or sudo ufw allow ssh
In Nginx, a server block is a configuration that works as its own server. By default, Nginx has one server block preconfigured.
It is located at /var/www/html. However, it can be configured with multiple server blocks for different sites.
Create testdomain/testwebsite:
sudo mkdir -p /var/www/test_domain.com/htmlcreate index.html and fill it with contents:
sudo nano /var/www/test_domain.com/html/index.htmlEdit configuation for the site, all configuration is located in /etc/nginx/sites-available
sudo nano /etc/nginx/sites-available/test_domain.comnice article to follow:
https://phoenixnap.com/kb/how-to-install-nginx-on-ubuntu-20-04
create new app with
yarn create next-appyarn is default used
Add tsconfig.json file to root of application
Add typescript to project
yarn add --dev typescript @types/react @types/noderun yarn dev and the tsconfig.json file will be populated with the right content.
Rename all components and pages from .js to .tsx