Articles of apache 2.2

自定义Nagios脚本不能触发

最近我们遇到了很多垃圾邮件攻击我们的服务器,导致apache崩溃。 要解决这个问题,我们已经安装了nagios来通知我们/运行一些重启命令,如果出现问题。 通知function正常,但重新启动脚本不会踢。我们采取了以下步骤: 创build我们的重启脚本位于: /usr/share/nagios3/plugins/eventhandlers/restart_apache testing并通过./restart_apache CRITICAL SOFT 3 – 可以确认脚本正常工作 定义了命令: /etc/nagios3/commands.cfg 定义命令{ command_name重新启动apache command_line / usr / local / nagios / libexec / eventhandlers / restart_apache $ SERVICESTATE $ $ SERVICESTATETYPE $ $ SERVICEATTEMPT $ } 在当前加载通知运行时应用该命令来触发: /etc/nagios3/conf.d/localhost_nagios2.cfg 定义服务{ 使用通用服务; 要使用的服务模板的名称 host_name localhost service_description当前负载 check_command check_load!5.0!4.0!3.0!10.0!6.0!4.0 event_handler restart-apache } 我们已经设置脚本在执行重新启动时写入文本文件,但没有任何事情发生(并且apache停留) – 所以有些事情是不正确的。 任何方向非常感谢!谢谢

我的Apacheconfiguration有什么问题?

我正在运行一个AWS设置,该设置目前由指向单个EC2实例的ELB组成。 该实例正在运行Ubuntu 12.04.2和Apache 2.22.2。 过去我在服务器上设置了几个子域名。 今天我正在设置另外一个,但是我正在靠墙敲打我的头,试图弄清楚我错过了什么。 我敢肯定,这是我忽视或不太对的一小步。 我的DNSlogging使用Route 53进行设置。我login到AWS控制台并为我的服务器添加了一个新的CNAMElogging。 我们将其称为samael.example.com 。 它看起来像这样: samael.example.com. 3600 IN CNAME web-pool-xxxxxxxxxx.us-east-1.elb.amazonaws.com. 这似乎工作得很好,因为指向我的浏览器sameael.example.com带来了默认的VirtualHost。 所以,我现在要做的就是创build另一个VirtualHostconfiguration文件, 对吧 ? mkdir /http/www/samael.example.com touch /httpd/www/samael.example.com/index.html cd /etc/apache2/sites-available sudo cp dav.example.com samael.example.com sudo sed -i 's/dav.example.com/samael.example.com/g' samael.example.com cd ../sites-enabled sudo ln -s ../sites-available/samael.example.com sudo apachectl restart 那应该是吧 ? 但是当我将浏览器指向samael.example.com ,它仍然指向默认的VirtualHost。 我跳过了什么步骤? cat samael.example.com <VirtualHost *:80> ServerName […]

mod_negotiation和mod_rewrite

我试图configuration一个URLscheme,a)允许“.html”扩展名被省略,b)在某些条件下发送403(禁止)错误。 但是,通过以下设置: Options +MultiViews RewriteRule ^foo/bar$ – [F] 如果我请求/foo/bar我得到一个404(未发现)错误与错误日志中的“无法协商”行。 请求/foo/bar.html 确实起作用,所以我猜测内容协商正在对RewriteRule进行“优先处理”,并且一直在寻找其他的URL,直到find200.事实上,我已经证实通过bar.txt文件和只针对.html文件的RewriteRule进行testing。 那么,有没有办法修改mod_negotiation的行为,只要遇到Forbidden错误就“放弃”? UPDATE 注:看起来好像我可以解决这个问题,通过禁用MultiViews和使用mod_rewrite,而不是例如 RewriteCond %{REQUEST_FILENAME}.html -f RewriteRule !.*\.html$ %{REQUEST_FILENAME}.html [L] 但我猜测效率不高,而且configuration要多得多

HTTPS侦听额外的端口apache / httpd

我在开发服务器上有一个非常简单的configuration,其中web根目录中的所有内容都可以通过http和https获得。 我想添加一个额外的监听端口,例如8443,这样我就可以在443和8443上使用https,但是将Listen 8443添加到我的ssl.conf中却什么也没做。 我看着mod_ssl的手册,但没有得到它的工作。 有人可以引导我在正确的方向吗? 下面是我的ssl.conf。 自签名的证书。 CentOS 6.3与Apache 2.2.15 为什么我的复制configuration随机显示巨大的粗体字体? 启动SSL.conf: LoadModule ssl_module modules/mod_ssl.so # # When we also provide SSL we have to listen to the # the HTTPS port in addition. # Listen 443 ## ## SSL Global Context ## ## All SSL configuration in this context applies both to ## the […]

