Apache + Tomcat giving error 500 for non-browser agents (Struts2)
I’ve got an Apache WebServer + Tomcat 7 serving Struts2 web pages. It works without problems when I use any web browser, but when I try to access a web page using W3C validator or Facebook Lint, the server returns the error 500. [28/Oct/2011:21:45:58 +0100] “GET /agenda7/event?id=124 HTTP/1.1″ 200 9898 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.51.22 (KHTML, like Gecko) Version/5.1.1 Safari/534.51.22″[28/Oct/2011:21:47:16 +0100] “GET /agenda7/event?id=124 HTTP/1.0″ 500 6287 “-” “facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)”[28/Oct/2011:21:47:42 +0100] “GET [...]
Continue Reading »Migrating from Apache 2.0 to 2.2
We are going to migrate our Apache 2.0 to Apache 2.2 finally. I am only worried about the mod_rewrite changes that 2.2 might have gotten. Did anyone notice any problems when switching? Any particular problems with rewrites? Anything that behaves differently now? Not a lot changed of consequence, really; some reorganization of modules and changes to a couple defaults. Nothing that I know of in mod_rewrite. Review here for a summary of the changes from [...]
Continue Reading »What must the file permissions be for x-sendfile to work with apache
Sorry I am a bit of an Apache noob… I have a Ruby-on-Rails application that I am hosting with Apache and Phusion-Passenger (on Ubuntu Server). In this app I have a controller method that basically protects access to some files based on the currently logged in user and then servers them using X-sendfile. The method looks something like this: def show if File.exists @file_name sendfile @file_name, sendfile => true else render_404 end end It mysteriously [...]
Continue Reading »Prevent using wildcard in Apache server alias setting
This is a modified VirtualHost setting from my server. <VirtualHost *:80> ServerName example.com DocumentRoot /mnt/example/public <Directory /mnt/example/public> AllowOverride all Options -MultiViews </Directory></VirtualHost> I found that I can access the example.com and also *.example.com, e.g. www.example.com, abcde.example.com, etc. I know there should be a ServerAlias setting which let me activate wildcard subdomain suppot. But I can’t see the ServerAlias setting my VirtualHost or Apache config file. I want to allow only www.example.com and example.com can access [...]
Continue Reading »Ideas for a technical hands-on exam
I need to come up with a technical hands-on exam for a new sysadmin position in our company as part of our recruitment process. I’m looking for ideas to make an interesting exam to both check the candidates’ technical aptitude but also make the job appealing to them. However the exam should only last about 1 to 2 hours so tasks can’t be too much time consuming. For each component in our stack I would [...]
Continue Reading »netstat doesn’t display full remote ip address, no ip address for ssl, port 443
We’re running a Apache webserver on Arch Linux (build from May ’10) and while monitoring connections with netstat we’re seeing some odd connections on port 443 that don’t report an IP address; is this cause for concern? We also don’t don’t get full ip addresses reported for remote hosts on 90% of our connections, we just get the first three portions of the IP, a period, and then the remote port. Any ideas on why [...]
Continue Reading »Apache2 No Listening Sockets, unable to open logs while trying to configure virtual hosts
I’m trying to set up multiple domains with virtual hosts in Apache2. I’m currently getting a “Could not connect” error when I try to browse to my site, and whenever I try to restart Apache2, I get an error about “no listening sockets available, shutting down Unable to open logs”. Originally, after configuring apache2.conf and my /apache2/sites-enabled/domain1.com, I was getting a 500 server error and a warn from apache2 that “NameVirtualHost *:80 has no VirtualHosts”. [...]
Continue Reading »Parenthesis in apache web file name
I’m hosting an image server where my clients upload their photos for viewing by their customers later. We’ve migrated our site from a Windows server to Linux. Some of our clients are accustomed to being able to use parenthesis in the file names. This used to work in our Windows environment but not in the Apache/Linux environment we moved to, we get a 404. When we modify the file, removing the parenthesis, we are able [...]
Continue Reading »Apache – httpd.conf redirect with X-Forward-For – Not working?
I’m having an a-hole of a problem redirecting traffic. Basically, I’m building a new web server and it’s on another version of my domain, so I want to redirect traffic not from this IP. Problem is Amazon’s ELB Load Balancer is in the way, so it replaces REMOTE ip address. The normal method of obtaining. Research found I need to use %{X-Forward-For}i – but it’s not working and I don’t know if I’ve got it [...]
Continue Reading »How to properly use VirtualHost and mod_proxy together for different incoming domain names and internal ports?
I am trying to setup httpd.conf properly but regardless of the sub-domain/domain combo below, they all resolve to the same internal URL. <Proxy *> Order Allow,Deny Allow from all </Proxy>ProxyRequests Off<VirtualHost *:80> Servername jira.firstfactoryinc.com ProxyPreserveHost On ProxyPass / http://localhost:8082/ ProxyPassReverse / http://localhost:8082/ </VirtualHost><VirtualHost *:80> Servername jira.submitpatientforms.com ProxyPreserveHost On ProxyPass / http://localhost:8081/ ProxyPassReverse / http://localhost:8081/ </VirtualHost><VirtualHost *:80> Servername mddev-jira.firstfactoryinc.com ProxyPreserveHost On ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ </VirtualHost> What am I doing wrong? You’ll need a [...]
Continue Reading »


