在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
docker 安装 使用官方提供的安装脚本,安装最新版的Docker
安装完成后,通过如下命令启动Docker的守护进程,并让它随系统启动自动加载
添加用户(jerry)到Docker组
命令笔记(centos),基于docker镜像2233466866/lnmp 下载镜像
创建基本目录
下载容器配置文件到本地相应目录
查看或修改基本配置(代码目录,日志保存目录及vhost目录配置添加) my.cnf
nginx.conf user www; worker_processes auto; worker_cpu_affinity auto; worker_cpu_affinity auto; pid logs/nginx.pid; events { worker_connections 102400; } http { charset utf-8; server_tokens off; log_format main '$remote_addr - $remote_user [$time_iso8601] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; include mime.types; default_type application/octet-stream; client_max_body_size 20M; sendfile on; keepalive_timeout 20; gzip on; gzip_vary on; gzip_comp_level 1; gzip_types text/css application/javascript application/json image/png image/webp image/apng image/jpeg image/x-icon; autoindex_localtime on error_log /logs/z_error.log; access_log /logs/z_$host.log main; server { listen 80 default; root /www/default; return 500; } include vhost/*.conf; } 停止并删除测试容器
重新创建容器
mysql 数据库配置(/etc/my.cnf)
php.ini 配置(/usr/local/php7/lib/php.ini)
linux 相关设置修改 添加不能登陆的用户www
修改时区(/etc/profile)
多站点配置 www.test.test.conf server { listen 80; server_name test.test; rewrite ^(.*)$ $scheme://www.test.test$1 permanent; } server { listen 80; server_name www.test.test; if ($time_iso8601 ~ "^(\d{4}-\d{2}-\d{2})") { set $ttt $1; } access_log /logs/$host-$ttt-access.log main; root /www/test; location / { index index.php index.html index.htm; } location ~* \.php { include fastcgi_params; fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } 以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持极客世界。 |
请发表评论