用Apache反向代理设置对外的WWW和文件服务器
简介:一台机器用专线接入Internet作为防火墙,在内部网段上有一台WWW服务器
(Redhat 6.1,Apache 1.3.9)希望这台机器能对外提供WWW服务器和基于apache
的文件服务。供外部世界公共访问WWW服务器,或者外地分公司下载需要的文件。
优点: 内部的WWW服务器和文件服务完全与外部世界隔开,不直接连接到外部,通过
防火墙上运行的Apache服务提供对内部的代理访问,增强了安全性,同时在
防火墙上运行的Apache服务运用基于名字的虚拟主机技术,使得防火墙上的
主页不会被访问到。符合了作为防火墙要求运行服务越少越安全的准则。
实现方法:在内部网段上的Apache服务器(192.168.11.2)存放的是公司主页,供内部
和外部用户公共访问,并设置/home/ftp/pub目录为文件存放区域,用
http://download.yourdomain.com/pub/来访问。
在防火墙上设置apache反向代理技术,由防火墙代理对内部网段上的访问。
步骤:
一. 内部网段上的Apache服务器设置
apache采用默认配置。主目录为/home/httpd/html,主机域名为 sun.yourdomain.com,
且别名www.yourdomain.com, 并且设置srm.conf加一行别名定义如下:
Alias /pub /home/ftp/pub/
且更改默认应用程序类型定义如下:
DefaultType application/octet-stream
最后在/etc/httpd/conf/access.conf中增加一项定义
Options Indexes
AllowOverride AuthConfig
order allow,deny
allow from all
注:Options Indexes允许在找不到index.html文件的情况下允许列出目录/文件列表。
AllowOverride AuthConfig允许做基本的用户名和口令验证。
这样的话,你需要在/home/ftp/pub目录下放入.htaccess,内容如下:
-------
[root@shopu pub]# more .htaccess
AuthName Branch Office Public Software Download Area
AuthType Basic
AuthUserFile /etc/.usrpasswd
require valid-user
------
然后用#htpasswd -c /etc/.usrpasswd user1
分别创建不同的允许访问/pub下文件服务的外部用户名和口令。
二. 防火墙上反向代理配置:
加下面的行到/etc/httpd/conf/httpd.conf
NameVirtualHost 1.2.3.4
# 1.2.3.4是防火墙外部网卡的互联网上永久IP地址
servername www.yourdomain.com
errorlog /var/log/httpd/error_log
transferlog /var/log/httpd/access_log
rewriteengine on
proxyrequests off
usecanonicalname off
rewriterule ^/(.*)$ http://192.168.11.2/$1 [P,L]
servername download.yourdomain.com
errorlog /var/log/httpd/download/error_log
transferlog /var/log/httpd/download/access_log
rewriteengine on
proxyrequests off
usecanonicalname off
rewriterule ^/(.*)$ http://192.168.11.2/$1 [P,L]
注:设置防火墙上的DNS,让download.yourdomain.comwww.yourdomain.com都指向
防火墙的外部网卡地址。www.yourdomain.com防问你的公司主页, 用
http://download.yourdomain.com/pub/...参募略厍?/a>
你需要在内部网段的apache主机上建立目录/var/log/httpd/download/目录,否则会
出错。另外,你也可以设置防火墙主机上的/home/httpd/html/index.html的属性为
750

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Concurrency testing and debugging Concurrency testing and debugging in Java concurrent programming are crucial and the following techniques are available: Concurrency testing: Unit testing: Isolate and test a single concurrent task. Integration testing: testing the interaction between multiple concurrent tasks. Load testing: Evaluate an application's performance and scalability under heavy load. Concurrency Debugging: Breakpoints: Pause thread execution and inspect variables or execute code. Logging: Record thread events and status. Stack trace: Identify the source of the exception. Visualization tools: Monitor thread activity and resource usage.

To add a server to Eclipse, follow these steps: Create a server runtime environment Configure the server Create a server instance Select the server runtime environment Configure the server instance Start the server deployment project

1. Background of the Construction of 58 Portraits Platform First of all, I would like to share with you the background of the construction of the 58 Portrait Platform. 1. The traditional thinking of the traditional profiling platform is no longer enough. Building a user profiling platform relies on data warehouse modeling capabilities to integrate data from multiple business lines to build accurate user portraits; it also requires data mining to understand user behavior, interests and needs, and provide algorithms. side capabilities; finally, it also needs to have data platform capabilities to efficiently store, query and share user profile data and provide profile services. The main difference between a self-built business profiling platform and a middle-office profiling platform is that the self-built profiling platform serves a single business line and can be customized on demand; the mid-office platform serves multiple business lines, has complex modeling, and provides more general capabilities. 2.58 User portraits of the background of Zhongtai portrait construction

To successfully deploy and maintain a PHP website, you need to perform the following steps: Select a web server (such as Apache or Nginx) Install PHP Create a database and connect PHP Upload code to the server Set up domain name and DNS Monitoring website maintenance steps include updating PHP and web servers, and backing up the website , monitor error logs and update content.

According to news from this website on July 23, ASUS has launched a variety of server and workstation-level products powered by AMD EPYC 4004 series processors. Note from this site: AMD launched the AM5 platform and Zen4 architecture EPYC 4004 series processors in May, offering up to 16-core 3DV-Cache specifications. ASUSProER100AB6 server ASUSProER100AB6 is a 1U rack server product equipped with EPYC Xiaolong 4004 series processor, suitable for the needs of IDC and small and medium-sized enterprises. ASUSExpertCenterProET500AB6 workstation ASUSExpertCenterProET500AB6 is a

How to Implement PHP Security Best Practices PHP is one of the most popular backend web programming languages used for creating dynamic and interactive websites. However, PHP code can be vulnerable to various security vulnerabilities. Implementing security best practices is critical to protecting your web applications from these threats. Input validation Input validation is a critical first step in validating user input and preventing malicious input such as SQL injection. PHP provides a variety of input validation functions, such as filter_var() and preg_match(). Example: $username=filter_var($_POST['username'],FILTER_SANIT

KubernetesOperator simplifies PHP cloud deployment by following these steps: Install PHPOperator to interact with the Kubernetes cluster. Deploy the PHP application, declare the image and port. Manage the application using commands such as getting, describing, and viewing logs.

Using light to train neural networks, Tsinghua University results were recently published in Nature! What should I do if I cannot apply the backpropagation algorithm? They proposed a Fully Forward Mode (FFM) training method that directly performs the training process in the physical optical system, overcoming the limitations of traditional digital computer simulations. To put it simply, it used to be necessary to model the physical system in detail and then simulate these models on a computer to train the network. The FFM method eliminates the modeling process and allows the system to directly use experimental data for learning and optimization. This also means that training no longer needs to check each layer from back to front (backpropagation), but can directly update the parameters of the network from front to back. To use an analogy, like a puzzle, backpropagation
