Articles of apache 2.4

如何将Apache VirtualHost映射到OpenVPNnetworking上的IP地址?

我正在尝试使Apache VirtualHost只能在VPN上访问(具体的OpenVPN)。 让虚拟主机监听我们使用的VPNnetworking; <VirtualHost 10.8.0.1:80> #Directives… </VirtualHost> 假设10.8.0.1是VPN接口的IP地址。 我想知道的是,如何在VPNnetworking上为上面创build的VirtualHost分配一个IP地址。 有什么想法吗?

在Apache 2.4.10上禁止403

我有一个Docker容器,我想在与主机共享的卷中开发Drupal。 然而,Apache只是给我403错误,无论我设置的Apacheconfiguration文件。 我试图从/ var / www / drupal运行drupal。 目录/ var / www在apache2.conf中设置为要求所有授予,似乎是正确的configuration(例如在这篇文章中https://askubuntu.com/questions/561201/apache-2-4-10-giving- 403 -forbidden-issue-on-Ubuntu-14-04等等)。 在/etc/apache2/sites-available/000-default.conf中设置了根目录。 我不知道为什么它以这种方式分离 – 我已经尝试将所有相关的configuration移动到000-default.conf文件,但它有相同的403消息。 我以为这是Docker卷开始的问题,因为这个目录是与主机共享的。 但我运行su -s /bin/bash www-data来testingterminal中的权限为www-data,我可以查看和编辑php文件,我认为这是apache的问题,而不是docker。 但是,这可能是因为我没有正确使用Docker – 我几乎是Docker的noob。 最令人费解的是我有它的工作,然后重新启动容器,并开始再次得到错误。 所以我创build了我的docker集装箱 docker run -d -p 8081:80 -p 8023:22 -p 63307:3306 -v `pwd`/drupal:/var/www/drupal wadmiraal/drupal:8 在/ var / www / drupal(docker shared volume)中运行ls -l作为www-data。 www-data@5f2c7723f1cc:~/drupal$ ls -l total 308 -rwxrwxrwx […]

apache 2.4 / PHP 5.6全新安装后无法加载PHP文件?

我已经在RHEL上安装并configuration了Apache 2.4,同时还安装了PHP 5.6。 [root@host ~]# httpd -v Server version: Apache/2.4.6 Server built: Feb 3 2016 08:23:38 [root@host ~]# php -v PHP 5.6.5 (cli) (built: May 16 2016 12:37:09) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies 以下是安装在服务器上的相关软件包。 [root@host ~]# […]

Apache反向代理 – 多个端口上的TLS / SSL,用于将Jenkins的Docker镜像推送到Nexus仓库

在一个简短的描述中的问题: 我正在运行一个Jenkins CI服务器。 一切工作正常。 我也运行一个Nexus资源库pipe理器。 在这里,一切正常,直到现在。 在Jenkins服务器上,我们使用pipe道脚本(也就是Git checkout,代码分析,构build服务等)来构build不同的REST服务。 最终的服务部署在Docker容器中。 工程也很好。 现在,当我们运行Nexus版本库pipe理器版本3时,我们可以使用它作为Docker托pipe存储库。 在Nexus的设置中,我可以build立一个简单的在线仓库,其中包含仓库URL和特定的端口连接器。 该url如下所示: https://nexus.domain.tld/repository/my-docker-images/ 端口连接器提供两个ovbious选项:HTTP和HTTPS。 所以我激活了两个连接器(只需设置一个checkbox),我把端口5000 HTTP和HTTPS 5001。 现在的问题是: 在Jenkins服务器上构buildDocker镜像时,一切正常,直到最终推送到Nexus服务器。 日志输出是: The push refers to a repository [nexus.domain.tld:5001/some-test-repo/project-name] Get https://nexus.domain.tld:5001/v1/_ping: dial tcp 123.123.123.123:5001: getsockopt: connection refused 所以,123.123.123.123代表真正的IP地址。 我search了几个小时,我想这可以跟踪到Docker客户端或Nexus服务器的反向代理configuration的问题。 这里Get https://nexus.domain.tld:5001/v1/_ping似乎是来自Nexus repo服务器的连接testing。 我已经使用TLS / SSL运行Nexus服务器,并且没有任何问题。 Nexus服务器运行在configuration了TLS / SSL的Apache反向代理之后。 现在,这是我的Apache vhostconfiguration: <VirtualHost *:80> ServerName nexus.domain.tld Redirect permanent […]

如何限制使用Apache访问特定的URI

我有Apache运行在一个Web应用程序的基本URL将是http://myapp:8080/myApp/ ,代理http://example.com/ 。 该URL后面有几个资源应该被IP限制。 我在网上find的解决scheme的问题是,它们似乎是任何以下URI的一揽子限制。 例如,我有: http://example.com/search : http://example.com/search和http://example.com/secret等 我希望每个人都能够访问/search URI,但只允许访问所有其他的URIpath到指定的IP。 我面临的问题是试图拒绝访问其他 URI,无论它们是什么。

拒绝目录,但允许并加载DirectoryIndex而不指定URL中的文件名

我读过一个问题的答案,解释“ 如何拒绝目录,但允许一个文件在该dirctory ”。 这个问题是,Apache不会加载DirectoryIndex,不得不手动在url栏上写名字。 我怎样才能告诉Apache加载索引文件,而不需要在URL中指定名称? 我有加载域/子域(虚拟主机)文件的文件中的所有拒绝: # conf/vhosts/example.com/domain.conf <Directory "/srv/http/example.com"> Require all denied </Directory> IncludeOptional conf/vhosts/example.com/sites/*.dom 以及www网站的虚拟主机文件: # conf/vhosts/example.com/sites/www.dom <VirtualHost *:80> ServerName www.example.com #Redirect permanent / https://www.example.com/ DocumentRoot "/srv/http/example.com/www" <Directory "/srv/http/example.com/www"> <Files "index.php"> <RequireAll> Require all granted Require not env blockAccess </RequireAll> <IfModule dir_module> DirectoryIndex index.php </IfModule> SetHandler "proxy:unix:/run/php-fpm/www.example.sock|fcgi://localhost/" </Files> <IfModule mod_rewrite.c> RewriteEngine On RewriteRule […]

抛光gzip错误的清漆

运行时出现此错误: varnishlog -b -q'FetchError' – ObjHeader X-Frame-Options: SAMEORIGIN – ObjHeader Vary: Accept-Encoding – ObjHeader Content-Type: text/html; charset=UTF-8 – ObjHeader Content-Language: uk – ObjHeader Content-Encoding: gzip – Fetch_Body 4 eof – – Gzip Gunzip error: -3 (invalid code lengths set) – FetchError Invalid Gzip data: invalid code lengths set – Gzip GFE 0 20 80 80 […]

在Apache 2.4.7上设置通配符子域反向代理

现在运行一个项目,需要为特定页面提供所有匹配的子域名。 这必须作为(反向?)代理,而不是作为redirect。 概观 几个(几十个甚至几十万个)用户将为他们设置一个URL,如下所示: (some_user_name).example.tld 例如: john_smith_123.example.tld 。 环境 Ubuntu 14.04 Apache 2.4.7 HTML / CSS / JS 没有服务器端脚本(允许) 要求 访问(some_user_name).example.tld ,所有用户都必须看到位于example.tld/directory/sub-directory/的相同内容(具有parsing子域值的代码的Web表单)。 在该path的子目录中,我们有一个index.html (应该默认提供)和一个thank-you.html文件, thank-you.html文件应该在提交表单(确认页面)时提供。 在index.html页面上,我们有js代码来parsing出子域的值,并做魔术来显示为用户个性化的一些内容。 只要子地址存在于地址栏中,它就会工作。 我们也有一些js必须能够通过引用位于根域的资源(例如example.tld/assets/js/main.js )来加载资源。 在表单提交后,我们希望在地址栏(some_user_name).example.tld/thank-you中显示用户这个地址,它显示来自example.tld/directory/sub-directory/thank-you.html 所以,这是对的: 用户转到(some_user_name).example.tld – >用户可以看到来自example.tld/directory/sub-directory/index.html页面内容,而地址栏仍然显示(some_user_name).example.tld 然后用户提交表单(推测),并看到(some_user_name).example.tld/thank-you 这是错误的: (some_user_name).example.tld – >redirect到example.tld / directory / sub-directory / index.html(显示在地址栏中)。 解决scheme? 我们一直在挖掘和尝试的答案(包括search和尝试几个堆栈溢出的答案),但相当符合要求,我们处于僵局。 以下是我们尝试的一些解决scheme: https://stackoverflow.com/questions/1187289/setting-up-wildcard-subdomain-with-reverse-proxy-on-apache-2-2-3 如何在Apache2的VirtualDocumentRoot中configuration和组合通配符域和子域? 其他几个(外部堆栈溢出)像Apache文档和其他网站。 到目前为止,我们遇到了一些在文档化解决scheme(以及我们自己的尝试)中似乎很常见的问题。 我们尝试了几个(实际上,几个实现的2-3个不同的变体)。 所以,为了保持这一点,这里是最后两次尝试: 这里是最接近的我们来了: […]

使用Location proxyPass将api调用从子域redirect到主域

我想将我的api调用从子域redirect到主域。 我的API服务器是在example.com。 请求url是http://foo.example.com/api?service=work&action=all_work ,但我的文件系统调用应该通过。 <VirtualHost *:80> ServerName example.com ServerAlias foo.example.com RewriteEngine On <Proxy *> Order Allow,Deny Allow from all </Proxy> <Location /api> ProxyPass http://othersite.com/api retry=0 SetOutputFilter DEFLATE </Location> DocumentRoot /var/www/example RewriteCond %{HTTP_HOST} ^(foo.example.com)$ [NC] RewriteCond %{REQUEST_URI} =/ RewriteRule (.*) /var/www/example/index.html [L] RewriteCond %{HTTP_HOST} ^(foo.example.com)$ [NC] RewriteCond %{REQUEST_URI} !=/ RewriteRule (.*) /var/www/example/$1 [L] </VirtualHost> 但是我正在浏览器上获得404。

Apachenetworking服务器网卡IPconfiguration

我们有一个Apache服务器的Web服务器和一个SSH服务器。 用户通过ssh服务器login访问apache web服务器上的资源。 目前,networking服务器上有一个网卡,其上configuration了2个IP。 一个IP监听来自sshlogin服务器的sshstream量,另一个监控networking上的网页。 我们正在考虑只使用一个IP来提供这两种function,但是我们不确定使用一个IP从sshlogin服务器和相同的IP服务网页上监听sshstream量会有什么影响。 如果我们要做这个改变,会有什么样的想法呢? 请记住,所有的stream量都通过负载平衡器。