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)

Filter by
Sorted by
Tagged with
372 votes
6 answers
569k views

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 /var/www/. /var/...
Nic's user avatar
  • 13.5k
300 votes
4 answers
195k views

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 ...
Tiffany Walker's user avatar
286 votes
15 answers
532k views

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 ...
user avatar
285 votes
5 answers
115k views

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 ...
Kyle Brandt's user avatar
254 votes
11 answers
108k views

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 ...
JasonDavis's user avatar
  • 2,658
234 votes
4 answers
182k views

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 ...
Gareth's user avatar
  • 8,573
172 votes
9 answers
334k views

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 ...
diya's user avatar
  • 1,873
139 votes
7 answers
261k views

How to list Apache enabled modules?

Is there a command that list all enabled Apache modules?
supercobra's user avatar
  • 1,545
132 votes
3 answers
354k views

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: <Directory "/home/john/development/foobar/web"> ...
John Crawford's user avatar
111 votes
12 answers
81k views

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 <Directorymatch "^/.*/\.svn/"> Order deny,allow Deny ...
Shoan's user avatar
  • 1,725
110 votes
5 answers
79k views

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 ...
John's user avatar
  • 7,413
105 votes
8 answers
219k views

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 ...
Ben Williams's user avatar
  • 2,396
100 votes
4 answers
333k views

How does ServerName and ServerAlias work?

It's the following part of a virtual host config that I need further clarification on: <VirtualHost *:80> # Admin email, Server Name (domain name), and any aliases ServerAdmin example@...
njp's user avatar
  • 1,102
94 votes
6 answers
473k views

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 ...
user avatar
85 votes
5 answers
187k views

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 ...
user avatar
83 votes
7 answers
113k views

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: <Directory /path/to/foo/> Order allow,...
David Wolever's user avatar
83 votes
4 answers
198k views

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 ...
Hamish Downer's user avatar
82 votes
11 answers
91k views

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 ...
Saif Bechan's user avatar
81 votes
8 answers
251k views

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 ...
Kurt Bourbaki's user avatar
77 votes
3 answers
200k views

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....
Hard worker's user avatar
74 votes
8 answers
267k views

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. ...
Peter Perháč's user avatar
74 votes
12 answers
152k views

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

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 ...
deadprogrammer's user avatar
73 votes
11 answers
84k views

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 ...
user35402's user avatar
  • 1,171
72 votes
10 answers
123k views

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: <VirtualHost 192.168.1.2 204....
SJaguar13's user avatar
  • 937
72 votes
4 answers
290k views

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: <VirtualHost *&...
DisgruntledGoat's user avatar
71 votes
2 answers
217k views

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, ...
quickshiftin's user avatar
  • 2,145
69 votes
2 answers
206k views

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: <VirtualHost 1.2.3.4:80> ServerName foo.com ProxyPass / https://bar.com/ </...
tylerl's user avatar
  • 15.1k
67 votes
7 answers
116k views

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 ...
Kit Roed's user avatar
  • 773
66 votes
4 answers
96k views

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 ...
Jiho Kang's user avatar
  • 1,067
64 votes
2 answers
101k views

What Should be the Permissions of Apache SSL Directory, Certificate, and Key?

I have my cert.pem and cert.key files in /etc/apache2/ssl folders. What would be the most secure permissions and ownership of: /etc/apache2/ssl directory /etc/apache2/ssl/cert.pem file /etc/apache2/...
user avatar
63 votes
2 answers
93k views

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" ...
Soviero's user avatar
  • 4,366
61 votes
4 answers
129k views

How to redirect root and only root via htaccess?

I want to redirect only my root to another url, but maintain all the /sub/directories where they belong (and redirect) example: mysite.com/1 redirects to somewhere mysite.com/admin opens a page i ...
user avatar
60 votes
3 answers
67k views

Do Apache config files support block commenting?

You can use # to comment out individual lines. Is there a syntax for commenting out entire blocks? I've tired surrounding the block (specifically a <Directory> block) with <IfModule asdfasdf&...
ripper234's user avatar
  • 5,970
58 votes
8 answers
117k views

Apache: SSLCertificateKeyFile: file does not exist or is empty

I am configuring SSL for Apache 2. My system is Ubuntu Server 10.04 LTS. I have the following settings related to SSL in my vhost configuration: SSLEngine On SSLCertificateKeyFile /etc/ssl/private/...
blueFast's user avatar
  • 4,260
56 votes
6 answers
176k views

How to configure basic authentication in Apache httpd virtual hosts?

