DevHeads.net

Postings by Rose, John B

Remove .php extension but still pass it to PHP-FPM

We would like to strip select .php extensions within a web site but still have them passed to PHP-FPM when they are clicked on.

Any help would be appreciated

Apache PHP-FPM unix domain sockets questions

After looking at the documentation on httpd.apache.org and wiki.apache.org I have a few questions ...

1. I have seen examples of both "ProxyPassMatch" and "SetHandler" used to implement Unix Domain Sockets. Which is better?

2. On the wiki page it says "Using too many sockets will cause apache to give a (99)Cannot assign requested address: error"

If PHP-FPM is configured to use "ondemand" does this help avoid that problem?

3. If "ondemand" is used in PHP-FPM, is it still advisable to tweak /proc/sys/net/ipv4/tcp_tw_reuse?

4.

mod_macro, unix domain sockets, php-fpm pool config files

mod_macro and unix domain socket functionality in Apache are nice features, thanks to whomever put in the time and effort developing/maintaining.

We have looked for an equivalent of Apache mod_macro for php-fpm in order avoid having to create a php-fpm pool conf for each Apache virtual host using unix domain sockets.

No luck thus far.

Does anyone have techniques they use for generating large number of php-fpm pool config's utilized by Apache virtual hosts using unix domain sockets within mod_macro, instead of creating them one by one by hand?

Thanks

problem when move https site to 2.4 from 2.2 Apache

Encountered problems moving web sites from Apache 2.2 to 2.4 for https

When moving web sites from an Apache 2.2 environment to to 2.4 the ones that are .html and self written .php seem to work fine via both http and https

When moving Wordpress sites to 2.4, they work fine via http, but go into endless redirects when accessed via https

Has anyone encountered this problem?

Have done some googling, switched back and forth between php-fpm and mod_php, removed .htaccess redirects, turned off plugins, etc. Nothing seems to remedy it so far.

Thanks

access control and Apache load balancing

Any suggestions on how to implement access control for ip address ranges to specific files on back end hosts when going thru Apache load balancer?

For example, you do not want external IPs to access "filename.php" on your backend hosts thru load balancer

Apache load balancer, etc

Have been comparing Apache load balancing with some other possibilities

As expected can do just about anything you want with Apache but the performance testing between Apache load balancing and nginx, haproxy, lighthttpd has Apache noticeably slower.

When should someone use TCP socket vs Unix socket vs Websocket for PHP execution

If you have php-fpm running on same server as Apache, and you have a lot of virtual hosts (hundreds+) using PHP. Which is the best approach for executing PHP as the owner of each virtual host (web directory)?

Looking thru this page at the moment for guidance ....

<a href="https://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html" title="https://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html">https://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html</a>

Thanks

How to route userdir requests to different hosts?

Looking for a way to route requests for different users to different back end hosts behind a proxy of some sort

For example ...

http request to ...

<a href="http://abc.com/~user1" title="http://abc.com/~user1">http://abc.com/~user1</a>

always goes to one specific host

an http requests to ...

<a href="http://abc.com/~user2" title="http://abc.com/~user2">http://abc.com/~user2</a>

always goes to a another specific host

Any suggestions appreciated

Thanks

John

mod_proxy_fcgi unix domain socket syntax question on Apache documentation

Looking at the documentation on this page ...

<a href="https://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html" title="https://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html">https://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html</a>

<https://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html>The documentation says "With this syntax, the hostname and optional port following fcgi:// are ignored." regarding this example ...

ProxyPassMatch "^/(.*\.php(/.*)?)$" "unix:/var/run/php5-fpm.sock|fcgi://localhost/var/www/"

Why are they in the example if they are ignored?

Are they also ignored here?

SetHandler "proxy:unix:/path/to/app.sock|fcgi://localhost/"

Thanks

John

CPU usage in server-status and top not matching

Hello

Trying to match high %cpu httpd processes from "top" with what they are requesting and ip addresses

Any suggestions?

Thanks

"apachectl -S" and DocumentRoot

Hello

apachectl -S

is a nice command. We are looking for something that outputs the "DocumentRoot" for all virtual hosts

Is there some way to do that with a single command?

Thanks

yum update puts back removed Apache modules

It seems as though “yum” update has replaced Apache modules installed in the default installation, that we had removed after the initial install because they weren’t used.

Is there some way to prevent that from happening?

thanks

SSLEngine on and mod_macro

When setting “SSLEngine on” in a mod_macro config file for virtual hosts we are not able to start Apache.

When it is commented out, Apache will start. On the same server “SSLEngine on” is in another self-contained virtual host config file, and also in ssl.conf. Those do not cause any problems with starting Apache. Only when it is in the mod_macro config file.

