drupal8 mysql版本_CentOS8 安装drupal8,nginx1.14+mysql8+php7.2

本文介绍了在CentOS8系统上如何安装Drupal8、MySQL8和PHP7.2的详细步骤。包括下载Drupal,安装MySQL并配置数据库,安装nginx,配置nginx.conf和drupal.conf,以及安装php及其扩展,并设置了权限。
摘要由CSDN通过智能技术生成

下载drupal,建议手动下载最新,这里直接在服务器下载。8.x,请更换为具体的版本wget https://ftp.drupal.org/files/projects/drupal-8.x.tar.gz

注意:请确认你使用的环境是centos8!

1、安装mysql8或者mariadb10.3,这里用mysql8安装;mariadb10.3的下载和安装方式跟mysql8一样,将mysql换成mariadb即可,默认安装的就是10.3版本。。dnf install mysql mysql-server

配置mysql,根据提示创建数据库密码(你也可以创建数据库的单独用户,这里不再创建单独用户)mysql_secure_installation

重启数据库systemctl restart mysqld

2、安装nginx,默认安装的是nginx1.14版本dnf install nginx

配置nginx.conf,注意:user用户要给nginx权限,这样在安装drupal的时候,不用再费劲的配置每个文件的属性。另外drupal网站目录也应该给予nginx的权限vi /etc/nginx/nginx.conf

写入以下内容到nginx.conf,内容已调优,如果有自己的需求,可以按照自己的需求修订# For more information on configuration, see:

#   * Official English Documentation: http://nginx.org/en/docs/

#   * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;

worker_processes auto;

error_log /var/log/nginx/error.log;

pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.

include /usr/share/nginx/modules/*.conf;

events {

worker_connections 1024;

}

http {

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

'$status $body_bytes_sent "$http_referer" '

'"$http_user_agent" "$http_x_forwarded_for"';

access_log  /var/log/nginx/access.log  main;

client_header_buffer_size 32k;

large_client_header_buffers 4 32k;

sendfile             on;

tcp_nopush           on;

tcp_nodelay          on;

server_tokens        off;

keepalive_timeout    60;

types_hash_max_size  2048;

client_max_body_size 8M;

gzip                 on;

gzip_vary            on;

gzip_min_length      1k;

gzip_buffers         4 16k;

gzip_http_version    1.0;

gzip_comp_level      2;

gzip_disable         "MSIE [1-6]\.";

gzip_types           text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;

include             /etc/nginx/mime.types;

default_type        application/octet-stream;

# Load modular configuration files from the /etc/nginx/conf.d directory.

# See http://nginx.org/en/docs/ngx_core_module.html#include

# for more information.

include /etc/nginx/conf.d/*.conf;

}

配置drupal.confvi /etc/nginx/conf.d/drupal.conf

写入以下内容到drupal.confserver {

listen       80;

server_name  drupal.rednn.cn;

root         /srv/drupal;            // drupal所在位置

location / {

root   /srv/drupal;

index  index.php index.html index.htm;

try_files $uri $uri/ /index.php$is_args$args;

}

error_page 404 /404.html;

location = /40x.html {

}

error_page   500 502 503 504  /50x.html;

location = /50x.html {

root   html;

}

include /etc/nginx/default.d/*.conf;        // 在default.d文件夹下有个php.conf配置文件,里面自动写入了环境参数,直接调用即可。

location ~ /\.ht {

deny  all;

}

}

nginx配置完毕,重启systemctl restart nginx

3、安装php及所有扩展,默认安装的是php7.2版本dnf install php*

启动phpsystemctl start php-fpm

4、上传drupal网站目录

1ab380ce65a4943879f3347dd6143c20.png

给予drupal目录nginx权限chown nginx:nginx -R /srv/drupal/

51974847c208a5e7d4bc6cbd9849c463.png

1b04325931890c8815a96c9dc2438a4b.png

按照提示安装,end!

欢迎指正交流,如果在配置过程中出现问题,可以在下方留言。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值