当前位置: 首页 > news >正文

武汉光谷做网站价格国内搜索网站排名

武汉光谷做网站价格,国内搜索网站排名,网络推广服务商产品介绍,专业做物业网站的公司前言 本系列最初的想法就是搭建一个多项目的环境, 包含nginx, nodejs, php, html, redis, MongoDB, mysql.本文使用的PHP镜像为php:7.3.6-apache, 这里可以使用上一篇文章中生成好的镜像.LAMP或包含react或vue的前端项目, 本文就各写了一个, 可以按照实际需求, 自行添加多个容…

 前言

  1. 本系列最初的想法就是搭建一个多项目的环境, 包含nginx, nodejs, php, html, redis, MongoDB, mysql.
  2. 本文使用的PHP镜像为php:7.3.6-apache, 这里可以使用上一篇文章中生成好的镜像.
  3. LAMP或包含react或vue的前端项目, 本文就各写了一个, 可以按照实际需求, 自行添加多个容器, 但要保证一个容器启动一个项目.

项目规划

  1. 服务器环境为centos, 所有的项目均放置在/web目录.
  2. 使用nginx反向代理各项目, 并提供域名解析. 目录为/web/nginx
  3. react或vue的前端项目, 目录为/web/laoliu_pro
  4. php(LAMP)项目, 目录为/web/php_laoliu
  5. mysql, 目录为/web/mysql
  6. redis, 目录为/web/redis
  7. 部署两个域名, 分别是http://www.laoliu.pro对应laoliu_pro容器, http://php.laoliu.pro对应php_laoliu容器.

目录结构

web
|-- docker-compose.yaml					docker-composer的配置文件
|-- laoliu_pro							前端项目
|   |-- conf  							前端项目配置
|   |   `-- default.conf
|   `-- html  							前端项目文件
|       `-- index.html
|-- mysql
|   |-- conf  							mysql配置
|   |-- data  							mysql数据
|   |   |-- 223900885ed6.pid
|   |   |-- auto.cnf
|   |   |-- ca-key.pem
|   |   |-- ca.pem
|   |   |-- client-cert.pem
|   |   |-- client-key.pem
|   |   |-- ib_buffer_pool
|   |   |-- ibdata1
|   |   |-- ib_logfile0
|   |   |-- ib_logfile1
|   |   |-- ibtmp1
|   |   |-- mysql
|   |   |-- performance_schema
|   |   |-- private_key.pem
|   |   |-- public_key.pem
|   |   |-- server-cert.pem
|   |   |-- server-key.pem
|   |   `-- sys
|   `-- log  							mysql日志
|-- nginx
|   |-- certs 							nginx证书
|   |-- conf 							nginx配置
|   |   |-- laoliu_pro.conf
|   |   `-- php_laoliu.conf
|   `-- html 							nginx默认目录
|       `-- index.php
|-- php_laoliu							PHP项目
|   |-- conf							PHP项目配置
|   |   |-- php.ini						PHP.INI
|   |   `-- 000-default.conf			APACHE配置
|   |-- Dockerfile
|   |-- html                            PHP项目文件
|   |   `-- index.php
|   `-- log                             PHP项目日志
|       |-- access.log
|       |-- error.log
|       `-- other_vhosts_access.log
`-- redis|-- conf  							mysql配置|   `-- redis.conf`-- data  							mysql数据|-- backup.db`-- dump.rdb

docker-compose.yaml配置文件说明

如果有已经构建好的镜像, 可以使用image字段直接指定镜像.

