Articles of Apache的2.2

Apache虚拟主机获取www.domain.com,但不是domain.com

我在我的网站有这个可用的apache2虚拟主机文件: <VirtualHost *:80> ServerName domain.com ServerAlias www.domain.com … </VirtualHost> 为什么apache从www.domain.com发送请求到正确的path,但是domain.com被发送到默认的虚拟主机? 更新:domain.com被发送到默认虚拟主机的原因是因为机器的主机名自动发送到默认值。

在.htaccess中声明variables以确定部署环境

我在.htaccess文件中定义了以下规则。 RewriteRule ^/home$ http://someothersite.com/home RewriteRule ^/dir1/dir2/$ http://someothersite.com/dir1/dir2/ 我需要将主机名http://someothersite.com设置为一个.htaccessvariables。 此variables将根据部署环境位置而变化。 有没有可能做到这一点? 我必须要有3个部署环境:build,dev和stage。 对于每个环境,build中的.htaccess文件应该redirect到3个外部站点。 即 构build:.htaccess文件应该redirect到build.someothersite.com dev:.htaccess文件应该redirect到dev.someothersite.com 阶段:.htaccess文件应该redirect到stage.someothersite.com 我不想为三种不同的环境创build3个不同的.htaccess文件,我只想创build一个.htaccess文件,而不用硬编码主机名:build.someothersite.com,dev.someothersite.com,stage.someothersite.com。 我需要这样的东西: RewriteRule ^/home.html =>%{ENV:external_host}/build.html 是否可以在构build,开发或阶段环境中使用某些SetEnv指令在%{ENV:external_host}设置%{ENV:external_host}variables? 例如,该variables将设置如下所示: 在dev中设置SetEnv = dev.someothersite.com, SetEnv = build.someothersite.com SetEnv = stage.someothersite.com分别在舞台上。

我将如何configurationwebsocket服务器与networking服务器一起运行?

对不起,你必须读两遍。 我目前有一个在端口80上侦听的Apache2,以及一个在更高的未注册端口(50214)上运行的自制游戏服务器。 我用JavaScript重写了这个游戏,并计划通过80端口上的websockets发送networking通信,以避开许多公司和大学所采用的防火墙。 我将如何去configuration一个websocket服务器来侦听80上的websocket连接,并解压缩它们并将它们转发到在50214上侦听的游戏服务器,而不会干扰apache? 我应该使用什么websocket服务器实现? 这通常如何完成? 帮助一个noob。 感谢sf。

使用现有的ApacheconfigurationPHP时出错

我收到这个消息: configure: error: Invalid Apache directory – unable to find httpd.h under /usr/lib64/httpd/ 执行以下命令之后: ./configure –with-apache=/usr/lib64/httpd/ 我不知道我已经安装的Apache的顶级DIR在哪里。 我的CentOS 6.5服务器上已经安装了apache服务,使用yum install httpd 。 Apache版本2.2.15-31 PHP版本5.4.25

禁用Apache中的直接IP访问

这是我的httpd.config文件如何禁用直接IP访问? 如果有人input了该网站的IP地址,那么它不应该redirect到默认的域名或本例中的xxx.com网站 <VirtualHost ipaddress:8080> ServerName xxx.com ServerAlias www.xxx.com ServerAdmin [email protected] DocumentRoot /home/admin/web/xxx.com/public_html ScriptAlias /cgi-bin/ /home/admin/web/xxx.com/cgi-bin/ Alias /vstats/ /home/admin/web/xxxcom/stats/ Alias /error/ /home/admin/web/xxx.com/document_errors/ . . . </VirtualHost>

Apache选项问题

httpd -k start -DSSL -DSSL在这里意味着什么?

安装后Nginx无法启动

我尝试安装nginx在我的vps购买下面这个步骤 cd /usr/local/src wget http://nginxcp.com/latest/nginxadmin.tar tar xf nginxadmin.tar cd publicnginx ./nginxinstaller install 最后apache的调整设置检查端口8081工作,但服务器仍然给错误和nginex状态down 。 这是我从ssh重新启动Apache的错误 Restarting nginx daemon: nginxnginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol) already running. 我使用vps centos 5 whm cpanel

apache如何写入error_log&access_log

我正在运行一个干净的Ubuntu服务器,并得到了Apache的工作。 我注意到,apache访问和错误日​​志是由root拥有的: -rw-r—– 1 root adm 10531 Oct 11 00:43 access.log -rw-r—– 1 root adm 58839 Oct 11 00:43 error.log 我只是想知道如果apache实际上只是写入日志,如果它只能由root写入。 它是默认使用系统日志? 谢谢!

为什么我的networking服务器只使用2个内核? (8核可用)

Helo,我的服务器是一个2x四核心,8gb内存,它运行一个中型网站的LAMP(每天打开120页)我安装了munin来监视CPU,这是图: http://img834.imageshack。 us / img834 / 3483 / downloadv.png为什么它只使用8个内核中的2个? 也许这个munin算不上cpu的负载? 有一种方法来强制多任务IP的PHP MySQL的Apache? 我已经使用MPM与Apache。 谢谢西蒙

首先处理哪个文件,index.php,index.htm或index.html?

在Apache服务器中,如果www.abc.com域名有index.php,index.htm和index.html,那么当我在地址栏中inputwww.abc.com时,哪些文件会先被处理? 有没有办法改变顺序? 我知道我们可以在IIS中完成。