Instalação do Apache, PHP e MySQL (MariaDB) no CentOS 7

Antes de fazer qualquer coisa, verifique se o sistema está atualizado:

# yum check-update
# yum update

Agora, para instalar o Apache, o PHP e o MySQL (MariaDB) no CentOS 7, siga os passos abaixo.

1) Instalação do MySQL (MariaDB):

Depois que o sistema estiver atualizado, como root, instale o MySQL (MariaDB):

# yum -y install mariadb-server mariadb

O CentOS instalará o MySQL (MariaDB) e quaisquer dependências. Depois disso, inicie o banco de dados e habilite a inicialização automática durante o boot do host:

# systemctl enable mariadb.service
# systemctl start mariadb.service

O próximo passo é rodar a rotina de configuração de segurança do MySQL, que “tranca” a instalação para evitar acessos não autorizados (em vermelho negrito estão os comandos a serem digitados durante a execução do comando):

# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password: (digite a senha aqui)
Re-enter new password: (repita a senha aqui)
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

2) Instalação do Apache:

Como root, instale o Apache:

# yum -y install httpd httpd-manual httpd-tools

O CentOS instalará o Apache e as dependências. Depois disso habilite o Apache para inicialização automática e inicie o daemon:

# systemctl enable httpd.service
# systemctl start httpd.service

Se nenhuma mensagem de erro for exibida, o Apache foi instalado corretamente. Agora é necessário configurar o firewall do CentOS para permitir acesso às portas 80 e 443:

# firewall-cmd --permanent --zone=public --add-service=http
# firewall-cmd --permanent --zone=public --add-service=https
# firewall-cmd --reload

Nesse momento você pode abrir o endereço http://<ip do servidor> para verificar se a página de teste do Apache é exibida corretamente (lembre-se que o firewall corporativo, além do firewall do próprio host onde o Apache está instalado, também tem que ser configurado para permitir o acesso):

Página de teste do Apache

 3) Instalação do PHP:

A instalação básica do PHP é muito simples:

# yum -y install php

O comando acima instalará o PHP 5.4 no CentOS e as dependências. Precisamos instalar mais alguns módulos importantes para o PHP (dependendo de sua aplicação web, outros módulos não listados aqui também podem ser necessários):

# yum -y install php-gd php-mysql php-odbc php-pear php-recode php-xml

Para fazer com que o Apache utilize PHP, basta reiniciá-lo:

# systemctl restart httpd.service

O teste mais básico para verificar se o PHP está instalado e corretamente configurado com o Apache é criar o arquivo /var/www/html/info.php com o seguinte conteúdo:

<?php
phpinfo();
?>

Abra o endereço http://<ip do servidor>/info.php e verifique se as informações do PHP são exibidas corretamente:

Informações do PHP

Por motivos de segurança o arquivo /var/www/html/info.php deve ser excluído após o teste.

