Articles of apache 2.4

我的服务器可以有多less用户?

我被告知切换到nginx或至less到mpm_worker。 但是,真的,我怎么估计,如果我的服务器是不是真的超载,即使使用mpm_prefork? 我的系统是: GCP 1 CPU + 3,75GB Debian 8 Apache 2.4与mpm_prefork 清漆caching,Memcache 一些php.ini设置 max_execution_time = 30 max_input_time = 60 memory_limit = 1536M 一些其他各种标准的apache模块,没有fastcgi和没有php-fpm。 <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxRequestWorkers 250 MaxConnectionsPerChild 0 </IfModule> KeepAlive Off 我有大约20个小WordPress的博客。 那么,我可以在所有网站上共同使用多less个并发用户? 我不需要确切的数字。 我想知道是十几岁还是十几岁? 可能不是10000s。 但是,如果在线时间相当于250次 – 我认为现在还是很好的。 另外,我应该将内存限制设置为3GB? 或者让左边的2GB被清漆使用是个好主意? Completed 1000 requests Finished 1000 requests […]

SELinux的“https_log_t策略”不生效

我试图在运行Fedora 26服务器的Digital Ocean Droplet上使用apache httpd来设置虚拟主机。 我遵循这个教程: 如何在CentOS 7上设置Apache虚拟主机 ,假设Fedora和CentOS有相似之处。 我已经按照教程来设置这个虚拟主机,如下所示: <VirtualHost *:80> ServerName www.mywebsite1.com ServerAlias mywebsite1.com DocumentRoot /var/www/html/mywebsite1.com/public_html ErrorLog /var/www/html/mywebsite1.com/log/error_log CustomLog /var/www/html/mywebsite1.com/log/requests_log combined </VirtualHost> 但是,设置后,我得到httpd无法启动。 事实certificate,这是造成这个错误,因为我追溯到httpd错误日志: (13)Permission denied: AH00091: httpd: could not open error log file /var/www/html/mywebsite1.com/log/error_log. AH00015: Unable to open logs 那么,我查找了解决scheme,发现这可能是由于SELinux政策。 使用ls -lZ /var/www/html/mywebsite1.com ,打印出当前策略如下: total 8 drwxr-xr-x. 2 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 […]

Apache:根据html正文内容redirectURL

背景:我正在apache 2.4上主持一个moinmoin wiki。 我只希望只有经过身份validation的用户才能看到它,所以我已经相应地调整了ACL。 如果用户未login,则会显示网站标题和string“您不能查看此页面”。 在身体里。 然后,用户必须[手动]进入login页面并进行身份validation。 许多CMS和维基系统都有一个系统,如果用户没有通过身份validation,就会将用户redirect到login页面。 Moinmoin没有这个。 我一直在冲刷mod_rewrite和类似模块的文档,以redirect到另一个URL的方法。 例如,我已经find了基于URL内容和HTML标题数据redirect的方法,但是根据HTML主体内容不能redirect。 有没有一种方法来基于HTML正文中的stringredirect?

做mod_wsgi守护进程和mpm-prefork实际创build线程?

这是我的网站主页: Welcome to your mod_wsgi website! It uses: Python 3.5.4 (default, Aug 22 2017, 05:13:36) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] WSGI version: (4, 5, 19) mod_wsgi.process_group = 'user' wsgi.multithread = False 相关的httpd.conf行是: WSGIDaemonProcess user processes=2 threads=1 python-home=<path-to-home> python-path=<python-path> WSGIProcessGroup user WSGIRestrictEmbedded On WSGILazyInitialization On WSGIApplicationGroup %{GLOBAL} 但是,htop在每个进程下显示3个线程: 我不介意,但我的应用程序不是线程安全的。 这里是httpd.conf的其余部分: ServerRoot "/home/user/webapps/apache/apache2" LoadModule mpm_prefork_module modules/mod_mpm_prefork.so […]

如何在Centos 7.4上禁用Selinux

我不想禁用Selinux,但是我遇到了问题。 我正在使用FFMPEG(位于/ var / www / tester / ffmpeg并由apache拥有) [root@betaX tester]# ls -Z /var/www/html/tester/ffmpeg/ -rwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 ffmpeg -rwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 ffmpeg-10bit -rwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 ffprobe -rwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 ffserver drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 manpages drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 model -rwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 qt-faststart 但每次我尝试运行ffmpeg {ffmpeg-cmd} -i {input} -vcodec libx264 […]

IPBoard复制用户

每当我在ACP中编辑一个用户而不是更新当前用户时,它会在数据库中创build一个新条目,从而创build一个与之前用户具有相同详细信息的新用户。 使用IPS版本4.1.19.4。 图片1(acp会员列表): https ://i.imgur.com/ZQEmygj.png 图片2(数据库条目): https : //i.imgur.com/iiSheag.png

使用Apache作为https反向代理清漆

