Skip to content

Instantly share code, notes, and snippets.

@sintret
Last active July 3, 2020 14:14
Show Gist options
  • Save sintret/49ce983cdff5d8c8f8c4bb56e11ec818 to your computer and use it in GitHub Desktop.
Save sintret/49ce983cdff5d8c8f8c4bb56e11ec818 to your computer and use it in GitHub Desktop.
nginx
Multiple PHP
http://hanangpriambodo.com/2019/04/05/install-multiple-php-di-centos-7/
https://www.cyberciti.biz/faq/howto-install-setup-nginx-on-debian-linux-9/
https://www.howtoforge.com/tutorial/how-to-install-nginx-with-php-and-mysql-lemp-on-debian-9/
https://www.digitalocean.com/community/tutorials/how-to-install-the-latest-mysql-on-debian-9
wget https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb
mysql-apt-config_0.8.10-1_all.deb
sudo dpkg -i mysql-apt-config*
sudo apt update
sudo apt install mysql-server
mysqladmin --user=root password "yourpass"
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
nano /etc/mysql/mysql.conf.d/mysqld.cnf
add this line
bind-address = 0.0.0.0
curl -sL https://deb.nodesource.com/setup_11.x -o nodesource_setup.sh
bash nodesource_setup.sh
sudo apt-get install -y nodejs
apt install build-essential
npm install nodemon -g
npm install pm2 -g
in nodejs file
app.use(express.static(path.join(__dirname, 'public'), { dotfiles: 'allow' }));
certbot certonly --webroot -w /var/www/keeplive.online/api/public -d keeplive.online -d www.keeplive.online
https://www.howtoforge.com/tutorial/how-to-install-nginx-with-php-and-mysql-lemp-on-debian-9/
apt-get install nginx
$ sudo ln -s /etc/nginx/sites-available/sintret.com /etc/nginx/sites-enabled/sintret.com
server {
listen 80; ## listen for ipv4; this line is default and implied
server_name smaince.com www.smaince.com;
return 301 https://smaince.com$request_uri;
}
server {
listen 443 ssl;
server_name smaince.com;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_certificate /etc/letsencrypt/live/smaince.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/smaince.com/privkey.pem;
root /var/www/smaince.com/frontend/web;
error_log /var/www/smaince.com/m.error.log;
location / {
try_files $uri /index.php?$query_string;
autoindex off;
error_page 404 500 502 503 504 /404.html;
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
access_log off;
expires 30d;
try_files $uri =404;
}
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}
ln -s /etc/nginx/sites-available/sintret.com /etc/nginx/sites-enabled/sintret.com
sudo service nginx restart
sudo service php7.0-fpm restart
apt-get install certbot
certbot certonly --webroot -w /var/www/php/www/frontend/web -d sintret.com -d chat.sintret.com -d recording.sintret.com
/etc/letsencrypt/live/sintret.com/fullchain.pem
##Install PHP FPM
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0
apt-get install php7.0-mbstring
apt-get install php7.0-gd
apt-get install php7.0-xml
apt-get install php7.0-zip
apt-get install php7.0-mysql
apt-get install php7.0-bcmath
apt-get install php7.2-ext-dom
apt-get install php7.2-xml
apt-get install php7.2-gd
apt-get install php7.2-zip
apt-get install php7.2-curl
PHP7.4
sudo apt -y install lsb-release apt-transport-https ca-certificates
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo
sudo apt update
sudo apt -y install php7.4
apt-get install php7.4-mbstring php7.4-gd php7.4-xml php7.4-zip php7.4-mysql php7.4-bcmath php7.4-curl
sudo systemctl disable --now apache2
sudo apt-get install php7.4-fpm
##Restart PHP
/etc/init.d/php7.2-fpm restart # debian-style PHP 7
##Cek php.ini
php --ini
#install mcrypt php > 7.2
sudo apt-get install php-pear php-dev
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo apt-get -y install libmcrypt-dev
sudo pecl install --nodeps mcrypt-snapshot
``libmcrypt prefix? [autodetect] :
``
press enter
sudo bash -c "echo extension=mcrypt.so > /etc/php/7.3/fpm/conf.d/mcrypt.ini"
restart php theb
#mysql
mysql -p -u usermysql databasemysql < yourfile.sql
certbot certonly --webroot -w /var/www/html/billing/frontend/web -d smaince.com -d www.smaince.com
openssl x509 -noout -dates -in /etc/letsencrypt/live/smaince.com/cert.pem
certbot renew --dry-run
certbot certonly -d jurnal.club,www.jurnal.club,mail.jurnal.club --expand
/usr/share/nginx/roundcubemail
https://github.com/0xboz/digitalocean_email_server
https://www.linuxbabe.com/mail-server/install-roundcube-webmail-ubuntu-16-04-nginx-mariadb-php7
#tweak fpm
www.conf
listen.backlog = 65536
sysctl net.core.somaxconn
echo "net.core.somaxconn=65536" >> /etc/sysctl.conf
sysctl -p
POSTGRES
psql -U postgres -d simtaru -f "C:/sql/dump_simtaru/dump_simtaru.sql"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment