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
371
votes
6 answers

What permissions should my website files/folders have on a Linux webserver?

This is a Canonical Question about File Permissions on a Linux web server. I have a Linux web server running Apache2 that hosts several websites. Each website has its own folder in…
Nic
  • 13,425
  • 17
  • 61
  • 104
300
votes
4 answers

How do I select which Apache MPM to use?

This is a Canonical Question about selecting the right Apache httpd MPM. I'm a little confused between the different MPMs offered by Apache - 'worker', 'event', 'prefork', etc. What are the major differences between them, and how can I decide…
Tiffany Walker
  • 6,681
  • 14
  • 56
  • 82
284
votes
5 answers

Redirect, Change URLs or Redirect HTTP to HTTPS in Apache - Everything You Ever Wanted to Know About mod_rewrite Rules but Were Afraid to Ask

This is a Canonical Question about Apache's mod_rewrite. Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as: Changing HTTP to HTTPS (or the…
Kyle Brandt
  • 83,619
  • 74
  • 305
  • 448
280
votes
15 answers

Finding out what user Apache is running as?

I want to secure a file upload directory on my server as described beautifully here, but I have one problem before I can follow these instructions. I don't know what user Apache is running as. I've found a suggestion that you can look in httpd.conf…
Anna
254
votes
11 answers

Is it bad to redirect http to https?

I just installed an SSL Certificate on my server. It then set up a redirect for all traffic on my domain on Port 80 to redirect it to Port 443. In other words, all my http://example.com traffic is now redirected to the appropriate…
JasonDavis
  • 2,658
  • 6
  • 25
  • 32
234
votes
4 answers

What's the best way of handling permissions for Apache 2's user www-data in /var/www?

Has anyone got a nice solution for handling files in /var/www? We're running Name Based Virtual Hosts and the Apache 2 user is www-data. We've got two regular users & root. So when messing with files in /var/www, rather than having to... chown -R…
Gareth
  • 8,573
  • 13
  • 44
  • 44
172
votes
9 answers

Is it possible to generate RSA key without pass phrase?

I'm working with Apache2 and Passenger for a Rails project. I would like to create a self-signed SSL Certificate for testing purposes. sudo openssl rsa -des3 -in server.key -out server.key.new When i enter the above command, it says writing RSA…
diya
  • 1,873
  • 2
  • 14
  • 8
136
votes
7 answers

How to list Apache enabled modules?

Is there a command that list all enabled Apache modules?
supercobra
  • 1,515
  • 2
  • 12
  • 9
132
votes
3 answers

What does Apache's "Require all granted" really do?

I've just update my Apache server to Apache/2.4.6 which is running under Ubuntu 13.04. I used to have a vhost file that had the following: AllowOverride All But when I ran that I…
John Crawford
  • 2,005
  • 3
  • 15
  • 9
110
votes
12 answers

How do I prevent apache from serving the .git directory?

I have started using git for deployment of websites for testing. How do I prevent apache from serving the .git directory contents? I tried Order deny,allow Deny from all with no success. I know that…
Shoan
  • 1,715
  • 5
  • 17
  • 23
110
votes
5 answers

Multiple SSL domains on the same IP address and same port?

This is a Canonical Question about Hosting multiple SSL websites on the same IP. I was under the impression that each SSL Certificate required it's own unique IP Address/Port combination. But the answer to a previous question I posted is at odds…
John
  • 7,343
  • 23
  • 63
  • 87
104
votes
8 answers

What limits the maximum number of connections on a Linux server?

What kernel parameter or other settings control the maximum number of TCP sockets that can be open on a Linux server? What are the tradeoffs of allowing more connections? I noticed while load testing an Apache server with ab that it's pretty easy to…
Ben Williams
  • 2,376
  • 4
  • 21
  • 17
100
votes
4 answers

How does ServerName and ServerAlias work?

It's the following part of a virtual host config that I need further clarification on: # Admin email, Server Name (domain name), and any aliases ServerAdmin example@example.com ServerName 141.29.495.999 ServerAlias…
njp
  • 1,102
  • 2
  • 8
  • 7
93
votes
6 answers

Proxy Error 502 "Reason: Error reading from remote server" with Apache 2.2.3 (Debian) mod_proxy and Jetty 6.1.18

Apache is receiving requests at port :80 and proxying them to Jetty at port :8080 The proxy server received an invalid response from an upstream server The proxy server could not handle the request GET /. My dilemma: Everything works fine normally…
Martin
85
votes
5 answers

How do I redirect subdomains to a different port on the same server?

I have some subdomains I want to redirect to specific ports on the same server. Say I have dev.mydomain.com I want dev.mydomain.com to transparently redirect to mydomain.com:8080 and I want to preserve the original sub-domain name the url of the…
user35861
1
2 3
99 100