Code Monkey home page Code Monkey logo

comandoslinux's Introduction

Comandos linux

Tutoriais

Criando certificados para apache

Criando um arquivo com nano

nano san.cnf

Dentro do arquivo escreva

[req] distinguished_name = req_distinguished_name req_extensions = v3_req prompt = no [req_distinguished_name] C = BR ST = DF L = Brasília O = OU = CN = [v3_req] keyUsage = keyEncipherment, dataEncipherment extendedKeyUsage = serverAuth subjectAltName = @alt_names [alt_names] DNS.1 = DNS.2 =

Criar req utilizando o openssl

openssl req -out .csr -new -newkey rsa:2048 -nodes -keyout .key -config san.cnf

visualizar csr com cat

cat .csr

faça copia do conteudo do csr

caso precise de permissão

chown :

assine o certificado e copie para dentro da mesma pasta e execute

conveter de para crt

openssl x509 -inform PEM -in .cer -out .crt

navegue ate sites avaiable

cd /etc/apache2/sites-available/

crie um novo arquivo

nano .conf

ou faça uma copia do arquivo .conf .conf

cp .conf .conf

escreva

<VirtualHost :443> ServerName

Vhost docroot

DocumentRoot "/var/www/html/<'site'>"

Directories, there should at least be a declaration for /var/www/html

<Directory "/var/www/html"> Options Indexes FollowSymLinks MultiViews AllowOverride None Require all granted

SSL directives

SSLEngine on SSLCertificateFile "/home/josue.bruno/certificados//.crt" SSLCertificateKeyFile "/home/josue.bruno/certificados//.key"

Logging

ErrorLog "/var/log/apache2/.ipea.gov.br-443_error.log" ServerSignature Off CustomLog "/var/log/apache2/.ipea.gov.br-443_access.log" "combined" env=!viaproxy CustomLog "/var/log/apache2/.ipea.gov.br-443_access.log" "forwarded" env=viaproxy SetEnvIf X-Forwarded-For "^......." viaproxy

Redirecionar da 80 para 443

Redirect rules

Redirect / https://seusite.contoso.com.br/

SetEnvIf X-Forwarded-For "^......." viaproxy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.