Articles of apache 2.4

Fail2Ban电子邮件不显示从Apache日志文件提取

我最近在服务器上首次安装了Debian Jessie。 “显而易见”的失败早在这个过程中就已经build立起来了。 这是禁止IP地址,并发送给我的电子邮件好,但基于Apache的不包含任何相关日志文件的摘录。 例如,基于SSH的。 Apache报告示例: 嗨, 之后,IP 193.201.227.112刚刚被Fail2Ban禁止 5次对apache-xmlrpc的尝试。 这里是更多的关于193.201.227.112的信息。 (关于它的信息被删除) 包含IP的行:193.201.227.112位于/home/*/logs/*access.log 问候, 的fail2ban SSH报告示例: 嗨, 之后,Fail2Ban刚刚禁止IP 184.173.26.138 3次反对ssh。 这里是详细的关于184.173.26.138的信息。 (关于它的信息被删除) 在/var/log/auth.log中包含IP:184.173.26.138的行 11月5日08:21:38例如sshd [20158]:无效的用户密码从184.173.26.138端口51131失败的密码ssh2 11月5日08:21:38例子sshd [20158]:错误:收到从184.173.26.138断开连接:3:com.jcraft.jsch.JSchException:身份validation失败[preauth] 问候, 的fail2ban /etc/fail2ban/jail.local解压: action =%(action_mwl)s #JAILS [SSH] enabled = true maxretry = 3 (..) [Apache的XMLRPC] enabled = true 端口= http,https action =%(action_mwl)s filter = apache-xmlrpc logpath = /home/*/logs/*access.log […]

我如何降低防伪安全严重性?

实际上模块阻止“通知”级别的呼叫。 我怎样才能降低严重程度并把它带到“警告”?

如何允许Apache PUT方法到目录

我想启用Apache 2.4.7允许PUT到特定的目录。 在PUT请求之后,下面的configuration给出访问日志中的405错误代码。 <VirtualHost *:80> DocumentRoot /var/www/default CustomLog /var/log/apache2/access_log common <Directory /var/www/default/put> <Limit PUT> Order Allow,Deny Allow from all </Limit> </Directory> </VirtualHost>

在ubuntu中使用apache2托piperedmine服务器

我试图在Ubuntu机器上使用apache运行redmine + gitolite服务器。 我按照以下服务器configuration文件中的说明进行操作: <VirtualHost *:80> ServerName redmine.xyz.com ServerAdmin someone@somewhere DocumentRoot /var/www/ PassengerUserSwitching on RewriteEngine On RewriteRule ^/?$ /redmine [R] <Directory /var/www/redmine> RailsBaseURI /redmine PassengerResolveSymlinksInDocumentRoot on PassengerUser redmine PassengerGroup redmine </Directory> LogLevel info ErrorLog ${APACHE_LOG_DIR}/error-redmine.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> 现在,当我访问网站时,以下内容将被logging在默认的error.log文件中: [ 2015-11-07 12:44:45.7366 1568/7f9da7df9780 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.1562/generation-0/request [ 2015-11-07 12:44:45.7422 1574/7faddd156780 […]

使用Ubuntu Server 14.04作为web开发者

我的networking中安装了Ubuntu Server 14.04,专门用于开发网站(PHP,Laravel)。 网站位于/var/www/domain.ext下的自己的目录中,开发期间可以在我的客户的开发过程中访问(例如http://domain.mydoman.com )。 我使用Windows机器开发网站,并通过在服务器上使用Samba(在我的专用networking中共享/ var / www)保存网站文件。 / var / www目录recursion设置为nobody:nogroup。 我pipe理在terminal以普通用户身份login的服务器网站(使用Composer,Bower,Artisan等) 我遇到的简单问题是: 当使用Artisan,Composer,Bower时,我必须使用sudo(Bower sudo / allow-root)来获得写权限。 这会导致权利和所有权方面的问题。 我再次成为普通用户时,无法find全局安装的软件包(和添加path)(它们是由root创build和拥有的)。 在使用这些软件包之后,我必须将所有这些软件包的所有权转交给nobody:nogroup。 我知道,这一切都与权利和所有权有关,并且使用任何人都不是:nogroup不是正确的方法。 Apache2应该是www-data:www-data。 在所有教程中,我发现他们谈论的是专用的networking服务器。 我很害怕篡改服务器,因为尽pipe存在这些问题,目前正在使用和开发中。 在这种情况下,使用Samba的专用Ubuntu Server 14.04的正确设置是什么?

haproxy匿名前端,与NTLM授权的后端

需要提供一个匿名只读访问svn存储库 AFAIK,haproxy不能自己在后台validation。 haproxy有一个基本authentication的工作configuration。 如何将其迁移到NTLM? 主要的问题是我们不能简单地添加一个静态头,因为质询 – 响应机制。 frontend svn_f bind *:8000 mode http default_backend svn_b acl valid_method method GET HEAD OPTIONS PROPFIND REPORT acl valid_path path_beg /svn/myrepo http-request deny unless valid_method valid_path backend svn_b reqadd Authorization:\ Basic\ xxxxxxxxxxxxxxxxxxxx server svn_server 192.168.2.1:443 ssl verify none 也许Apache可以做到这一点? 试过这个,但它不起作用: SSLProxyEngine on <VirtualHost *:8000> KeepAlive on ProxyPass / https://user:[email protected]/ […]

Gitlab 8.0.3与Apache2 / Nginx

背景 Ubuntu 15.10 Apache / 2.4.10(Ubuntu) 模块相关性全部启用: mod_rewrite的 mod_proxy的 mod_proxy_http GitLab社区版8.0.3 GitLab docroot:/ opt / gitlab / embedded / service / gitlab-rails / public 我以这种方式安装GitLab: https ://about.gitlab.com/downloads/#ubuntu1404 问题 在我的服务器上,我有一个运行Apache2(exemple-site.com)的网站。 我有GitLab与捆绑的nginx(exemple-gitlab.com) 我有1个服务器,1个IP和多个FQDN。 像这样,我所有的域名都指向GitLab。 所以exemple-gitlab.com指向GitLab,但exemple-site.com也指向GitLab,也指向其他所有FQDN。 解决方法 我想我必须(而且我试过): 禁用捆绑的nginx并configurationapache2的gitlab(很难做到这一点) 将绑定的nginxconfiguration为apache2的反向代理(很难做到) MAJ:事实上问题是Apache和捆绑的nginx运行在同一个IP上,并且有相同的端口(80)。 而且我不想在81端口上运行一个网站,只有80端口。 我更喜欢为我的所有PHP网站使用apache2,我不介意gitlab是否使用apache2或捆绑的nginx,我只需要使用我的每个网站的所有FQDN,而不是所有的FQDN redirectinf到gitlab。 理解 我不明白如何omnibus或铁路或反向代理工作。 我试过在/etc/gitlab/gitlab.rb禁用捆绑的nginx nginx['enable'] = false # For GitLab CI, use the following: ci_nginx['enable'] […]

权限问题:为什么用户在我的第二个php-fpm池中不需要?

我使用php-fpm自定义编译的Apache 2.4.17运行FreeBSD 10.2。 默认池( [www] ,几乎是一个股票php-fpm设置)在用户/组nobody / nobody 。 Apache在用户/组daemon / daemon 。 它可以很好地连接到一个插槽,有几个不同的站点都运行在库存池中。 他们是低优先级的网站使用PHP的东西,如显示时间。 从长远来看,我想制定一些更好的特权分离。 我在用户rcuser ,group rcuser (基本上是一个普通的FreeBSD shell帐户)拥有的单独的虚拟主机上创build了一个roundcube安装池。 根据习惯,我将networking虚拟主机放在/usr/vhosts/ ,所以这个网站会通过/usr/vhosts/webmail/htdocs/存储到/usr/vhosts/webmail/htdocs/ 。 整个webmail树属于用户和组rcuser。 这个树中的目录都有750个,文件有640个权限。 游泳池看起来像这样: [rcuser] user = rcuser group = rcuser listen = /var/run/php5-fpm-rcuser.sock listen.owner = rcuser listen.group = rcuser listen.mode = 0666 pm = dynamic pm.max_children = 5 pm.min_spare_servers = 1 […]

Apache对iis重写规则

我正在尝试将Apache的网站移动到iis 8.5 一切正常,但1规则failes我的网站正常运行 RewriteCond %{REQUEST_URI} !\.(js|css|jpg|jpeg|gif|png)$ [or] RewriteCond %{REQUEST_URI} apple-touch-icon\.png$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [L,QSA] 有人可以把它翻译成IIS重写? 我find了一些例子来做到这一点 <rule name="Webasyst Controller" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> <add input="{URL}" pattern="!\.(eot|ttf|woff|js|css|jpg|jpeg|gif|png)$" negate="true" /> <add input="{URL}" pattern="apple-touch-icon\.png$" negate="true" /> </conditions> <action type="Rewrite" […]

CGI警告中的随机换行写入到Apache错误日志中

由于将服务器从Debian 7.8升级到8.2(64位),Apache升级(到2.4.10)引入了一个非常奇怪的错误:error_log中的随机换行符。 例: [Mon Nov 16 13:29:54.388526 2015] [cgi:error] [pid 9122] [client xx.xx.xx.xx:1865] AH01215: (Fred, Test) Warning: foo.cgi/Foo.pm::foo():115 "Argument "test" isn't numeric i, referer: http://… [Mon Nov 16 13:29:54.390770 2015] [cgi:error] [pid 9122] [client xx.xx.xx.xx:1865] AH01215: n numeric eq (==)" [GET http://…], referer: http://… 在这里,CGI警告已经被分解为“in”这个词。 添加换行符的行内的位置是随机的,并将效果应用于随机行。 看到连续出现同一错误的几个实例(例如循环内发生的错误)是非常正常的,只有其中一行受随机行中断影响。 通过“说STDERR sprintf(…)”的方式将文本写入错误日志,这完全没有发生在以前版本的Debian / Apache / Perl(目前是Apache 2.4和Perl 5.20.2)中。 […]