在debian jessie中,我试图用varnish反向代理服务https,并且find了以下解决scheme: http : //davidbu.ch/mann/blog/2015-03-20/varnish-and-https-apache.html :apachepipe理端口443上的ssl东西,然后传递给端口80上的清漆,端口8080上传递给apache。 但是,请求https://myserver.com/index.html我在浏览器中: 403 Forbidden You don't have permission to access / on this server. Apache的error.log说: [authz_core:error] [pid 12662] [client 151.16.175.15:38240] AH01630: client denied by server configuration: proxy:http://127.0.0.1:80/index.html 我错过了什么? 我的虚拟主机定义 <VirtualHost *:8080> ServerAdmin [email protected] ServerName myserver.com DocumentRoot /home/paolo/weewx <Directory /home/paolo/weewx/> DirectoryIndex index.html Options FollowSymLinks AllowOverride All Require all granted order allow,deny […]

打开了太多的httpd进程

所以我已经阅读了所有与我的问题有关的问题,但是找不到任何帮助。 背景:我有一个服务于其他网站的应用程序(网站),并为网站添加了一些HTML,每个网站都对我的服务器进行简单的AJAX调用,当页面加载时,有时可能会发送5-如果他们在该页面上有几个我的HTML,那么每个网页的请求数为10。 老问题:现在我有大约800个网站,每次页面加载它发送一个AJAX请求到我的服务器(非常简单的请求 – TTLB = 500毫秒),但我收到了很多,你可以明白,每一秒我得到10-40个请求。 似乎没有太多,但我的服务器开始挣扎,没有任何东西,我有EC2 t2大,我的CPU使用率可以达到60%,在高峰时间和以上。 解决scheme:我已经修复了代码,它现在只发送1个AJAX请求,每分钟最less发送一次,每1分钟从1个IP获得1个请求,比从1个IP刷新每个页面5-10个好很多。 新问题:如果网站在我的应用程序中更改设置,只能得到新的代码,电子邮件将很快发送,但直到比(不是每个人都有固定的代码),我需要假设我没有解决这个问题,但不会变得更糟(或者变得更糟糕)。 我试过的:看了top命令之后,我发现这个过程看起来好像什么也没有做,闲着大约1分钟,然后被删除,我知道这个脚本大约需要500ms才能完成(甚至更less)当进程闲置时,每个进程的CPU使用率为0.3%,当你有20-50个进程(其中一些实际上正在做的东西,而不是占用2-7%的CPU),这是很多,所以我做了这个AJAX返回的结尾: header('Connection: close'); header('Content-Length: '.ob_get_length()); ob_end_flush(); ob_flush(); flush(); $cpid = posix_getpid(); $result = posix_kill($cpid, 9); 我发送我的回应,并删除了PHP脚本运行的过程中,我的CPU下降到18%,同时达到60%,仍然是18%,不低于10%,所以我认为一切都是仍然完成,没有太多的这些AJAX请求的进程。 但事实并非如此,我很高兴,我testing了我的应用程序,发现有些代码没有运行(更长的代码发送http请求并在文件中做事),我没有testing它,删除上面的代码块和问题消失了,所以我假设每个进程都不处理单个请求,所以我不能立即杀死这个进程。 我的想法是:我可以尝试使用configuration并设置进程,以便每个进程都可以处理单个连接,或者我可以设置less量的最大进程来打开,并且不会打开太多的进程,这些testing中的一些将帮助我,并且会解决我的问题,但是从长远来看,这也可能会伤害我,或者我不会考虑这个问题。 我知道这是不理想的玩这些configuration,但它看起来像我没有任何更好的主意(除了升级我的服务器,但它看起来像我不需要浪费钱)。 我该怎么办? 你知道更好的解决scheme吗? 我的一个想法会起作用吗? 我不知道我需要分享什么信息,但让我知道,所以我可以发布。

自助服务passord的apache错误

我安装了apache2和自助服务密码以允许用户更改密码。 以下是vhost的configuration: <VirtualHost *:80> ServerName ldap.local.domain Redirect "/" "https://ldap.local.domain/" DocumentRoot /usr/share/self-service-password/ </VirtualHost> <IfModule mod_ssl.c> <VirtualHost _default_:443> ServerName ldap.local.domain DocumentRoot /usr/share/self-service-password DirectoryIndex index.php <Directory /usr/share/self-service-password> Options Indexes FollowSymLinks MultiViews AllowOverride None <IfVersion < 2.3> Order Allow,Deny Allow from all </IfVersion> AuthType Basic AuthName "LDAP Auth" AuthBasicProvider ldap AuthLDAPURL "ldaps://ldap.local.domain:636/ou=users,dc=local,dc=domain?uid" AuthLDAPBindDN "cn=admin,dc=local,dc=domain" AuthLDAPBindPassword "password" AuthLDAPGroupAttribute memberUid AuthLDAPGroupAttributeIsDN […]

nginx作为macOS Server的apache的反向代理

我想在macOS上使用nginx作为服务器apache的反向代理。 我pipe理默认的macOS服务器的apache运行在端口4780为HTTP和47443为HTTPS。 Config位于这里: /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf 现在nginx的一部分:我想nginx代理服务器的子域server.example.com上的Apache。 对于HTTP它的作品像魅力,但HTTPS是问题,证书是在Apache中,而不是在Nginx的… HTTPconfiguration: server { listen 80; listen [::]:80; server_name server.example.com; #charset koi8-r; access_log /logs/server.access.log main; error_log /logs/server.error.log error; location / { proxy_pass http://localhost:4780; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } HTTPSconfiguration: server { listen 443; listen [::]:443; server_name server.example.com; #charset koi8-r; access_log /logs/server.access.log […]