Articles of httpd.conf

dynamic确定htpasswd文件

有什么办法来dynamic确定在运行时使用哪个htpasswd文件? 例如,在VirtualHost上下文中的以下(不起作用,只是一个例子): RewriteEngine on RewriteMap htpasswdfiles txt:/srv/htpasswdfiles/htpasswdfiles.map RewriteCond %{HTTP_HOST} ^(.*)$ RewriteRule .* – [E=PASSWD_FILE:${htpasswdfiles:%1},L] <Directory /some/path> AuthType Basic AuthName "Restricted Access" AuthUserFile $PASSWD_FILE Require valid-user </Directory> 我知道上面的例子不起作用,但我不知道是否有不同的方式来使用像这样的环境variables…如果不是,我不知道是否有任何其他方法来selecthtpasswd文件在运行时dynamic。 htpasswdfiles.map将是一个包含左侧域名和右侧相应htpasswd文件path的地图。

通过https上的IP地址访问站点时ssl_error_bad_cert_domain

我终于从一个可信任的CAvalidation了我的证书。 现在,我编辑了我的etc/httpd/conf.d/ssl.conf来find我的新证书。 我已经在我的etc/httpd/conf/httpd.conf包含了ssl.conf。 我已经安装了我的虚拟主机。 ServerName www.myhost.com.ph:80 NameVirtualHost *:443 <VirtualHost *:443> ServerName www.myhost.com.ph DocumentRoot /home/host/public ServerAlias myhost.com.ph myhost.net DirectoryIndex index.html index.php <Directory "/home/host/public"> AllowOverride FileInfo Limit Options Indexes Allow from all Options Indexes FollowSymLinks MultiViews </Directory> <Files ~ "^\.ht"> Order allow,deny Deny from all </Files> </VirtualHost> 这里是我的ssl.conf文件: LoadModule ssl_module modules/mod_ssl.so Listen 443 <VirtualHost _default_:443> ServerName www.myhost.com.ph […]

在CentOS 6.3上安装distcache

我试图重新构build我们的服务器基于CentOS 6.3,我似乎无法finddistcache rpm。 我在我的5.8 CentOS上有: [root@server]# yum list distcache Loaded plugins: fastestmirror, priorities Loading mirror speeds from cached hostfile * base: mirror.atlanticmetro.net Installed Packages distcache.i386 1.4.5-14.1 installed [root@server]# rpm -qi distcache Name : distcache Relocations: (not relocatable) Version : 1.4.5 Vendor: CentOS Release : 14.1 Build Date: Sat 06 Jan 2007 07:02:14 AM GMT Install […]

Apache LimitExcept GET到IP地址,但拒绝其他IP的所有方法

在使用Apache的虚拟主机configuration中获取Order指令时遇到了一些麻烦。 我有一些IP地址,我想完全拒绝访问整个虚拟主机。 这些以前被标记为恶意。 除了我们的内部IP范围之外,我还想拒绝除GET和HEAD之外的所有请求。 我在第一个Directory指令中遇到了问题,并想出如何使用Order指令进行排列。 这是我到目前为止,它似乎没有工作,所以我想得到一些build议,如何最好的命令这个块… NameVirtualHost *:80 <VirtualHost *:80> ServerName www.test.com ServerAlias test.com DocumentRoot /var/www/html/www.test.com <Directory /var/www/html/www.test.com> Options +FollowSymLinks Order Deny,Allow # Deny suspect IPs previously flagged Deny from 111.111.111.111 Deny from 222.222.222.222 Deny from 333.333.333.333 # But only internal IPs can POST <LimitExcept GET HEAD> Deny from all Allow from 10.10.0.0/22 </LimitExcept> Allow […]

Apache HTTPD“sites / mods-enabled / available”configuration

我最近从默认的Ubuntu / Debian apache2包移动到官方tarball安装Apache HTTPD。 我有一切工作正常,但我想知道是否有任何简单的方法来更改使用mods-*和mods-*文件夹结构来启用和禁用虚拟主机/ mods,而不是在httpd.conf手动指定它们。 有没有这样的脚本或configuration文件? 谢谢。

