Archive for the ‘apache’ Category

Nextjs 13.4 location of config files

PROJECT_FOLDER/package.json – configuration of installed packages and their versions “next”: “^13.2.4” – check nextjs installed version here PROJECT_FOLDER/tsconfig.json – Typescript configuration PROJECT_FOLDER/.eslintrc.json – EsLint configuration PROJECT_FOLDER/postcss.config.js – PostCSS configuration PROJECT_FOLDER/next.config.js – NextJS configuration PROJECT_FOLDER/tailwind.config.ts – Tailwind configuration

Ssh saving private key passphrase

ssh-add and press [Enter] Enter passphrase for /path/to/.ssh/id_rsa: Identity added

Git pull single file from another branch

git checkout {branchname} {filename}

Docker if you need to edit file on stopped docker

I had a problem with a container which wouldn’t start due to a bad config change I made. I was able to copy the file out of the stopped container and edit it. something like: docker cp test-mysql:/etc/mysql/my.cnf . Edit it and copy back docker cp my.cnf test-mysql:/etc/mysql/my.cnf docker start mysql docker exec -ti mysql […]

Build and run container from Dockerfile

Step 1 – Dockerfile FROM debian:jessie MAINTAINER user@server.com RUN apt-get update RUN apt-get install -y vim RUN apt-get install -y apache2 RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server RUN apt-get install -y php5 RUN apt-get install php5-mysql RUN apt-get autoremove   ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP www-data ENV APACHE_LOG_DIR /var/log/apache2 ENV APACHE_LOCK_DIR /var/lock/apache2 ENV APACHE_PID_FILE /var/run/apache2.pid […]

Paypal buy now button html code

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_self"> <input type="hidden" name="cmd" value="_xclick" /> <input type="hidden" name="business" value="imran.aghayev@yahoo.co.uk"/> <input type="hidden" name="item_name" value="Itemname"/> <input type="hidden" name="item_number" value="1"/> <input type="hidden" name="amount" value="150"/> <input type="hidden" name="currency_code" value="GBP"/> <input type="hidden" name="lc" value="UK"/> <input type="hidden" name="bn" value="btn_buynow_SM.gif"/> <input type="hidden" name="weight_unit" value="kgs"/> <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynow_SM.gif" name="submit" alt="Make payments with PayPal"/> </form>

Top 10 security vulnerabilities by OWASP

A1 Injection (PHP include, global variables, Sql Injection through Url) A2 Broken authentication (To avoid broken authentication put into practice not leaving the login page for admins publicly accessible. Rename /wp-admin/ on WordPress to something else. Rename /admin in Magento to something else) A3 Sensitive data exposure (arp spoofing resulting traffic sniffing, stealing auth passwords, […]

Redirect va htaccess non-www to www and keep http and https protocols

RewriteCond %{HTTP_HOST} !^www\. RewriteCond %{HTTPS}s on(s)|offs() RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [NE,L,R]

Smart live server updates through links

Use /var/www-production & /var/www-prerelease Link /var/www.repo1 to /var/www-production and /var/www.repo2 to /var/www-prerelease. Update /var/www-prerelease, test, do customizations. When ready simply swap the links, move prerelease production and production to prerelease

Apache2 enable mod_proxy

a2enmod proxy_http