I'm trying to configure mercurial access using Apache http. It requires authentication. My /etc/apache2/sites-enabled/mercurial looks like this: NameVirtualHost *:8080 <VirtualHost *:8080> ...
Jader Dias's user avatar
  • 4,735
56 votes
6 answers
106k views

Can an SSL certificate be on a single line in a file (no line breaks)?

SSL certificates by default have line breaks after 67 characters. I'm trying to create SSL certificate files using Chef. Essentially I want to create the entire certificate file from a string variable ...
wrangler's user avatar
  • 3,130
56 votes
3 answers
66k views

How to fix 'logjam' vulnerability in Apache (httpd)

Recently, a new vulnerability in Diffie-Hellman, informally referred to as 'logjam' has been published, for which this page has been put together suggesting how to counter the vulnerability: We have ...
Christophe De Troyer's user avatar
56 votes
5 answers
58k views

Which to install: Apache Worker or Prefork? What are the (dis-)advantages of each?

Based on the descriptions for both the Prefork and Worker MPM, it seems the prefork type is somewhat outdated, but I can't really find a proper comparison of the two types. What i'd like to know: ...
Aron Rotteveel's user avatar
53 votes
7 answers
244k views

How do I make Apache Web Server listen on two different ports?

I'd like an Apache Web Server I have installed at home to listen on port 80 and port 8080. I've added Listen 8080 to httpd.conf and restarted the Apache services but the server doesn't seem to be ...
Owen's user avatar
  • 643
53 votes
4 answers
111k views

Difference between SSLCertificateFile and SSLCertificateChainFile?

Normally with a virtual host an ssl is setup with the following directives: Listen 443 SSLCertificateFile /home/web/certs/domain1.public.crt SSLCertificateKeyFile /home/web/certs/domain1.private....
chrisjlee's user avatar
  • 1,015
53 votes
2 answers
59k views

difference between _default_:* and *:* in VirtualHost Context

I want to know the difference between "default:*" and "*:*" in VirtualHost Context. <VirtualHost _default_:*> #... ServerName host.example.com #... </VirtualHost> <...
Luigi Giuseppe's user avatar
52 votes
8 answers
110k views

Ubuntu Apache: httpd.conf or apache2.conf?

which one of these two files should I use to configure Apache? The httpd.conf is empty, while apache2.conf is not. It confuses me!
ajsie's user avatar
  • 1,245
51 votes
10 answers
111k views

How do I tell if apache is running as prefork or worker?

How do I tell if apache is running (or configured to run) as prefork or worker?
user avatar
50 votes
3 answers
152k views

stop apache from asking for SSL password each restart [duplicate]

Using instructions from this site but varying them just a little i created a CA using -newca, i copied cacert.pem to my comp and imported as trusted issuer in IE. I then did -newreq and -sign (note: i ...
user avatar
50 votes
3 answers
126k views

SElinux: allow httpd to connect to a specific port

My system is running CentOS 6.4 with apache2.2.15. SElinux is enforcing and I'm trying to connect to a local instance of redis through my python/wsgi app. I get Error 13, Permission denied. I could ...
savagecitizen's user avatar
50 votes
8 answers
27k views

How much of a performance hit for https vs http for apache?

Roughly how much of a performance hit will https take compared to http for the same page? Suppose I can handle 1000 requests/s for abc.php, how much will it decrease by when accessed through https? I ...
erotsppa's user avatar
  • 2,133
50 votes
2 answers
26k views

What does the suffix .d mean in Linux?

I am configuring apache and by default I have the directories /etc/httpd/conf and /etc/httpd/conf.d. What is the difference? Also you can see the suffix in many other directories like /etc/init.d, /...
SCL's user avatar
  • 895
49 votes
2 answers
71k views

How does Apache merge multiple matching Location sections

I'm working on some basic apache configuration, but I don't understand precisely how apache merges different <Location> sections when several of them match an incoming requests URL. The apache ...
LordOfThePigs's user avatar
48 votes
5 answers
91k views

How can I tell which config file Apache is using?

I'm trying to set up virtual hosts on Mac OS X. I've been modifying httpd.conf and restarting the server, but haven't had any luck in getting it to work. Furthermore, I notice that it's not serving ...
Claudiu's user avatar
  • 1,207
48 votes
2 answers
159k views

Serve http (port 80) and https (port 443) on same VirtualHost

I need to setup my VirtualHost on Apache to serve on both http and https (using standard ports) If I enable the SSL Engine (as per below) - I get an error when on port 80. The reason is, parts of ...
kron's user avatar
  • 755

1
2 3 4 5
346