Questions tagged [apache-2.2]

Version 2.2 of the Apache HTTP Server. When asking questions about virtualhosts, please include the output of the following command: "apache2ctl -S" (or "httpd -S" depending on your OS)

OFF-TOPIC WARNING: Apache version 2.2 reached end-of-life with the final release of version 2.2.34 in July 2017. No further evaluation of security risks will be published for 2.2.x releases, and Apache users should immediately transition to version 2.4.x. Because Apache 2.2 is unsupported, most, if not all, questions regarding Apache 2.2 will be off-topic on ServerFault.

The Apache HTTP Server is a popular Open Source Web server.

This tag should be used for questions specific to version 2.2 of Apache HTTPD. For more general Apache HTTP Server related questions, you should use the Apache2 tag instead.

Apache is very well documented and most functionality is described in detail within this documentation. Specific documentation is available for Version 2.2

If you are asking a question on Server Fault about Virtual Hosts, can you please include the output of either:

# Debian Linux and its derivates
apache2ctl -S
# Most other UNIX/Linux distributions
apachectl -S
# Non UNIX/Linux distributions or if you are unable to find apachectl
httpd -S 

Including this will involve in a much faster answer to your question, as no doubt the first thing people will ask for is that output.


For questions about Apache 2.4 please use

17280 questions
83
votes
7 answers

Using variables in Apache config files to reduce duplication?

Is it possible to use variables in Apache config files? For example, when I'm setting up a site with Django+WSGI, the config file might look like: Order allow,deny Allow from all Alias /foo/static…
David Wolever
  • 2,267
  • 3
  • 24
  • 27
82
votes
4 answers

How to get Apache2 to redirect to a subdirectory

I am running apache2 on Debian etch, with multiple virtual hosts. I want to redirect so that http://git.example.com goes to http://git.example.com/git/ Should be really simple, but Google isn't quite cutting it. I've tried the Redirect and Rewrite…
Hamish Downer
  • 9,420
  • 6
  • 38
  • 51
82
votes
11 answers

Dealing with HTTP w00tw00t attacks

I have a server with apache and I recently installed mod_security2 because I get attacked a lot by this: My apache version is apache v2.2.3 and I use mod_security2.c This were the entries from the error log: [Wed Mar 24 02:35:41 2010] [error]…
Saif Bechan
  • 10,960
  • 10
  • 42
  • 63
81
votes
8 answers

Apache2 config variable is not defined

I installed apache2 on ubuntu 13.10. If I try to restart it using sudo /etc/init.d/apache2 restart I get this message: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName'…
Kurt Bourbaki
  • 913
  • 1
  • 6
  • 7
77
votes
3 answers

How to handle relative urls correctly with a reverse proxy

I have a reverse proxy setup as follows in Apache: Server A with address www.example.com/folder is the reverse proxy server. It maps to: Server B with address test.madeupurl.com This kind of works. But the problem I have is, on…
Hard worker
  • 879
  • 2
  • 8
  • 11
74
votes
8 answers

Why is the response on localhost so slow?

I am working on a tiny little PHP project for a friend of mine, and I have a WAMP environment setup for local development. I remember the days when the response from my local Apache 2.2 was immediate. Alas, now that I got back from a long, long…
Peter Perháč
  • 1,069
  • 1
  • 9
  • 13
74
votes
12 answers

Do you have any useful awk and grep scripts for parsing apache logs?

I can use log analyzers, but often I need to parse recent web logs to see what's happening at the moment. I sometimes do things like to figure out top 10 ips that request a certain file cat foo.log | grep request_to_file_foo | awk '{print $1}' | …
deadprogrammer
  • 1,691
  • 7
  • 24
  • 25
73
votes
11 answers

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

I keep getting this warning when I (re)start Apache. * Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName ... waiting apache2: Could not reliably determine…
user35402
  • 1,171
  • 3
  • 10
  • 18
72
votes
10 answers

Apache Default/Catch-All Virtual Host?

If I have 3 domains, domain1.com, domain2.com, and domain3.com, is it possible to set up a default virtual host to domains not listed? For example, if I would have: DocumentRoot /www/docs/domain1 ServerName…
SJaguar13
  • 937
  • 1
  • 6
  • 13
71
votes
4 answers

Redirect URL within Apache VirtualHost?

I have a dedicated server with Apache, on which I've set up some VirtualHosts. I've set up one to handle the www domain as well as the non-www domain. My VH .conf file for the www: DocumentRoot /var/www/site ServerName…
DisgruntledGoat
  • 2,629
  • 4
  • 28
  • 36
69
votes
2 answers

Apache ProxyPass with SSL

I want to proxy requests from an SSL site via a non-SSL site. My Apache httpd.conf looks like this: ServerName foo.com ProxyPass / https://bar.com/ So, when I visit http://foo.com, I expect apache to…
tylerl
  • 15,055
  • 7
  • 51
  • 72
69
votes
2 answers

How to combine various certificates into single .pem

I've just finished reading over this great thread explaining the different SSL formats. Now I'm essentially looking for the opposite of How to split a PEM file There's 4 files I want to consolidate, originally created for Apache, I'm looking at…
quickshiftin
  • 2,125
  • 5
  • 27
  • 41
67
votes
7 answers

Apache 2 startup warning: NameVirtualHost *:80 has no VirtualHosts

When my Ubuntu Apache server (Apache 2) starts up I get a warning message that reads: [warn] NameVirtualHost *:80 has no VirtualHosts However, the web server is working fine. What might I have wrong in my site's configuration to make it give me…
Kit Roed
  • 773
  • 1
  • 6
  • 7
65
votes
4 answers

best way to debug nginx rewrite rules in config file?

I have a bunch of rewrite rules that I have to port from apache to nginx. It's a rather painful process because I'm not able to see if my rewrite rules and "if" conditions are working as I want them to. Apache did have debugging for its rewrite…
Jiho Kang
  • 1,047
  • 2
  • 10
  • 8
63
votes
2 answers

Multiple "ServerName" per VHost?

In Apache2 is it possible to set multiple ServerNames in one VHost? I want to setup a "wiki" vhost for an internal wiki. My network has a ".lan" suffix. How do I get Apache to answer both "wiki" and "wiki.lan" on the same vhost?
Soviero
  • 4,366
  • 8
  • 36
  • 60