Arris TG862端口转发问题

我有一个时间在Arris TG862上获得端口转发设置。 我试图转发端口80到我的networking上的一台机器,但我运气完全没有。 这是我的设置: Arris是调制解调器/路由器,DHCP正在运行。 NAT模式是RoutedWithNAT。 现在插入到Arris是另一台也有DHCP运行的路由器; Arris提供192.168.0地址的IP,第二个路由器提供192.168.1地址。 第二个路由器和连接到它的东西不应该担心这个对话(我想),因为我试图转发80的计算机直接连接到Arris。 它的IP地址是192.168.0.2,机器本身是运行WAMP的Windows Server 2008 R2安装。 WAMP启动和运行,因为我可以通过本地主机(DUH)查看它,但我也可以去192.168.1上的一台PC的192.168.0.2和服务器显示页面罚款,所以我知道服务器正在私人networking。 在Arris中,我设置一个“虚拟服务器”(端口转发),并将入站端口范围设置为80-80,提供.0.2作为私有地址,80-80作为私有端口范围。 什么都没发生。 然后我使用了盾牌! 做我的IP端口扫描,并没有检测到任何端口。 于是我把防火墙放在了Arris上,重新运行了Shields Up! 我可以看到一堆港口 大部分人都被closures了。 有趣的是80端口是潜行的,所以我不知道Arris是否在积极阻止80端口或者什么。 尽pipe如此,我试图访问我的内部计算机上的networking服务器,现在防火墙closures,结果相同。 我完全禁用服务器上的防火墙。 没有。 作为最后一个努力,我将入站端口范围15386-15386的端口设置为专有范围80-80,并再次尝试http://xxx.xxx.xxx.xxx:15386 ,结果相同。 我端口扫描15386虽然它确实显示为封闭,不偷偷,但也不公开。 任何人都可以给的帮助将不胜感激!

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. […]

mod_rewrite捕获域和tld

我正在使用mod_write来重写这个 www.variabledomain.variableext 至 http://my.com/variabledomain.variableext 请注意, variabledomain和variableext是真正的variables,所以我不能硬编码它们。 我不是mod_rewrite的专家,但我认为像这样的工作,但事实并非如此。 任何想法,而不是我应该做的。 RewriteRule ^(.*)\.(.*)\.(.*)$ http://my.com/$2\.$3 [R=301,L]

suphp如何禁用LS /

使用suphp,我为每个虚拟主机设置了一个php.ini文件。 在php.ini中我也设置了: open_basedir = /home/site1 PHP脚本运行,但如果我有一个脚本与LS /我可以看到整个根目录。 如何禁用这个孔安全? <VirtualHost *:80> ServerName site1 ServerAlias www.site1.com DirectoryIndex index.html index.htm DocumentRoot /home/site1/ suPHP_Engine on AddHandler x-httpd-php .php .php3 .php4 .php5 suPHP_AddHandler x-httpd-php # THIS READ php.ini suPHP_ConfigPath /home/site1/ <Directory /home/site1/> Options -Includes -Indexes -FollowSymLinks -ExecCGI -MultiViews AllowOverride none Order allow,deny Allow from all </Directory> </VirtualHost>

子域上的SSL

我正在尝试configuration通配符SSL证书以在子域上以及服务器的主域上提供。 为了获得SSL证书的工作,似乎我必须定义主站点的站点可用文件,如: <VirtualHost *:443> 当我尝试使用<VirtualHost someSite.com:443>然后Firefox抱怨: An error occurred during a connection to www.someSite.com. SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long) The page you are trying to view cannot be shown because the authenticity of the received data could not be verified. 谷歌浏览器不太具体: SSL connection error 我可以更改<VirtualHost *:443>以便我可以将sub.someSite.com作为不同的带有SSL的虚拟主机服务? 这是在Ubuntu服务器12.04 […]

Ubuntu的林德服务器404错误与Django的mod_wsgi

我用apache2和mod_wsgiconfiguration了一个linode服务器。 服务器正在运行 wsgi正在运行 postgre正在运行,syncdb成功 我有什么麻烦完成实际上是服务的应用程序.. 我的文件结构: . ├── logfile └── srv ├── logfile └── www └── quickerhub.com ├── admin │ ├── css │ │ ├── base.css │ │ ├── changelists.css │ │ ├── dashboard.css │ │ ├── forms.css │ │ ├── ie.css │ │ ├── login.css │ │ ├── rtl.css │ │ └── widgets.css │ […]