quinta-feira, 22 de outubro de 2015

Cent OS 7 - Lemp Server (Nginx, MySQL, PHP)

How To Install Linux, Nginx, MySQL, PHP (LEMP) stack On CentOS 7

www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-7


Install and Configure MySQL/MariaDB

MySQL is replaced with MariaDB in CentOS 7. MariaDB is a popular drop-in replacement for MySQL.
NOTE: If you prefer to use the MySQL branded database in CentOS 7, you will need to add the required repositories by issuing the following command:
sudo yum install http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

  1. Install the MariaDB-server package:
  2. sudo yum install mariadb-server
    
  3. Set MariaDB to start at boot and start the daemon for the first time:
  4. sudo systemctl enable mariadb.service
    sudo systemctl start mariadb.service
    
  5. Run mysql_secure_installation to secure MariaDB. You will be given the option to change the MariaDB root password, remove anonymous user accounts, disable root logins outside of localhost, and remove test databases and reload privileges. It is recommended that you answer yes to these options:
  6. mysql_secure_installation
    


Create a MySQL/MariaDB Database

  1. Log in to MariaDB:
  2. mysql -u root -p
    
  3. Create a new database and user with permissions to use it:
  4. create database webdata;
    grant all on webdata.* to 'webuser' identified by 'password';
    
  5. Exit MariaDB
  6. quit
    

Installing and Configuring PHP

  1. Install PHP:
  2. sudo yum install php php-pear
    If you wish to install MySQL support for PHP also install the php-mysql package:
    sudo yum install php-mysql
  3. Edit /etc/php.ini for better error messages and logs, and upgraded performance.
  4. File excerpt: /etc/php.ini
    error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
    error_log = /var/log/php/error.log
    max_input_time = 30
    Note: Ensure that all lines noted above are uncommented. A commented line begins with a semicolon (;).
  5. Create the log directory for PHP and give the Apache user ownership:
  6. sudo mkdir /var/log/php
    sudo chown apache /var/log/php
  7. Reload Apache:
  8. sudo systemctl reload httpd
fonte (https://www.linode.com/docs/websites/lamp/lamp-server-on-centos-7)

Nenhum comentário:

Postar um comentário