- nodejs
- nginx
- laravel
you need install pm2 in your server, by the way used ubuntu 22
sudo pm2 start npm --name "nexjs-example" -- start --max-memory-restart 100M
pm2 stop <nama-service>
pm2 delete <nama-service>
sudo systemctl restart nginx
cd /etc/php/8.2/cli
After updating the upload_max_filesize and post_max_size values in the correct php.ini
this example config for laravel nginx http edit or put script at /etc/nginx/site-available
server {
listen 80;
server_name example.com www.example.com;
root /var/www/html/example.com/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
this example config for nextjs edit or put script at /etc/nginx/site-available
server {
listen 80;
listen [::]:80;
root /var/www/html/project.com;
index index.html index.htm;
server_name project.com www.project.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_read_timeout 60;
proxy_connect_timeout 60;
proxy_redirect off;
# Allow the use of websockets
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
# simple headers
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Frame-Options DENY always;
}
sudo apt update && sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx
sudo certbot renew --dry-run
# git fetch origin <branch>
git fetch origin dev
git checkout -b dev origin/dev
while pull and have this message
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint: git config pull.rebase false # merge (the default strategy)
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
do it like this
Update 1:
If you have Git 2.29 or above, you can now set pull.ff to false, true or only to get rid of the warning.
git config pull.ff true
true - This is the default behaviour. Pull is fast-forwarded if possible, otherwise it's merged.
git config pull.ff false
false - Pull is never fast-forwarded, and a merge is always created.
git config pull.ff only
only - Pull is fast-forwarded if possible, otherwise operation is aborted with an error message.
"error: Your local changes to the following files would be overwritten by merge: vendor/composer/autoload_classmap.php vendor/composer/autoload_files.php vendor/composer/autoload_static.php Please commit your changes or stash them before you merge. Aborting``` "
git reset --hard && git clean -df
echo "/vendor" >> .gitignore
git rm -r --cached ./vendor
https://www.freecodecamp.org/news/git-rename-branch-how-to-change-a-local-branch-name/
sudo chmod -R 777 bootstrap/cache/
sudo chmod -R 775 storage
sudo chmod -R ugo+rw storage
comming soon
bash
sudo chown www-data:www-data <appsnya> | /var/www/html
sudo usermod -g www-data <appsnya>
https://github.com/freescout-helpdesk/freescout/wiki/Installation-Guide#5-downloading-the-application
- comming soon
- comming soon
# alternative 1
free -m
# alternative 2
sudo apt install htop
htop -t
sudo nano /var/log/nginx/access.log;
sudo nano /var/log/nginx/error.log
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/test.com /etc/nginx/sites-enabled/
php -m
git log --date=local --pretty=format:'%h, %an, %ad, "%s"' >> log.csv
- open file log.csv
- data tab
- text to colum
- separate by delimeter