DevHeads.net

Postings by Darryl Philip Baker

Need a conditional rewrite/redirect rule

I don't write conditional rewrite rules often but this is a case where I need one.

Vim Syntax Highlighter File

I use the vim feature to highlight the syntax in the Apache configuration files. I am on RHEL 7 and there are many key words that are not getting highlighted. I noticed that a significant number of them are the new keywords in 2.4. Anyone have and updated apache.vim or apachestyle.vim filethey would be willing to share?

Darryl Baker (he/him/his)
Sr. System Administrator
Distributed Application Platform Services
Northwestern University
1800 Sherman Ave.
Suite 6-600 – Box #39
Evanston, IL 60201-3715
darryl. ... at northwestern dot edu<mailto:darryl. ... at northwestern dot edu>
(847) 467-6674

Validating Redirect Targets

Posting email list is dedicated to the use and usually the syntax of Apache configurations so my question may be off topic. If so please direct me to the correct place.

I have inherited an Apache configuration that has grown organically over more than a decade. I know there are redirects and rewrite rules which are now pointing to invalid URLs.

Subdomain of a virtual host ?

I have a virtual host configured for george.example.com complete with directory definitions and redirects. I now have a request for washington.george.example.com and they would like the same abilities for the subdomain. I’m unsure as to how to make this work or if this is even possible. I am looking for help, suggestions?

Darryl Baker
Sr. System Administrator
Distributed Application Platform Services
Northwestern University
darryl. ... at northwestern dot edu<mailto:darryl. ... at northwestern dot edu>

RE: [users@httpd] Apache (2.4.26) changing permissions on passed file?

Is the file owned by the user running Apache?

Darryl Baker
NIT - CI - PIPS - DAPS
X76674

I wonder if someone can shed some light on this.

I've been running Apache 2.4.7 on Ubuntu 14.04LTS using a VirtualHost with a passwd file and all was working fine. I upgraded Apache to 2.4.26 and the site stopped working.

Trouble Securing a directory correctly

I have a directory defined inside a virtual host I want to only be accessible from inside our networks. What is happening is that the rules don't seem to be working as I expect browser that do not match the criteria are getting access. One complexity is that the parent path is secured by our SSO solution using AM Agent. The browser is prompting for the SSO credentials.

Thread ratios

I am converting an older system Apache 2.2 using mpm_prefork to Apache 2.4. I think we would have better performance with mpm_worker or possibly mpm_event. My problem is trying to figure out what is the best ratio of threads per process, the correct way to set that value, and the best value for the total number of threads which I think is set by MaxRequestWorkers. I am tuning my cluster of systems for a sudden heavy load of page requests but not a lot of CGI or other complex operations. These are dual processor VM systems. Any suggestions or pointers?

Darryl Baker
Sr.

Syntax checking an alternate configuration file

I want to syntax check an alternate configuration file in Apache 2.4 but I have hit a snag, "apachectl -t -f {full path name}" and "apachectl -f {full path name} configtest" give me an extra message which I don't need and don't want to see. I looked at the shell script that is apachectl and it looks like someone got lazy and if there is a second argument it will always print the warning message. It may be a "feature" but it is a damn annoying one. Because I'm using RHEL I don't want to just comment out the test in apachectl but I'm not sure it is a reportable bug.

RE: RedirectMatch and spaces

For each place there is a space in the original file name I am using the pattern "[\ |+|%2520%252B]"
Is that the correct regular expression for what I want to accomplish?

Darryl Baker

ReddirectMatch and spaces

I have been requested to redirect a set of URLs that contain spaces to alternate URLs. I know that URLs with spaces are a "really bad idea (tm)" but the person who sent these out didn't think of asking me first. I have come up with patterns that work using RewriteRule but only for Chrome and Firefox. IE returns a 404 in some cases. That is likely a bug in IE and how it parses and passes spaces on but I can't ignore IE and declare victory. I thought it might be better if I use RedirectMatch instead of a RewriteRule but I cannot come up with a pattern that matches a space.

Rookie Question on Define and Testing the value

I'm trying to do some conditional configuration settings. I know that I can use "Define variable value" to set up a variable. I know that "<IfDefine [!}variable>" can be used to test to see if a variable is set or not. I looked at "<If expression>" as a possibility but since what I am setting are really configuration change and "If" is a runtime directive. Using "If" is going to add runtime overhead for something that will not change for the life of the daemon.

Server replication

I the system administrator for HTTP servers in a higher volume environment. We have three Linux hosts serving the many virtual hosts that make up our sites. The only HTTPD configuration difference between the three servers is the local machine's host name and IP address. I would like to have the HTTPD configuration be identical except for one file with the local settings, then I can just include that file. I would like to avoid having a large "<ifdefine></ifdefine>" block if possible.