Articles of httpd

Apache HTTP返回了隐藏的错误消息

(Apache 2.4 / centOS 7) 我试图启动httpd服务,遵循以下命令: [root@localhost ~]# service httpd start Redirecting to /bin/systemctl start httpd.service Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details. [root@localhost ~]# service httpd status Redirecting to /bin/systemctl status httpd.service httpd.service – The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled) Active: failed (Result: exit-code) since Sat […]

从5.3.3升级到5.6之后,php不能和apache一起工作

我有一个安装了PHP 5.3.3版的bigrock vps。 我最近升级到PHP版本5.6,因为一些PHPfunction不工作。 现在删除旧的PHP和安装5.6版后,我可以从terminal使用PHP,但我的网站上的文件没有被执行,而是正在下载所有的PHP源代码文件。 我认为,Apache不使用新安装的PHP。 为了解决这个问题,我在httpd.conf文件中添加了这一行: LoadModule php5_module "/usr/bin/php" 这个PHPpath,我通过which php命令。 当我添加这条线,并重新启动Apache它给了我一个警告 [warn] module php5_module is already loaded, skipping 我认为我需要正确地告诉Apache新安装的PHP。

ESXi VM中的CentOS 7无法查看端口80请求

我在ESXi虚拟机中运行CentOS 7。 我禁用了iptables和selinux。 我只是试图在这个版本的CentOS 7上运行Apache,我认为它工作正常: [root@am1 etc]# systemctl status httpd.service httpd.service – The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled) Active: active (running) since Mon 2015-12-14 11:17:31 EST; 2h 7min ago Process: 16028 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS) Main PID: 16033 (/usr/sbin/httpd) Status: "Total requests: 3; Current requests/sec: 0; Current traffic: 0 B/sec" CGroup: /system.slice/httpd.service […]

httpd内存使用情况(Apache / 2.4.16(亚马逊))

我正在一个亚马逊linux虚拟机上运行一个Apache服务器(默认configuration,mod_php),只有1G内存。 有两种php应用程序正在运行:内存很重,而不是经常执行(httpd进程的大小每个都是50MB),而内存指针则经常执行。 当我重新启动Apache并查看httpd进程的大小时,它看起来像这样: sudo service httpd restart ps aux | grep 'httpd' | awk '{print $6/1024 " MB";}' 24.7266 MB 14.9805 MB 14.9805 MB 14.9805 MB 14.9805 MB 14.9805 MB 2.00391 MB 当我https://只是一个内存沉重的PHP应用程序(一个Drupal 7安装)相同的命令输出: 24.7266 MB 14.9805 MB 47.0195 MB 18.6133 MB 18.5781 MB 18.582 MB 14.9805 MB 14.9805 MB 14.9805 MB 14.9805 MB 14.9805 […]

优化Apache以提供video

我有我的本地Apache服务器专用于传送video(而不是stream媒体),因此连接到本地(LAN)的用户可以播放video文件,就好像它们是本地的: 在mplayer的linux客户端中: mplayer http://192.168.0.1:1234/movies/mymovie.mkv 在媒体播放器经典HC的Windows客户端: mpc-hc64.exe http://127.0.0.1:1234/movies/mymovie.mkv 我在主机(127.0.0.1)上testing,排除networking延迟的任何责任。 它工作正常,但在寻找电影位置时,在回放开始时需要一点时间,就好像是在缓冲。 (我的意思是,如果我在127.0.0.1上是什么缓冲区?) 我的问题是,我应该添加到httpd.conf哪些参数来优化这种“上传”,所以播放不会冻结时寻求? testing服务器是运行Windows 10 x64 + Apache 2.4的i7

将HTTPredirect到HTTPS和canonical / aliases协同工作

