因为Debian开发者认为safe_mode(不会使其成为PHP6)和open_basedir固有地破坏了安全措施,我想知道它们是否可以被mod_suexec与mod_fcgid结合替代。 你认为这是有效的吗? 亲切的问候,本杰明。
httpd.conf文件: LoadModule fcgid_module modules/mod_fcgid.so AddHandler fcgid-script .php FCGIWrapper /usr/local/php5 .php # manual MaxRequestsPerProcess 1000 FcgidMaxProcesses 200 FcgidProcessLifeTime 7200 MaxProcessCount 500 FcgidIOTimeout 400 FcgidIdleTimeout 600 FcgidIdleScanInterval 90 FcgidBusyTimeout 300 FcgidBusyScanInterval 80 ErrorScanInterval 3 ZombieScanInterval 3 DefaultMinClassProcessCount 0 DefaultMaxClassProcessCount 3 MaxRequestLen 20468982 <VirtualHost *> ServerName hostname DocumentRoot /home/web ServerAdmin [email protected] <IfModule mod_suphp.c> suPHP_UserGroup web web </IfModule> SuexecUserGroup […]
我有一个服务器运行几个虚拟主机的网站,并想知道是否有一种方法来获得一些不同的用户/组下执行一些虚拟主机PHP取决于连接到它们的客户端。 我想它可能会像: 客户端通过https连接 客户端可以提供SSL证书(或不) 服务器决定是否: 如果没有提供证书,请在user1 / group1下运行PHP 如果某个白名单的证书和某些cookie是由客户端发送的,请在user2 / group2下运行PHP 有人知道这样的事情是可能的吗?
Th服务器运行着40个WordPress站点。 最初,当服务器有2GB的内存时,使用mod_php和mpm-prefork来设置服务器,并且运行起来很舒服。 然而,最近我更新了服务器以使用FastCGI,suexec和mpm-worker。 从那时起,我无法让Apache免受吞噬所有可用RAM,直到它开始交换,并最终停止响应。 为了缓解这个问题,我们把服务器从2GB提高到了4GB,但是在7个小时之后,服务器占用了所有的4GB,并重新进入了交换。 在mpm-prefork下,我们只设置MaxClients,一切都很好。 但对我来说,在mpm-worker下,我找不到似乎工作的设置。 MaxRequestsPerChild,ThreadsPerChild和MaxClients的任何组合仍然会导致相同的结果。 我以前从来没有和mpm-worker合作过,所以我不确定如何调整。 我已经花费了无数个小时来searchApache2.conf中的设置,并尝试了几十个设置,但是它们都使用了所有内存的同一条path。 使用4GB的服务器,为其他进程留下大约400MB的空间,并且知道每个Apachesubprocess在生成时都运行在50MB左右,那么什么样的设置组合应该可以让服务器尽量避免使用内存? 当前的设置: <IfModule mpm_worker_module> StartServers 6 ServerLimit 25 MinSpareThreads 25 MaxSpareThreads 50 ThreadLimit 75 ThreadsPerChild 25 MaxClients 75 MaxRequestsPerChild 2000
我已经configuration我的服务器使用suexec PHP本周末。 现在我已经认识到,suexec也提供由root拥有的文件或世界可写的文件。 但是,在我看来,这不像在这里logging的标准行为。 那么,为什么suexec使用这个文件? 我使用Debian 6 Squeeze stable。 这有点像这个post的反面。
我正尝试在apache2服务器上安装gitolite 3。 所以我需要运行一个由git:git拥有的CGI脚本。 我的configuration(主要基于这个 )是: <VirtualHost myserver.com> ServerName myserver.com ServerAlias git SuexecUserGroup git git ScriptAliasMatch "(?x)^/(.*/(HEAD | info/refs | objects/(info/[^/]+ | [0-9a-f]{2}/[0-9a-f]{38} | pack/pack-[0-9a-f]{40}\.(pack|idx)) | git-(upload|receive)-pack))$" \ /srv/www/gitolite_suexec_wrapper.sh/$1 </VirtualHost> 我遇到的问题是每当一个查询匹配我的stript别名regexp,客户端收到403和我的Apache错误日志(设置为debugging级别)告诉我以下内容: client denied by server configuration: /srv/www/gitolite_suexec_wrapper.sh 我的apache2服务器有用户wwwrun和组www。 suexec模块正在运行,所以我testing一切都很好,如下所示: su -c "/usr/sbin/suexec2 true" wwwrun suexec policy violation: see suexec log for more details 所以这个用户可以启动suexec。 以前我在我的/srv/www/gitolite_suexec_wrapper.sh上有错误的权限,并有行logging在/var/log/apache2/suexec.log ,现在我什么都没有,所以我想我的权利正确设置有关suexec和包装脚本。 […]
我正在尝试在子域accounts.mysite.com(DO Droplet)的服务器上设置一个django(mod-wsgi)应用程序。 当我尝试重新加载Apache时,出现以下错误: AH00526: Syntax error on line 2 of /etc/apache2/sites-enabled/dev.mysite.com.conf: SuexecUserGroup configured, but suEXEC is disabled: Invalid owner or file mode for /usr/lib/apache2/suexec 我最初并没有设置这个,所以我在“我不想打破它”的心态 – 也许是太谨慎了。 这就是说,我想通过serverfault运行configuration,看看是否有什么突出的 – 我有几年没有与fcgi工作,它看起来对我好,但有多个simlinks。 而原来的开发似乎是由用户/组ID设置suexec组。 / usr / lib / apache2 / suexec具有以下chmod设置: lrwxrwxrwx 1 root root 24 Aug 25 2014 suexec -> /etc/alternatives/suexec 这把我带到这里 lrwxrwxrwx 1 root root […]
奇怪我的apache不会logging错误,因为我设法启用fcgid和suexec进行php处理。 即使简单的文件只有<? dwakdnawjkdn(); ?> <? dwakdnawjkdn(); ?> <? dwakdnawjkdn(); ?>不会产生任何错误,即使它们返回500错误。 我的configuration: fastcgi.logging设置为1 。 fcgid.conf: <IfModule mod_fcgid.c> DefaultMinClassProcessCount 0 IdleTimeout 300 IdleScanInterval 30 MaxProcessCount 15 MaxRequestsPerProcess 500 PHP_Fix_Pathinfo_Enable 1 </IfModule> 虚拟主机: <VirtualHost *:80> DocumentRoot "/var/www/mysite/web" ServerName mysite.tld ServerAlias mysite.tld SuexecUserGroup mysite mysite AddHandler fcgid-script .php <Directory "/var/www/mysite/web"> FCGIWrapper /var/www/mysite/cgi-bin/fcgi-conf <FilesMatch \.php$> SetHandler fcgid-script </FilesMatch> AllowOverride All […]
我安装了Apache2.4 + Php5.6 + mod_proxy_fcgi + php-fpm等东西,如Mysql 5.5,Phpmyadmin和munin,没问题。 注意:我也激活了userdir并重写。 现在我想要更安全,但SuExec不起作用,没有发现错误。 如果我把/home/sitetest/public_html/test.php放在: <?php echo exec('whoami'); ?> 它说: www-data 我能做什么? search谷歌不帮我。 /var/log/apache2/error.log [Fri Dec 11 21:32:21.918933 2015] [mpm_prefork:notice] [pid 771] AH00169: caught SIGTERM, shutting down [Fri Dec 11 21:32:28.064683 2015] [suexec:notice] [pid 12374] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec) [Fri Dec 11 21:32:28.126362 2015] [mpm_prefork:notice] [pid 12375] […]
我在每个用户的主文件夹中有两个目录: .html-data和.cgi-bin 。 第一个包含静态(.html)文件,第二个包含dynamic文档生成的文件。 每个用户应该能够发布http://myhost.com/~<username>/上的.html-data文件夹的内容和http://myhost.com/~<username>/上的.cgi-bin文件夹的内容。 http://myhost.com/~<username>/cgi-bin/ 。 创builddynamic内容的脚本应该像提供它们的用户那样执行 (例如~steve/cgi-bin/test.cgi应该以用户steve的forms执行)。 为此,我为Apache 2.4的userdir模块configuration了以下configuration: UserDir .html-data UserDir disabled root <Directory "/home/*/.html-data"> RewriteEngine On RewriteBase /~username/ RewriteRule "^/cgi-bin/(.*)" "../../.cgi-bin/$1" AllowOverride FileInfo AuthConfig Limit Indexes Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec Require method GET POST OPTIONS </Directory> <Directory "/home/*/.cgi-bin"> Options ExecCGI SetHandler cgi-script Satisfy any </Directory> 但是,这不起作用。 RewriteRule似乎是错误的。 我怎样才能引用用户的.cgi-bin目录? 这是错误日志: [Thu […]