SetupMariaDB/NginX/PHPonRHELandDerivatives._MySQL
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了SetupMariaDB/NginX/PHPonRHELandDerivatives._MySQL,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2928字,纯文字阅读大概需要5分钟。
内容图文
![SetupMariaDB/NginX/PHPonRHELandDerivatives._MySQL](/upload/InfoBanner/zyjiaocheng/578/3b34d9a1066b4ba0b29e0a1a862b6bb1.jpg)
Setting up MariaDB and using it is just as easy as setting up mySQL. MariaDB was designed as a drop in for mySQL. This guide is designed to walk you through the process.
Initial Setup
First we need to install the EPEL Package source.
# rpm -Uivh http://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
PHP and php-fpm
What is php-fpm?
PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites.
To install via yum you can simply do
# yum -y install php php-fpm php-mysql
MariaDB
What is MariaDB?
MariaDB is a drop in replacement for mySQL (i.e its entirely compatible with mySQL)
To install it you need to add a file called mariadb.repo to /etc/yum/repos.d the file should contain
[mariadb]name = MariaDBbaseurl = http://yum.mariadb.org/10.0/centos6-amd64gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1
Once you have this simply install with
# yum -y install MariaDB-* --skip-broken --exclude=MariaDB-Galera-server
The above will install all you need unless you wish to setup a MariaDB Cluster (Stay Tuned for another tut)
You can access the MariaDB Console from
# mysql
NginX
Nginx (pronounced engine-x) is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. Igor Sysoev started development of Nginx in 2002, with the first public release in 2004. Nginx now hosts nearly 12.18% (22.2M) of active sites across all domains. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.
Installing
Installing NginX is pretty simple its just
# yum -y install nginx
Setting up your vhost
Create a file in /etc/nginx/conf.d called example.com
The file should contain the following (I have commented)
server { listen 80; # Use port 80 as listening port server_name example.com www.example.com; # Serve both www.example.com and example.com root /var/www/example/; # Absolute Path to webroot index index.php index.htm index.html; # index file names
# This block denies access to common config files location ~ /(config/.php|common/.php|cache|files|images/avatars/upload|includes|store) { deny all; return 403; }
# Cache configuration for image files location ~* /.(gif|jpe?g|png|css)$ { expires 30d; }
# Handle PHP File location ~ /.php$ { try_files $uri =404; # If the file does not exist return a 404 error fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; # Use a unix socket for fast-cgi fastcgi_index index.php; # Indec files for fast_cgi fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # Fast CGI Script Location include fastcgi_params; # Include Fast CGI Defaults }}
Starting Up
# service php-fpm start# chkconfig php-fpm on# service nginx start# chkconfig nginx on# service mysqld start # NOTE: MariaDB uses mysqld as daemon name# chkconfig mysqld on
内容总结
以上是互联网集市为您收集整理的SetupMariaDB/NginX/PHPonRHELandDerivatives._MySQL全部内容,希望文章能够帮你解决SetupMariaDB/NginX/PHPonRHELandDerivatives._MySQL所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。