我有两个规则同时工作的问题,我的conf文件 <VirtualHost *:80> ServerName mytest.domain.com ServerAlias www.mytest.domain.com mytest2.domain.com www.mytest2.domain.com RewriteEngine on RewriteRule ^ https://mytest.domain.com%{REQUEST_URI} [R=301,L] </VirtualHost> <VirtualHost *:443> ServerName redirects.for.mytest.domain.com ServerAlias www.mytest.domain.com mytest2.domain.com www.mytest2.domain.com RewriteEngine On RewriteRule ^/(.*) https://mytest.domain.com/$1 [L,R] </VirtualHost> <VirtualHost *:443> ServerName mytest.domain.com DocumentRoot /var/www/mytest/ SSLEngine on SSLCertificateFile my.crt SSLCertificateChainFile my.chain SSLCertificateKeyFile my.key </VirtualHost> 我正在努力实现的是: 来自HTTP的所有内容都被redirect到HTTPS 所有别名和www域必须redirect到其“主体”版本 我可以做一个或另一个,但混合创build一个无限的redirect循环,什么是正确的方式?

httpd每xx秒处理cpu达到100%+

我的第一篇文章,不幸的是由于我的专用(Linux Centos 6)服务器上运行一些个人和一个商业网站的问题。 Server version: Apache/2.4.18 (Unix) Server built: Mar 7 2016 20:22:35 Cpanel::Easy::Apache v3.32.10 rev9999 root@server213-171-196-40 [~]# free total used free shared buffers cached Mem: 16212880 15939912 272968 1939060 65928 13730952 -/+ buffers/cache: 2143032 14069848 Swap: 4194296 1477616 2716680 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND [b] 2900 nobody […]

用&amp; amp; amp; apache来重写apache中的URL 在查询中

我正在尝试构build一个重写条件和规则,用&amp; 在查询string中,而不仅仅是&。 当URL以XML格式传输到客户端时,会发生这种情况,因为编码无效。 长期来说,这将是固定的,但短期来说,如果我可以把一个重写规则,将停止404错误。 示例URL是 https://myserver.com/getpdf/download?md5=53d64aee8107d8f8af0c&id=163464591&tz=GMT 到目前为止我已经得到了这个 RewriteCond %{REQUEST_URI} ^/getpdf/download* RewriteRule ^/([^&]+)(&amp;)(.*)$ /$1&$2 [N] 基于serverfault上的其他职位(例如mod-rewrite:replaceurl中的一些字符 ) 我打开了重写日志,这就是我所看到的 10.0.0.64 – – [12/Mar/2016:06:42:52 +0000] [myserver.com/sid#7f24e32103e8][rid#7f24e3379870/initial] (2) init rewrite engine with requested uri /getpdf/download 10.0.0.64 – – [12/Mar/2016:06:42:52 +0000] [myserver.com/sid#7f24e32103e8][rid#7f24e3379870/initial] (3) applying pattern '^(md5)([^&]+)(&amp;)(.*)$' to uri '/getpdf/download' 10.0.0.64 – – [12/Mar/2016:06:42:52 +0000] [myserver.com/sid#7f24e32103e8][rid#7f24e3379870/initial] (1) pass through /getpdf/download 任何关于如何正确地形成重写小册子的指导都是很好的。

httpd不适用于mod_fcgid

基于这里的答案,centos没有mod_fastcgi rpm,但是mod_fcgid可以用于大多数类似的目的。 https://stackoverflow.com/questions/12005137/centos-mod-fastcgi 所以我在centos7上用yum安装mod_fcgid,然后join LoadModule fastcgi_module modules/mod_fcgid.so 代替 LoadModule fastcgi_module modules/mod_fastcgi.so 进入httpd.conf 和/usr/lib64/httpd/modules/mod_fcgid.so确实存在。 然而,当运行service httpd start ,它说: Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details. 和 journalctl -xe Mar 17 17:19:15 open-kvm-app63 kill[31039]: kill: cannot find process "" Mar 17 17:19:15 open-kvm-app63 […]

当我在OS X 10.11上启用PHP模块时,Apache用户目录拒绝连接

我正在尝试在Apache中configuration用户director /Users/username/Sites 。 如果我注释掉了PHP LoadModule,它可以正常工作,甚至可以加载PHP7。 问题是我需要使用PHP5,但是每当我取消注释PHP LoadModule我得到localhost refused to connect. ,当试图连接到localhost/~username/Sites/ 。 不过localhost独自提出了Apache It Works! 信息。 这是我的httpd.conf # # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information. # In particular, see # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html> # for a […]