423 thoughts on “Instalação do Apache, PHP e MySQL (MariaDB) no CentOS 7”

  1. Pingback: adam eve deal
  2. Pingback: tmb license lookup
  3. Pingback: porn movie
  4. Pingback: porn movie
  5. Pingback: Premio a la mujer
  6. Pingback: hack email account
  7. Pingback: piala dunia 2018
  8. Pingback: هایک ویژن
  9. Pingback: suterh
  10. Pingback: 100% kona coffee
  11. Pingback: geodesic dome tent
  12. Pingback: Cloud Archiving
  13. Pingback: mobile apps
  14. Pingback: adam and eve
  15. Pingback: best kona coffee
  16. Pingback: lion coffee
  17. Pingback: ben wa balls
  18. Pingback: realistic fun vibe
  19. Pingback: giving a blow job
  20. Pingback: mini massage wand
  21. Pingback: adidas鞋子
  22. Pingback: finger vibrator
  23. Pingback: کفسابی
  24. Pingback: Buy Vigra
  25. Pingback: com meu bebe
  26. Pingback: web hosting
  27. Pingback: butt plug
  28. Pingback: lace lingerie
  29. Pingback: tinglers plug
  30. Pingback: کفسابی
  31. Pingback: 6 inch dong
  32. Pingback: dildo strapon
  33. Pingback: cosmo vibrator
  34. Pingback: kona coffee
  35. Pingback: يوبيت
  36. Pingback: cock ring
  37. Pingback: seo marketing
  38. Pingback: corrugated plastic
  39. Pingback: wild orchid sex
  40. Pingback: best sex toys
  41. Pingback: adult toy catalog
  42. Pingback: adm eve online
  43. Pingback: 10 best sex toys
  44. Pingback: masturbator lube
  45. Pingback: best dildo to get
  46. Pingback: RMUTT Thailand
  47. Pingback: هایک ویژن
  48. Pingback: bondage paddle
  49. Pingback: sex toy review
  50. Pingback: SEO 2018
  51. Pingback: car accident
  52. Pingback: huge dildos
  53. Pingback: gold necklace
  54. Pingback: any number
  55. Pingback: peak wand vibrator
  56. Pingback: sex movie
  57. Pingback: leather strap on
  58. Pingback: sex toy review
  59. Pingback: mp3 song
  60. Pingback: Broke phone
  61. Pingback: buy womanizer toy
  62. Pingback: Black Dildo
  63. Pingback: keriomaker
  64. Pingback: خرید vpn
  65. Pingback: خرید کریو
  66. Pingback: sex doll for him
  67. Pingback: خرید kerio
  68. Pingback: beginner strap on
  69. Pingback: خرید کریو
  70. Pingback: clitoris
  71. Pingback: clinic
  72. Pingback: harmonica app
  73. Pingback: Powerful vibrator
  74. Pingback: Hot Tube
  75. Pingback: mumbai police
  76. Pingback: خرید هاست
  77. Pingback: 美容外科
  78. Pingback: نماشویی
  79. Pingback: Resources
  80. Pingback: singapore airlines
  81. Pingback: Panjab Police
  82. Pingback: 80's hits
  83. Pingback: sex video
  84. Pingback: Buy Dresses Online
  85. Pingback: اپل ایدی
  86. Pingback: خرید vpn
  87. Pingback: خرید vpn
  88. Pingback: pure kona coffee
  89. Pingback: Kona Cof
  90. Pingback: خرید vpn
  91. Pingback: 100% Ko coffee
  92. Pingback: persian setar
  93. Pingback: خرید vpn
  94. Pingback: find this
  95. Pingback: vegas strip
  96. Pingback: سئو
  97. Pingback: coffee beans
  98. Pingback: 100 kona coffee
  99. Pingback: خرید vpn
  100. Pingback: coffee
  101. Pingback: نصب آنتن
  102. Pingback: خرید vpn
  103. Pingback: خرید vpn
  104. Pingback: خرید کریو
  105. Pingback: خرید vpn
  106. Pingback: next
  107. Pingback: خرید vpn
  108. Pingback: raman kathpalia
  109. Pingback: خرید vpn
  110. Pingback: tam
  111. Pingback: خرید vpn
  112. Pingback: Rbx exchange
  113. Pingback: termeh
  114. Pingback: خرید vpn
  115. Pingback: managed hosting
  116. Pingback: خرید vpn
  117. Pingback: گوگل adwords
  118. Pingback: گوگل adwords
  119. Pingback: Belize motels
  120. Pingback: گوگل adwords
  121. Pingback: 脱毛
  122. Pingback: vpn
  123. Pingback: گوگل adwords
  124. Pingback: mauritius
  125. Pingback: nebbia leginy
  126. Pingback: persian tar
  127. Pingback: resume builder
  128. Pingback: گوگل adwords
  129. Pingback: خرید vpn
  130. Pingback: خرید vpn
  131. Pingback: خرید vpn
  132. Pingback: سیستم cctv
  133. Pingback: فروش طلا
  134. Pingback: love tips
  135. Pingback: سیستم cctv
  136. Pingback: Samsung wholesale
  137. Pingback: خرید طلا
  138. Pingback: سیستم cctv
  139. Pingback: خرید vpn
  140. Pingback: gratis inserate
  141. Pingback: خرید vpn
  142. Pingback: prostate orgasm
  143. Pingback: nipple fetish
  144. Pingback: سیستم cctv
  145. Pingback: خرید vpn
  146. Pingback: drivers hp
  147. Pingback: rotating vibrator
  148. Pingback: sex toys orgasm
  149. Pingback: خرید vpn
  150. Pingback: خرید طلا

Leave a Reply