The above, "SSLEngine on” in the mod_marco config file worked fine on a Apache 2.2 system. But on an Apache 2.4.6, it is having the above problem.

Any ideas?

Thanks

AH00894: declining URL fcgi

Not sure if this is our problem, but after setting log level to debug we noticed this in the error_log. Not sure how to interpret what is happening. It looks like the fcgi connection to php-fpm is being declined initially, then it is successful. But I am not sure. Is this refusing to execute the php command?

Access Control in 2.4 question

If all the necessary modules are installed, what would prevent this from working?

<Files "private.html">
Require all denied
</Files>

Apache + virtual hosts + php-fpm?

Looking at the php-fpm homepage …

<a href="https://php-fpm.org" title="https://php-fpm.org">https://php-fpm.org</a>

it says this …

It was not designed with virtual hosting in mind (large amounts of pools) however it can be adapted for any usage model.

Are folks using Apache with numerous virtual hosts, still using mod_php as the preferred approach? With I assume prefork MPM?

access_log and split-logfile, vlogger, something else?

Is there a most frequently used tool for culling virtual host log files out of a single access_log file?

split-logfile? vlogger? Something else?

Thanks

RAM output in server-status?

Apache 2.2.15

We have ExtendedStatus on

We have to toggle to “top” to try and catch RAM per httpd process. Is there some way to output RAM per process in server-status output?

Thanks

forensic logs with virtual hosts

Is there some global way to utilize mod_log_forensic with virtual hosts without having to add “ForensicLog logfilepathname” to every virtual host config?

check_forensic script on Red Hat?

Does check_forensic still exist?

I am not finding it.

allow deny file and multiple .conf question

When controlling access to specific files via Allow/Deny, and not using <Directory> or <Location>, and putting in different .conf files, does the order of the conf files matter?

In other words …

aaa-block.conf has …
<Files “aaa.php>
Order Deny,Allow
Deny from All
</Files>

zzz-block.conf has …
<Files “zzz.php”>
Order Deny, Allow
Deny from all
Allow from your domain.com
</Files>

Would the .conf files similar to one above controlling access previous be negated by the last zzz-block.conf above?

Analog log file analyzer for Apache logs

Has anyone used these more recent versions (C:Amie) for Apache logs?

<a href="http://www.c-amie.co.uk/analog/" title="http://www.c-amie.co.uk/analog/">http://www.c-amie.co.uk/analog/</a>

Comments?

Server Side Includes question

1) Is it possible to auto add a footer to all web pages on a server, including all virtual hosts sites pages, with a Server Sides Includes, without editing any of the pages?

2) Is it possible to accomplish adding a javascript to the bottom of all pages on a server, including virtual hosts, automatically via Apache, without touching any of the sites pages?
If so, how?

Thanks

adding footer to all web pages

If we wanted to add a Google Analytics footer to all pages on our server, meaning all virtual hosts, what is the best way to do that via Apache without having to touch the individual web sites?

Apache log analyzer?

Any suggestions for an Apache log analyzer?

Thanks

Causes httpd processes spiraling out of control with memory usage?

Are there some common causes for a single httpd process to use inordinate amounts of RAM?

I have read about one person having a loop in their mod_rewrite rules. If someone hit the particular URL, the offending Rewrite rule would
cause memory consumption to go out of control

Thanks

apache.org server-status interface

What is the new interface on this page?

<a href="http://httpd.apache.org/server-status" title="http://httpd.apache.org/server-status">http://httpd.apache.org/server-status</a>

Is all the previous interface information available?

ServerAlias limit and conflicts?

1. Is there a limit on how many “ServerAlias” lines can be in a virtual host block?

2. Is there a limit on how many hostnames can be in one “ServerAlias” line?

3. If you used “ServerAlias *.abc.com” in one virtual host conf file, would that cause any conflict with existing virtual host conf files using the same abc.com domain?

Thanks

Re: [users@httpd] How to calculate maxclients for Apache mpm event module?

Are you using PHP-FPM or mod_php?

Reply-To: " ... at httpd dot apache.org" < ... at httpd dot apache.org>

What are parameters we can tune for Apache mpm event module?

Regards,

Krunal Patel.

Re: [users@httpd] RE: Thread ratios

I think that is Apache 2.4.6

If using PHP-FPM I think you may need to coordinate some settings in PHP-FPM (pm.max_children, etc.) with your config settings (MaxRequestWorkers, etc) in Apache.

If you do rewrites you may want to be aware of this …
<a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=53929" title="https://bz.apache.org/bugzilla/show_bug.cgi?id=53929">https://bz.apache.org/bugzilla/show_bug.cgi?id=53929</a>

Reply-To: " ... at httpd dot apache.org" < ... at httpd dot apache.org>

I forgot to mention, just in case this