虚拟主机只能用于2/4目录?

我正在运行CentOS 6.2,并且在httpd.conf中有以下内容: <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/example.co.uk/public ServerName example.co.uk ErrorLog logs/example.co.uk-error_log CustomLog logs/example.co.uk-access_log common </VirtualHost> #user1 directory <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /home/user1/public_html ServerName user1.example.co.uk ServerAlias www.example.co.uk ErrorLog logs/error_log CustomLog logs/user1-access_log common </VirtualHost> #user2 directory <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /home/user2/public_html ServerName user2.example.co.uk ServerAlias www.example.co.uk ErrorLog logs/error_log CustomLog logs/user2-access_log common </VirtualHost> #user3 directory <VirtualHost […]

NameVirtualHosts和IP地址的configuration

所以我有site1.com和192.168.1.100 如果我使用IP地址Apache不适用于site1.com,如果我使用site1.com IP地址不起作用。 思考? 我可以得到吗? 我需要访问IP和site1.com,并让他们指向不同的目录(不同的项目) Site1.com #NameVirtualHost site1.com:80 <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /home/www/site1.com/current/web ServerName site1.com ServerAlias site1.com <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/site1.com/current/web/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/app_error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. […]

如何ProxyPass和ProxyPass反向与一个url有点?

我正在使用ProxyPass和ProxyPassReverse。 在简单的情况下,它的wouks很棒,但是因为我有一个以“.jpg”结尾的URL,它只是错过了它。 例如 :- 考虑下面的声明: 我想要传递的请求URL是https://xxxxxx/photos/2222.jpg 。 我在httpd.conf中写下面提到的语句 ProxyPass /photos/ http://10.40.4.170:80/PrimeCoreServices/api/users/photos/ ProxyPassReverse /photos/ http://10.40.4.170:80/PrimeCoreServices/api/users/photos/ 现在在我服务器的另一边,我收到请求只有像/photos/2222的.jpg部分是完全省略,没有它,我不能做任何事情。 请帮我解决这个问题。 Apache Web服务器不允许我用URLparsing这个.jpg 。 我其实想知道如何编写相同的configuration。

ProxyHTMLURLMapreplace两次给定的URL

解释标题,我已经把这个(这是唯一的htmlUrlMap)在我的conf: ProxyHTMLURLMap / /rp/ticket/ 这在我的HTML: <script type="text/javascript" src="/js/jquery-1.8.3.min.js"></script> 预期的是: <script type="text/javascript" src="/rp/ticket/js/jquery-1.8.3.min.js"></script> 实际产量: <script type="text/javascript" src="/rp/ticket/rp/ticket/js/jquery-1.8.3.min.js"></script> 这是奇怪的…,更多的configuration: <Location /rp/ticket/> ProxyHTMLEnable On ProxyHTMLBufSize 102400 ProxyHTMLExtended On ProxyHTMLStripComments Off ProxyHTMLDocType "<!DOCTYPE html>" ProxyHTMLMeta Off ProxyHTMLCharsetOut * ProxyHTMLURLMap / /rp/ticket/ ProxyPass http://ticket.domain.com/ ProxyPassReverse http://domain.com/ SetOutputFilter INFLATE;proxy-html;DEFLATE RequestHeader unset Accept-Encoding </Location> 我最好的猜测是<location>是问题的原因,它被附加到我的自定义地址,但在改变地址到不同的地方(“/ rp / test”)而不是获得 src="/rp/ticket/rp/test" 我有 src="/rp/test/rp/test" 所以这不是问题 […]

如何redirect从https到http

我有一个网站,不需要https。 我们根本不收集任何信息,也没有任何forms。 这是因为我们没有设置SSL证书。 但是,当我去https://example.com它到我的服务器上有另一个网站,有一个SSL证书。 我们正在运行一个LAMP堆栈,CentOS6 / Apache 2.2。 有没有办法将所有https请求redirect到我的网站回http?