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-12-18git仓库有更新,jenkins 自动触发拉代码怎么配置的?-icode9专业技术文章分享
- 2024-12-18Jenkins webhook 方式怎么配置指定的分支?-icode9专业技术文章分享
- 2024-12-13Linux C++项目实战入门教程
- 2024-12-13Linux C++编程项目实战入门教程
- 2024-12-11Linux部署Scrapy教程:新手入门指南
- 2024-12-11怎么将在本地创建的 Maven 仓库迁移到 Linux 服务器上?-icode9专业技术文章分享
- 2024-12-10Linux常用命令
- 2024-12-06谁看谁服! Linux 创始人对于进程和线程的理解是…
- 2024-12-04操作系统教程:新手入门及初级技巧详解
- 2024-12-04操作系统入门:新手必学指南