{"id":4545,"date":"2018-09-17T11:53:15","date_gmt":"2018-09-17T14:53:15","guid":{"rendered":"https:\/\/blog.clusterweb.com.br\/?p=4545"},"modified":"2018-09-17T12:01:39","modified_gmt":"2018-09-17T15:01:39","slug":"tutorial-criando-um-vps-openvz","status":"publish","type":"post","link":"https:\/\/blog.clusterweb.com.br\/?p=4545","title":{"rendered":"[Tutorial] Criando um VPS &#8211; OpenVZ"},"content":{"rendered":"<p>Vamos l\u00e1:<\/p>\n<p>Primeiro quero dizer que nesse tutorial vamos usar o OpenVZ que tem suporte \u00e1 todos os sistemas de linux!<\/p>\n<p>Download\u00a0VPS\u00a0Linux Debian<\/p>\n<p>Digite os seguintes comandos para fazer o download do Debian Linux:<\/p>\n<div class=\"ipsQuote_citation ipsQuote_open\"># cd \/vz\/template\/cache<\/div>\n<div class=\"ipsQuote_contents ipsClearfix\" data-minimizedquotewashere=\"1\">\n<p># wget\u00a0<a href=\"https:\/\/download.openvz.org\/template\/precreated\/debian-8.0-x86_64.tar.gz\" target=\"_blank\" rel=\"external nofollow noopener\">https:\/\/download.openvz.org\/template\/precreated\/debian-8.0-x86_64.tar.gz<\/a><\/p>\n<\/div>\n<p>Criar\u00a0VPS<\/p>\n<p><!--more--><\/p>\n<p>Agora que voc\u00ea baixou o modelo do Debian para a sua m\u00e1quina virtual. Voc\u00ea pode simplesmente iniciar um\u00a0VPS\u00a0com base no modelo que voc\u00ea acabou de baixar, digitando os seguintes comandos:<\/p>\n<div><\/div>\n<div class=\"ipsQuote_citation ipsQuote_open\">vzctl create 10 &#8211;ostemplate\u00a0debian-8.0-x86_64<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>vzctl set 10 &#8211;onboot yes &#8211;save<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<h3>Set de IP para VPS ###<\/h3>\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>vzctl set 10 &#8211;ipadd 192.168.1.5 &#8211;save<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>&nbsp;<\/p>\n<h3>Set de Nameservers IP para VPS ###<\/h3>\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>vzctl set 10 &#8211;nameserver 192.168.1.111 &#8211;save<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>vzctl set 10 &#8211;nameserver 192.168.1.111 &#8211;save<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>&nbsp;<\/p>\n<h3>Set de Hostname IP para VPS ###<\/h3>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>vzctl set 10 &#8211;hostname vps.nixcraft.in &#8211;save<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>&nbsp;<\/p>\n<h3>Set de Disk quota para VPS (10G minimo [soft] e 11G limite maximo) ###<\/h3>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>vzctl set 10 &#8211;diskspace 10G:11G &#8211;save<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>&nbsp;<\/p>\n<h3>Ok agora damos inicio ###<\/h3>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>vzctl start 10<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>&nbsp;<\/p>\n<h3>Configurando a senha para o root do VPS ###<\/h3>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>vzctl exec 10 passwd<\/p>\n<\/div>\n<p>vzctl \u00e9 usado para criar e definir v\u00e1rias propriedades\u00a0VPS, como mem\u00f3ria, uso de disco e muito mais.<\/p>\n<div class=\"ipsQuote_citation ipsQuote_open\">create 10 : ID do VPS.<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>&#8211;ostemplate debian-8.0-x86_64 : Modelo de OS para o VPS.<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>&#8211;config vps.debian: Salvar Configura\u00e7\u00e3o.<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>set 10 : Define varias op\u00e7\u00f5es para o VPS ID #10.<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>&#8211;onboot yes : Fazer boot do VPS automaticamente ap\u00f3s o reboot.<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p>&#8211;save : Salvar altera\u00e7\u00f5es da configura\u00e7\u00e3o.<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Tarefas comuns OpenVZ Admin<\/p>\n<p>vzctl ato como uma ferramenta principal para v\u00e1rias tarefas:<\/p>\n<p>&nbsp;<\/p>\n<p>Como fa\u00e7o para Definir o nome do\u00a0VPS\u00a0para seu-vps.example.com?<\/p>\n<div class=\"ipsQuote_citation ipsQuote_open\"># vzctl set 10 &#8211;hostname seu-vps.example.com &#8211;save<\/div>\n<p>&nbsp;<\/p>\n<p>Como fa\u00e7o para definir o endere\u00e7o de IP do\u00a0VPS?<\/p>\n<div class=\"ipsQuote_citation ipsQuote_open\"># vzctl set 10 &#8211;ipadd 74.86.48.99 &#8211;save<\/div>\n<p>&nbsp;<\/p>\n<p>Como definir os NS para o\u00a0VPS?<\/p>\n<div class=\"ipsQuote_citation ipsQuote_open\"># vzctl set 10 &#8211;nameserver 10.0.1.11 &#8211;save<\/div>\n<p>&nbsp;<\/p>\n<p>Como fa\u00e7o para definir cotas para o\u00a0VPS?<\/p>\n<div class=\"ipsQuote_citation ipsQuote_open\"># vzctl set 10 &#8211;diskspace SoftLimitG:HardLimitG &#8211;save<\/div>\n<div class=\"ipsQuote_contents ipsClearfix\" data-minimizedquotewashere=\"1\">\n<p># vzctl set 10 &#8211;diskspace 10G:12G &#8211;save<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Como eu fa\u00e7o para dar Stop\/Start\/Restart nos Servidores\u00a0VPS?<\/p>\n<div class=\"ipsQuote_citation ipsQuote_open\"># vzctl start 10<\/div>\n<div class=\"ipsQuote_contents ipsClearfix\" data-minimizedquotewashere=\"1\">\n<p># vzctl restart 10<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsClearfix\" data-minimizedquotewashere=\"1\">\n<p># vzctl stop 10<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Como fa\u00e7o para executar um comando para o\u00a0VPS?<\/p>\n<p>&nbsp;<\/p>\n<p>Voc\u00ea pode executar o seguinte comando<\/p>\n<div class=\"ipsQuote_citation ipsQuote_open\"># vzctl exec 10 w<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p># vzctl exec 10 df<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p># vzctl exec 10 date<\/p>\n<\/div>\n<div class=\"ipsQuote_contents ipsTruncate ipsClearfix ipsTruncate_expanded\" data-minimizedquotewashere=\"1\">\n<p># vzctl exec 10 ps aux<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Como fazer login no servidor\u00a0VPS\u00a0(recipiente)?<\/p>\n<p>Digite o seguinte comando<\/p>\n<div class=\"ipsQuote_citation ipsQuote_open\"># vzctl enter 10<\/div>\n<p>Para sair, basta digitar:<\/p>\n<div class=\"ipsQuote_citation ipsQuote_open\"># exit<\/div>\n<p>&nbsp;<\/p>\n<p>Voc\u00ea pode entrar remotamente no seu\u00a0VPS\u00a0usando um cliente ssh putty:<\/p>\n<div class=\"ipsQuote_citation ipsQuote_open\">$ ssh\u00a0user@seu-vps.example.com<\/div>\n<p>&nbsp;<\/p>\n<p>Como fa\u00e7o para destruir\/excluir un\u00a0VPS?<\/p>\n<p>Digite o seguinte comando para excluir\u00a0VPS:<\/p>\n<div class=\"ipsQuote_citation ipsQuote_open\"># vzctl destroy 10<\/div>\n<p>&nbsp;<\/p>\n<p>Depois vou dar um exemplo de como criar um\u00a0VPS\u00a0com OS CentOS 5, s\u00f3 que estou de saida agora. \ud83d\ude42<\/p>\n<p>Favor dar um FeedBack.<\/p>\n<p>Link:<\/p>\n<p>Putty:\u00a0<a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html\" target=\"_blank\" rel=\"external nofollow noopener\">http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html<\/a><\/p>\n<p>Templates OpenVZ para outros OS:\u00a0<a href=\"https:\/\/download.openvz.org\/template\/precreated\/\" target=\"_blank\" rel=\"external nofollow noopener\">http:\/\/download.openvz.org\/template\/precreated\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vamos l\u00e1: Primeiro quero dizer que nesse tutorial vamos usar o OpenVZ que tem suporte \u00e1 todos os sistemas de linux! Download\u00a0VPS\u00a0Linux Debian Digite os seguintes comandos para fazer o download do Debian Linux: # cd \/vz\/template\/cache # wget\u00a0https:\/\/download.openvz.org\/template\/precreated\/debian-8.0-x86_64.tar.gz Criar\u00a0VPS<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1082,730,1,830,42,51,495,68],"tags":[770,436,370,607],"class_list":["post-4545","post","type-post","status-publish","format-standard","hentry","category-centos-7-rhel-7","category-clusterweb","category-viazap","category-debian","category-leitura-recomendada","category-linux-linuxrs","category-profissional-de-ti","category-redes-2","tag-criando","tag-openvz","tag-um","tag-vps"],"_links":{"self":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/4545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4545"}],"version-history":[{"count":6,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/4545\/revisions"}],"predecessor-version":[{"id":4551,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/4545\/revisions\/4551"}],"wp:attachment":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}