Apache和Nginx虚拟主机的创建
发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,一、Apache(1)基于访问主机头(FQDN)cat /etc/httpd/conf.d/vhostfqdn.conf documentroot /data/web01
千家信息网最后更新 2026年11月02日Apache和Nginx虚拟主机的创建
一、Apache
(1)基于访问主机头(FQDN)
cat /etc/httpd/conf.d/vhostfqdn.confdocumentroot /data/web01 servername www.web01.com require all granted CustomLog "logs/a_access_log" combineddocumentroot /data/web02 servername www.web02.com require all granted CustomLog "logs/a_access_log" combineddocumentroot /data/web03 servername www.web03.com require all granted CustomLog "logs/a_access_log" combined
(2)基于ip地址
cat /etc/httpd/conf.d/vhostip.confdocumentroot /data/web01 require all granted documentroot /data/web02 require all granted documentroot /data/web03 require all granted
(3)基于端口号
cat /etc/httpd/conf.d/vhostport.conf listen 8001listen 8002listen 8003documentroot /data/web01 require all granted documentroot /data/web02 require all granted documentroot /data/web03 require all granted
二、Nginx
(1)基于域名且不同站点
server { listen 80; server_name mobile.magedu.com; location / { root html; index index.html index.htm; } location /python { root /mobile; !!!必须在/mobile目录下创建/python目录,且把文件写入python目录中,否则会报错!!! index index.html index.htm; } location /java { root /mobile; index index.html index.htm; } } server { listen 80; server_name www.magedu.com; location / { root html; index index.html index.htm; } location /python { root /www; index index.html index.htm; } location /java { root /www; index index.html index.htm; } }
目录
主机
不同
口号
地址
域名
文件
站点
会报
虚拟主机
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
互联网科技海报
互联网科技名片
有马互联网科技
唐信互联网科技
互联网科技股有哪些
甘肃拓世互联网科技有限公司
科技大学互联网专业好不好
互联网公司会议桌创意科技软装饰
广州优美互联网科技
互联网科技中介
昭通互联网科技选哪家
允成互联网科技有限公司融资
锡山区互联网智能科技产品供应
深圳无忧互联网科技
半导体行业属于互联网高科技类吗
长沙渺峰互联网科技有限公司
银川新华互联网科技学校原画
现代互联网科技公司
六子台科技互联网展会
广州全民伙伴互联网科技有限公司
互联网科技会
广州互联网科技公司
互联网 科技创业
互联网 视角下的科技创新
大白互联网科技
互联网科技生活的内容
广州新华互联网科技学校电竞方面
郑州欣桑互联网科技有限公司
湖北辰鑫科技互联网
杭州融税互联网科技有限公司