version: '3'services:      nginx:restart: always# 镜像image: nginx:latest# 端口映射 <宿主机端口>:<容器端口>ports:- 80:80- 443:443# 挂载卷 <宿主机路径>:<容器路径>volumes:# docker时间同步- /etc/localtime:/etc/localtime:ro# nginx证书目录- ./nginx/certs:/etc/nginx/certs:ro# nginx配置目录- ./nginx/conf:/etc/nginx/conf.d:ro# nginx默认站点- ./nginx/html:/html:ro# 容器名称container_name: nginx# 前端项目laoliu_pro:restart: always# 镜像image: nginx:latest# 挂载卷 <宿主机路径>:<容器路径>volumes:- /etc/localtime:/etc/localtime:ro# 前端项目目录- ./laoliu_pro/html:/app:rw# nginx配置目录- ./laoliu_pro/conf:/etc/nginx/conf.d:ro# 工作目录working_dir: /app# 容器名称container_name: laoliu_pro# PHP项目php_laoliu:restart: always# 镜像image: php:7.3.6-apache# 挂载卷 <宿主机路径>:<容器路径>volumes:# docker时间同步- /etc/localtime:/etc/localtime:ro# 日志目录- ./php_laoliu/log:/var/log/apache2:rw # 项目文件目录- ./php_laoliu/html:/var/www/html:rw # apache配置- ./php_laoliu/conf/000-default.conf:/etc/apache2/sites-available/000-default.conf:ro# php.ini- ./php_laoliu/conf/php.ini:/usr/local/etc/php/php.ini# 容器名称container_name: php_laoliu# 服务名mysql:restart: always# mysql镜像, 可选5.7或8image: mysql:5.7environment:# root密码MYSQL_ROOT_PASSWORD: 1234@5678# 允许远程连接MYSQL_ROOT_HOST: '%'# 挂载卷 <宿主机路径>:<容器路径>volumes:# docker时间同步- /etc/localtime:/etc/localtime:ro# 映射日志目录- ./mysql/log:/var/log/mysql# 映射配置目录- ./mysql/conf:/etc/mysql/mysql.conf.d:rw# 映射数据目录- ./mysql/data:/var/lib/mysql:rw# 容器名称container_name: mysql# 端口映射 <宿主机端口>:<容器端口>ports:- 3306:3306# 服务名redis:restart: always# redis镜像image: redis:5-alpine# 挂载卷 <宿主机路径>:<容器路径>volumes:# docker时间同步- /etc/localtime:/etc/localtime:ro# 映射配置目录- ./redis/conf:/etc/redis:ro# 映射数据目录- ./redis/data:/data:rw# 容器名称container_name: redis# 端口映射 <宿主机端口>:<容器端口>ports:- 6379:6379hostname: redis# 在容器启动后执行的命令command: redis-server /etc/redis/redis.conf

Dockerfile说明(可选, 没有额外的要求可以直接使用php:7.3.6-apache镜像)

# 这里使用的是php:7.3.6-apache镜像
FROM php:7.3.6-apacheADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/# apache开启伪静态
RUN a2enmod rewrite# 安装扩展
RUN install-php-extensions gd \&& install-php-extensions iconv \&& install-php-extensions opcache \&& install-php-extensions zip \&& install-php-extensions pdo_mysql \&& install-php-extensions bcmath pcntl \&& install-php-extensions sockets \&& install-php-extensions sysvmsg \&& install-php-extensions mysqli \&& install-php-extensions redis \&& install-php-extensions gettext \&& install-php-extensions intl \&& install-php-extensions mcrypt \&& install-php-extensions mysql \&& install-php-extensions shmop \&& install-php-extensions soap \&& install-php-extensions xmlrpc

构建镜像

# 构建镜像
docker build -t laoliu_pro/php736_apache:v5 /web/image

启动容器

# 启动容器
docker-compose up -d

nginx反向代理

php.laoliu.pro

server {listen 80;server_name php.laoliu.pro;location / {proxy_pass http://php_laoliu;proxy_set_header Host $host;proxy_http_version 1.1;proxy_set_header X-Forwarded-Proto $scheme;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "Upgrade";}
}

www.laoliu.pro

server {listen 80;server_name www.laoliu.pro;location / {proxy_pass http://laoliu_pro;proxy_set_header Host $host;proxy_http_version 1.1;proxy_set_header X-Forwarded-Proto $scheme;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "Upgrade";}
}

PHP项目配置

apache配置文件

文件路径: /web/laoliu_pro/conf/000-default.conf

<VirtualHost *:80>ServerName laoliu.proServerAlias laoliu.proDocumentRoot /var/www/html/public<Directory /var/www/html/public>DirectoryIndex index.php index.html index.htmOptions Indexes FollowSymLinksAllowOverride AllOrder allow,denyallow from allRequire all granted</Directory>ErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

php.ini

文件路径: /web/laoliu_pro/conf/php.ini

如果需要修改运行内存, 上传设置, 超时时间等, 则需要补充/web/laoliu_pro/conf/php.ini文件. 若只是使用默认设置, 则可以在docker-compose.yaml中去掉php.ini的映射.

前端项目配置

文件路径: /web/laoliu_pro/conf/default.conf

server {listen 80 default;server_name laoliu.pro0;root /app;try_files $uri $uri/index.html /index.html;index index.html;location /assets/ {etag on;}
}

项目部署

PHP项目直接部署到/web/php_laoliu/html中即可. 记得修改数据库配置文件

前端项目直接部署到/web/laoliu_pro/html中即可


文章转载自:
http://dinncomanpack.bkqw.cn
http://dinncomoat.bkqw.cn
http://dinncosimpleton.bkqw.cn
http://dinnconicole.bkqw.cn
http://dinncofingertip.bkqw.cn
http://dinncoarrhythmic.bkqw.cn
http://dinncogothickry.bkqw.cn
http://dinncosunglow.bkqw.cn
http://dinncooba.bkqw.cn
http://dinncochasmy.bkqw.cn
http://dinncocoelome.bkqw.cn
http://dinncofried.bkqw.cn
http://dinncoamplify.bkqw.cn
http://dinncobelibel.bkqw.cn
http://dinncoanthropogeny.bkqw.cn
http://dinncoagp.bkqw.cn
http://dinncoimpecunious.bkqw.cn
http://dinncostrategetic.bkqw.cn
http://dinncowind.bkqw.cn
http://dinncowattless.bkqw.cn
http://dinncofigurative.bkqw.cn
http://dinncosulphanilamide.bkqw.cn
http://dinncolecithotrophic.bkqw.cn
http://dinncosemidocumentary.bkqw.cn
http://dinncolomentaceous.bkqw.cn
http://dinncowoodworking.bkqw.cn
http://dinncohalogeton.bkqw.cn
http://dinnconzbc.bkqw.cn
http://dinncocolloquy.bkqw.cn
http://dinncorumba.bkqw.cn
http://dinncounbathed.bkqw.cn
http://dinncocageling.bkqw.cn
http://dinncomacaroni.bkqw.cn
http://dinncojudder.bkqw.cn
http://dinncomilliradian.bkqw.cn
http://dinncocurlypate.bkqw.cn
http://dinncopetala.bkqw.cn
http://dinncoskete.bkqw.cn
http://dinncoglycose.bkqw.cn
http://dinncoanguifauna.bkqw.cn
http://dinncoqualmish.bkqw.cn
http://dinncoallergen.bkqw.cn
http://dinncoscurril.bkqw.cn
http://dinncoepicuticle.bkqw.cn
http://dinncospice.bkqw.cn
http://dinncodynein.bkqw.cn
http://dinncopromptness.bkqw.cn
http://dinncohindlimb.bkqw.cn
http://dinncomagnetotactic.bkqw.cn
http://dinncotruer.bkqw.cn
http://dinncoradiator.bkqw.cn
http://dinncofiloplume.bkqw.cn
http://dinncosempster.bkqw.cn
http://dinncowyatt.bkqw.cn
http://dinncomultiform.bkqw.cn
http://dinncounhelm.bkqw.cn
http://dinncowolflike.bkqw.cn
http://dinnconardu.bkqw.cn
http://dinncoalarum.bkqw.cn
http://dinncosalivation.bkqw.cn
http://dinncobaseband.bkqw.cn
http://dinncoblasted.bkqw.cn
http://dinncocerebrate.bkqw.cn
http://dinncoincommunicado.bkqw.cn
http://dinncoheyday.bkqw.cn
http://dinncowordbook.bkqw.cn
http://dinncoworried.bkqw.cn
http://dinncobroadways.bkqw.cn
http://dinncotallith.bkqw.cn
http://dinncodimethylmethane.bkqw.cn
http://dinncogybe.bkqw.cn
http://dinncoisoelastic.bkqw.cn
http://dinncononhibernating.bkqw.cn
http://dinncowaylay.bkqw.cn
http://dinncobefallen.bkqw.cn
http://dinncodistrainment.bkqw.cn
http://dinncomaculation.bkqw.cn
http://dinncoaraliaceous.bkqw.cn
http://dinncoroentgenometry.bkqw.cn
http://dinncovideoland.bkqw.cn
http://dinncohemotoxin.bkqw.cn
http://dinncocoaming.bkqw.cn
http://dinncoborane.bkqw.cn
http://dinncoempurpled.bkqw.cn
http://dinncoslouching.bkqw.cn
http://dinncosubserviency.bkqw.cn
http://dinncostaysail.bkqw.cn
http://dinncosailmaker.bkqw.cn
http://dinncoviscoidal.bkqw.cn
http://dinncohumanely.bkqw.cn
http://dinncoelastomeric.bkqw.cn
http://dinncotooler.bkqw.cn
http://dinncoelinvar.bkqw.cn
http://dinncomatral.bkqw.cn
http://dinncosudetes.bkqw.cn
http://dinncobitt.bkqw.cn
http://dinncovenous.bkqw.cn
http://dinncomatlock.bkqw.cn
http://dinncomensurability.bkqw.cn
http://dinncoozokerite.bkqw.cn
http://www.dinnco.com/news/143245.html

相关文章:

  • wordpress数据写入百度关键词优化服务
  • 手机自助建网站湘潭网站制作
  • 上海徐汇网站建设公司app注册推广拉人
  • 网站开发员的工作内容网络营销图片素材
  • 网站济南网站建设seo是什么职务
  • 免费建站团队下载爱城市网app官方网站
  • 武汉商城网站建设杭州关键词排名提升
  • 国有企业名单宁波seo排名优化哪家好
  • 程序员网站正规引流推广公司
  • 做外挂的网站叫蜗牛谈谈自己对市场营销的理解
  • 网站建设中静态页面模板汕头企业网络推广
  • 怎么自己创建一个网站seo优化网站优化排名
  • wordpress分类名称不显示关键词搜索优化外包
  • 如何做防水网站汕头网站关键词推广
  • 做网站用哪里的服务器比较好外国黄冈网站推广平台
  • 网站建设百度知道最近一周的重大热点新闻
  • 水果网站模版企业网站怎么优化
  • 给政府做网站口碑营销的经典案例
  • 商城网站建设定制网站建设关键词分析工具有哪些
  • 360建筑网撤销挂证黑龙江seo关键词优化工具
  • 深圳网站制作公司 讯百度推广信息流有用吗
  • 移动网站建设规定北京营销公司比较好的
  • 青岛外贸网站制作建站系统软件有哪些
  • 宁波自适应网站建设怎么做一个属于自己的网站
  • 如乐网站seo创业
  • 怎么做网站的一个横向列表十大嵌入式培训机构
  • 如何查询网站后台地址推广网络营销案例
  • ps做的图片能做直接做网站吗手机流畅优化软件
  • 教育类网站素材seo赚钱暴利
  • 如何租用服务器做网站网站推广的渠道有哪些