Last active
May 6, 2022 22:57
-
-
Save patrickmaciel/392576b59bb7904bc9201a07ee926af4 to your computer and use it in GitHub Desktop.
p4dev - setup debian server with php mysql (mariadb) nginx composer
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; | |
listen [::]:80; | |
server_name localhost; | |
root /var/www/html; | |
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 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
GRANT ALL ON *.* TO 'voce'@'localhost' IDENTIFIED BY 'jesus-te-ama' WITH GRANT OPTION; | |
GRANT ALL ON *.* TO 'voce'@'%' IDENTIFIED BY 'jesus-te-ama' WITH GRANT OPTION; | |
1 ls | |
2 pwd | |
3 sudo apt-get update | |
4 sudo apt-get upgrade | |
5 ls | |
6 sudo apt install nginx | |
7 sudo ufw status | |
8 ls | |
9 sudo apt install -y vim | |
10 sudo vim /etc/nginx/sites-enabled/default | |
11 hostname | |
12 sudo apt show mysql-server | |
13 sudo apt-cache show mysql-server | |
14 sudo apt-get show mysql-server | |
15 sudo apt-cache show mysql-server | |
16 sudo apt-cache show mysql-server | grep Version | |
17 apt-show-versions mysql-server | |
18 sudo apt-cache madison mysql-server | |
19 sudo apt-cache madison mysql | |
20 sudo apt-cache madison vim | |
21 sudo apt-cache madison mariadb-server | |
22 sudo apt install mariadb-server | |
23 sudo mysql_secure_installation | |
24 sudo mysql | |
25 sudo mysqladmin version | |
26 mysqladmin -u precdev -p version | |
27 mysqladmin -u precdev -p | |
28 mysql -u precdev -p | |
29 sudo apt-cache show php | |
30 sudo apt -y install lsb-release apt-transport-https ca-certificates | |
31 sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg | |
32 sudo apt install wget curl | |
33 sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg | |
34 echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list | |
35 sudo apt update | |
36 history | |
sudo update-alternatives --config php | |
sudo update-alternatives --config phar | |
sudo update-alternatives --config phar.phar | |
sudo apt-get install php7.4-{bcmath,bz2,cgi,cli,common,curl,dba,decimal,dev,ds,fpm,gd,geoip,gmp,gnupg,http,imagick,imap,inotify,intl,json,ldap,mailparse,mbstring,mcrypt,memcache,memcached,mongodb,mysql,oauth,odbc,opcache,pcov,pgsql,phpdbg,ps,pspell,psr,readline,redis,snmp,snmp,soap,sqlite3,ssh2,tidy,uploadprogress,uuid,xdebug,xml,xmlrpc,xsl,yaml,zip} | |
sudo apt-get install php7.4-raphf | |
sudo apt-get install php7.4-propro | |
sudo update-alternatives --set php /usr/bin/php7.4 | |
sudo update-alternatives --set phar /usr/bin/phar7.4 | |
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.4 | |
sudo update-alternatives --set phpize /usr/bin/phpize7.4 | |
sudo update-alternatives --set php-config /usr/bin/php-config7.4 | |
15 curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash | |
16 cat ~/.bashrc | |
17 source ~/.profile | |
18 nvm list | |
19 nvm list node | |
20 nvm ls-remote | |
21 nvm install 14.18.1 | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
php composer-setup.php | |
php -r "unlink('composer-setup.php');" | |
mv composer.phar /usr/local/bin/composer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment