Last active
April 3, 2019 20:28
-
-
Save lucenarenato/ea3d137b8014e59dbc5c0c586e98deb2 to your computer and use it in GitHub Desktop.
PHP7 + nginx + mysql + Lets Encrypt
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
#!/bin/sh | |
## PHP7 + nginx + mysql + Lets Encrypt | |
### Comandos de instalação de php7 + nginx + mysql e comandos para criar certificado digital usando Lets Encrypt (Linux) | |
```sh | |
sudo add-apt-repository ppa:nginx/stable | |
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade | |
sudo apt-get install software-properties-common | |
sudo apt-get install nginx | |
sudo apt-get install mysql-server mysql-client | |
sudo add-apt-repository -y ppa:ondrej/php && sudo apt-get update | |
sudo apt-get install php7.2-cli php7.2-fpm php7.2-mysql php7.2-curl php-memcached php7.2-dev php7.2-mcrypt php7.2-sqlite3 | |
sudo apt-get install php7.2-mbstring | |
sudo apt-get install php7.2-gd | |
sudo apt-get install php7.2-intl | |
sudo apt-get install php7.2-zip | |
sudo apt-get install php7.2-soap | |
``` | |
## Outros | |
## Download package lists from repositories & fetch new versions of packages. | |
```sh | |
sudo apt-get update && apt-get upgrade | |
``` | |
## Install php7.2 and all modules | |
```sh | |
sudo apt-get install php7.2 libapache2-mod-php7.2 libphp7.2-embed php-all-dev php7.2-bcmath php7.2-bz2 php7.2-cgi php7.2-common php7.2-curl php7.2-dba php7.2-dev php7.2-enchant php7.2-fpm php7.2-gd php7.2-gmp php7.2-imap php7.2-interbase php7.2-intl php7.2-json php7.2-ldap php7.2-mbstring php7.2-mysql php7.2-odbc php7.2-opcache php7.2-pgsql php7.2-phpdbg php7.2-pspell php7.2-readline php7.2-recode php7.2-snmp php7.2-soap php7.2-sqlite3 php7.2-sybase php7.2-tidy php7.2-xml php7.2-xmlrpc php7.2-xsl php7.2-zip php-amqp php-apcu php-geoip php-igbinary php-imagick php-mongodb php-msgpack php-oauth php-redis php-rrd php-smbclient php-solr php-ssh2 php-uuid php-zmq php-radius php-http php-yaml php-all-dev php-xdebug php-memcached php-memcache php-gmagick php-tideways php-mailparse php-gnupg php-propro php-raphf php-stomp php-gearman php-phalcon php-ds php-sass php-lua php-sodium | |
``` | |
### Mais opçoes | |
# This command and the ppa and auto apt-get update after that | |
sudo env LC_ALL=C.UTF-8 add-apt-repository --yes ppa:ondrej/php | |
# Install PHP 7.2 and the most common extesions | |
```sh | |
sudo apt-get install php7.2-fpm php7.2-common php7.2-dev php7.2-curl php7.2-gd php7.2-json php7.2-mysql php7.2-odbc php7.2-pgsql php7.2-pspell php7.2-readline php7.2-sqlite3 php7.2-tidy php7.2-xml php7.2-xmlrpc php7.2-bcmath php7.2-bz2 php7.2-intl php7.2-mbstring php7.2-phpdbg php7.2-soap php7.2-zip php-imagick php-gettext php-redis php-memcached | |
``` | |
## letsencrypt | |
./letsencrypt-auto certonly --webroot -w /var/www/sites/dominio.com.br -d dominio.com.br -d www.dominio.com.br | |
/etc/letsencrypt/live/dominio.com.br/cert.pem | |
/etc/letsencrypt/live/dominiot.com.br/chain.pem | |
/etc/letsencrypt/live/dominio.com.br/fullchain.pem | |
/etc/letsencrypt/live/dominio.com.br/privkey.pem | |
ssl_certificate /etc/letsencrypt/live/dominio.com.br/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/dominio.com.br/privkey.pem; | |
```sh | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install mysql-server-5.6 mysql-client-5.6 mysql-client-core-5.6 | |
``` | |
/etc/init.d/mysql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment