linux搭建httpd
2021/12/17 7:23:27
本文主要是介绍linux搭建httpd,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
主配置类
[root@lxb ~]# cat /etc/httpd/conf.d/host.conf #ip地址访问 <VirtualHost 192.168.220.100:80> ServerAdmin ip/100 DocumentRoot "/www/ip/100" ErrorLog "/var/log/httpd/host.com-error_log" CustomLog "/var/log/httpd/host.com-access_log" common </VirtualHost> <Directory "/www/ip/100"> AllowOverride None Options None Require all granted </Directory> <VirtualHost 192.168.220.200:80> ServerAdmin ip/200 DocumentRoot "/www/ip/200" ErrorLog "/var/log/httpd/host.com-error_log" CustomLog "/var/log/httpd/host.com-access_log" common </VirtualHost> <Directory "/www/ip/200"> AllowOverride None Options None Require all granted </Directory> #端口号访问 listen 800 <VirtualHost 192.168.220.234:800> ServerAdmin port800 DocumentRoot "/www/port/800" ErrorLog "/var/log/httpd/host.com-error_log" CustomLog "/var/log/httpd/host.com-access_log" common </VirtualHost> <Directory "/www/port/800"> AllowOverride None Options None Require all granted </Directory> listen 1000 <VirtualHost 192.168.220.234:1000> ServerAdmin port1000 DocumentRoot "/www/port/1000" ErrorLog "/var/log/httpd/host.com-error_log" CustomLog "/var/log/httpd/host.com-access_log" common </VirtualHost> <Directory "/www/port/1000"> AllowOverride None Options None Require all granted </Directory> #缓存访问 <VirtualHost 192.168.220.235> ServerAdmin port800 DocumentRoot "/www/name" ErrorLog "/var/log/httpd/host.com-error_log" CustomLog "/var/log/httpd/host.com-access_log" common </VirtualHost> <Directory "/www/name"> AllowOverride None Options None Require all granted </Directory>
基于密码 [root@lxb ~]# cat /etc/httpd/conf.d/host1.conf listen 22222 <virtualhost 192.168.220.250:22222> servername zuoye DocumentRoot "/www/http" alias /mimi /www/secret </virtualhost> <directory "/www/http"> AllowOverride None #Options None Require all granted </directory> <directory "/www/secret"> authtype basic authname "please" authuserfile /mima Require user xiaoming </directory>
这篇关于linux搭建httpd的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-12如何创建可引导的 ESXi USB 安装介质 (macOS, Linux, Windows)
- 2024-11-08linux的 vi编辑器中搜索关键字有哪些常用的命令和技巧?-icode9专业技术文章分享
- 2024-11-08在 Linux 的 vi 或 vim 编辑器中什么命令可以直接跳到文件的结尾?-icode9专业技术文章分享
- 2024-10-22原生鸿蒙操作系统HarmonyOS NEXT(HarmonyOS 5)正式发布
- 2024-10-18操作系统入门教程:新手必看的基本操作指南
- 2024-10-18初学者必看:操作系统入门全攻略
- 2024-10-17操作系统入门教程:轻松掌握操作系统基础知识
- 2024-09-11Linux部署Scrapy学习:入门级指南
- 2024-09-11Linux部署Scrapy:入门级指南
- 2024-08-21【Linux】分区向左扩容的方法