Historically this is the main apache configuration file. In recent installations, the main file can also be called apache2.conf

learn more… | top users | synonyms

28
votes
2answers
23k views

_default_ VirtualHost overlap on port 443, the first has precedence

I have two ruby on rails 3 applications running on same server, (ubuntu 10.04), both with SSL. Here is my apache config file: <VirtualHost *:80> ServerName example1.com DocumentRoot ...
14
votes
4answers
14k 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 ...
11
votes
2answers
1k views

best way to handle thousands of permanent redirects

We've a list of 3000 301 redirects. We need assistance on What would the best place to put these? It seems putting these 3000 lines inside vhost in httpd.conf would be a mess. What are recommended ...
11
votes
2answers
11k views

Display Apache Configuration

Is there any way to display the effective configuration values that Apache is using? I have a cPanel server that uses multiple include files and there are some server-wide settings that are defined ...
9
votes
2answers
9k views

How to find out which httpd.conf apache is using at runtime

I've always struggled to find this: How can you ask apache which httpd.conf file it used to load up? It becomes difficult when you have a number of instances of apache running, or if you haven't ...
8
votes
3answers
6k views

Limit upload file size and redirect user to error page if limit exceeds

Is it possible to redirect user to file file too big page when POST request size exceeds specified limit? I am aware about max-request-size option, but it gives just static page that cannot be ...
7
votes
3answers
15k views

Make apache only accessible via 127.0.0.1, is this possible?

I've set up my Apache server, and the PHP/MySQL works well! But the issue is, how do I keep this private, since it's a development-only server? The only reason for keeping the content private is if a ...
6
votes
6answers
5k views

Can RHEL 4 have two instances of apache httpd running using two different config files?

We have a Red Hat Enterprise Linux 4 instance running Apache on the default port. We want to add a second Apache instance that we can restart completely separate from the first instance. Can we do ...
6
votes
2answers
1k views

httpd.conf variables : What is the difference between ${var} and %{var}?

What is the difference between ${var} and %{var} in httpd.conf? How and when would one use ${} and %{}? http://httpd.apache.org/docs/2.4/configuring.html mentions : The values of variables ...
5
votes
2answers
5k views

How can I redirect any ServerAlias to the respective ServerName?

I want to 301 redirect all example.org to www.example.org. The following example is doing just that, but it's got a lot of noise to it and is thus hard to maintain and error prone: <VirtualHost ...
5
votes
3answers
5k views

Running out of swap space on web servers, what to do?

I have 2 LAMP web servers that are routinely running out of swap space (see attached top screenshot). Apache's settings are as follows: <IfModule prefork.c> StartServers 64 ...
5
votes
1answer
10k views

Difference between <Location> and <Directory> Apache directives

I have Zend Server installed and noticed something like the following was added to my httpd.conf file: <Location /ZendServer> Order Allow,Deny Allow from 127.0.0.1 </Location> Alias ...
5
votes
2answers
8k views

What are the steps to setup git-http-backend w/ Apache on Windows?

I would like setup a Git server using the "Smart-HTTP" approach. However, I'm having difficulties getting it to work in Windows, and I'm new to Apache. My httpd.conf, in part: SetEnv ...
5
votes
1answer
4k views

If directive not working in apache VirtualHost conf, says “Invalid command”

Why?? <VirtualHost *:80> ServerAdmin admin@mydomain.com DirectoryIndex index.php <If "%{SERVER_PROTOCOL} != 'HTTPS'"> Redirect / ...
5
votes
1answer
3k views

Where do I place the WSGIPythonHome directive in the httpd.conf file?

I have searched the entire file for a place to put the directive, but I have no idea where to put it, and the internet doesn't seem to have a good answer either, or maybe I'm just not good at ...
4
votes
1answer
5k views

Do I need to restart/reload apache when adding a configuration file under /etc/httpd/conf.d

Do you need to restart/reload Apache when adding a configuration file under /etc/httpd/conf.d? I know that editing the httpd.conf need a restart or a reload but unsure if file placed in the conf.d ...
4
votes
2answers
1k views

Apache MaxClients Issue

In my error logs I see: server reached MaxClients setting, consider raising the MaxClients setting My MaxClients setting is 150. However when I calculate what seems to be an optimal MaxClients ...
4
votes
1answer
3k views

how to rewrite '%25' in url

My website software replaces space characters with '+' characters in the URL, A proper link would look like 'http://www.schirmacher.de/display/INFO/How+to+reattach+a+disk+to+XenServer' for example. ...
4
votes
4answers
8k views

Yet another (13)Permission denied error on Apache2 server

I just can't figure it out. I'm running apache2 on a Ubuntu 10.04 i386 server. Whenever I visit my server (has an IP address, and is connected to internet with static IP xxx.xxx.xxx.xxx) so that's not ...
4
votes
1answer
58 views

Apache: can ErrorLog be made to log also hostnames instead of IP addresses?

Having different Apache servers in a low-load int*ra*net with almost only DHCP clients, we need to log hostnames instead of IP addresses. As the DHCP environment is quite dynamic, any later attempt to ...
4
votes
1answer
368 views

Apache HTTPd : How is possible to display “Too many connections”

I want to limit the number of client allowed on my apache httpd server (mpm_prefork). When the number of client is reached, I want to display a custom error message such as "Error 503 : Too many ...
4
votes
1answer
171 views

Name Based Virtual Hosts in Apache

I'm having a little trouble configuring name based Virtual Hosts. I can start the server with "service apache2 start" with a blank httpd.conf file, and it will run with everything pointing to ...
4
votes
1answer
2k views

Apache mod_deflate not compressing javascript and css files?

"GET /Symfony/web/app.php/app/dashboard HTTP/1.1" 4513/37979 (11%) "GET /Symfony/web/css/application.css HTTP/1.1" -/- (-%) "GET /Symfony/web/js/application.js HTTP/1.1" -/- (-%) "GET ...
3
votes
5answers
6k views

Apache2 Proxy timeout

I have Apache2 with PHP + PHP-FPM configured according to: http://wiki.apache.org/httpd/PHP-FPM I am writing a script that will take a long time to execute on an internal Vhost, but keep getting ...
3
votes
3answers
1k views

Ignore heartbeat in Apache access logs

We have that nice/awesome Fogbugz tools that is running on our production server. The problem is that this server handles more than 400 domain names and more than 20 real websites. The logs are ...
3
votes
1answer
987 views

Why is my Apache in an infinite redirection loop?

We currently have an internal site set up for IT at it.example.com, which hosts a single Redmine site. I want to set up Apache so that if a user goes to kb.example.com it redirects them to ...
3
votes
4answers
732 views

Only allow the POST method for a specific file in a directory

I have one file that should only be accessible via the POST method. /var/www/folder/index.php The document root is /var/www/ and index.php is nested inside a folder. Version of Apache is: 2.4.4. ...
3
votes
1answer
320 views

Is it possible to rewrite some query strings to HTTPS and keep everything else on HTTP?

I'm rewriting query strings to pretty URIs, example: index.php?q=/en/contact becomes /en/contact and all works nicely.. # httpd.conf # HANDLE THE QUERY RewriteCond %{REQUEST_FILENAME} !-f ...
3
votes
1answer
65 views

How do you http-auth all sites on a server?

I'm setting up a development server and need to apply these basic rules to all virtual hosts on the server in the /var/www/html directory. AuthType Basic AuthName "Development Area" AuthUserFile ...
3
votes
1answer
47 views

Does apache apply directives sequentially?

I am fresh new with apache and I could not easily google the answer. Will same directive found further inside httpd.conf override the former? For example: Timeout 400 Timeout 500 Is resultant ...
3
votes
1answer
703 views

Security question about httpd.conf AllowOverride setting

I am working on a website where I will need to use rewriting commands in .htaccess. It is not working and finally have traced the problem where I will need to set "AllowOverride All" in my Apache ...
3
votes
1answer
504 views

Running a file without extension as CGI-script outside /cgi-bin

It seems like I'm the first person wanting to do this... It was really easy to solve with lighttpd, but with apache this seems impossible. Basically I want to run a cgi-file without extension outsite ...
3
votes
2answers
38k views

Accessing localhost (xampp) from another computer over LAN network - how to? [closed]

I have just set up a wi-fi network at home. I have all my files on my desktop computer (192.168.1.56) and want to access localhost over there from another computer (192.168.1.2). On my desktop I can ...
3
votes
2answers
5k views

Why is allow not allowed here in apache2

I've the following in my httpd.conf file: <Directory "/www"> Options Indexes FollowSymLinks AllowOverride AuthConfig FileInfo Options=Indexes,Limit Order allow,deny Allow from ...
3
votes
1answer
120 views

Apache2 Basic Auth: user@ip, user2@ip2 - Is this possible?

I am looking at running an external service for clients to use here in my office while clients are working remotely at their office. Assumptions: Both my office IP and clients office IP are static. ...
3
votes
1answer
161 views

Set top level directory to be handled by Perl?

I have an Apache server set up to use mod_perl. I have it set up to handle all requests using a Perl module MyModule. Here is part of my httpd.conf: LoadModule perl_module modules/mod_perl.so ...
3
votes
3answers
377 views

How can I make Apache look in 2 separate directories with one common url ? follow-up question

This is a follow-up question to my previous question on this site. Maybe I should point out that the Apache server is running on a windows system, don't know if it matters. My problem is following: ...
3
votes
2answers
1k views

Why a SIGHUP signal to httpd kills the tomcat process?

I have a server with a tomcat process binding to port 80 and a httpd processes binding to port 5000. For some reason every time any process send a SIGHUP signal to httpd process my tomcat process ...
2
votes
2answers
334 views

How Options work in Apache

Into the original httpd.conf, I have Options Indexes FollowSymLinks I created a config file in /etc/httpd/conf.d/ with NameVirtualHost 192.168.0.2:8009 <VirtualHost 192.168.0.2:8009> ...
2
votes
2answers
2k views

Apache deny from CIDR range but allow from IP within that range

I am using a long CIDR blacklist to block several countries from a site, but I need to allow specific IP addresses within the blocked CIDR ranges. Here's an excerpt of my conf file (this is the order ...
2
votes
2answers
229 views

Virtual server problem in apache's httpd.conf

When I use the following code: <VirtualHost *> ServerName subone.domain.tld DocumentRoot /var/www/subdomain/subone/ </VirtualHost> <VirtualHost *> ServerName subtwo.domain.tld ...
2
votes
4answers
162 views

Apache Security Config - Ubuntu 12

I am running a LAMP stack on Ubuntu 12, with the primary function to serve a PHP based API. There is only one file I want to be exposed to the public called: api.php It needs to reference a config ...
2
votes
3answers
125 views

Can i set 443 as default web port which means it can only be accessed via https and no port 80

As title says, I want to set my apache to listen on 443, and will configure SSL. So, My Question is :- 1). Does that mean, i will not have port 80 or any other port which is no ssl ? 2). My site ...
2
votes
2answers
97 views

Small confusion with access control directives in Apache

The access control to my server is defined like this: Order allow,deny Allow from 127.0.0.1 And this works the way I want it. First, only access from the local machine is allowed and then ...
2
votes
3answers
591 views

htaccess vrs httpd.conf?

Is it still true that you shouldn't use htaccess files if you can use httpd.conf? The Apache site says "In general, you should never use .htaccess files unless you don't have access to the main ...
2
votes
1answer
733 views

.htaccess not working on Cent Os 6.4

I have installed Cent Os 6.4 -Final Version and set the environment for PHP web development. My application uses the .htaccess for url rewrite & denying direct access of files. my configuration ...
2
votes
1answer
37 views

Is RewriteEngineOn used only once in httpd.conf or can it be used multiple times?

I read that a directory block in httpd.conf is like a .htaccess file. Does that mean that RewriteEngineOn can be used multiple times within httpd.conf? I'm assuming that it can be but it must be ...
2
votes
3answers
9k views

Restarting the httpd service in RHEL returns “Stopping httpd: [FAILED]” - How do I fix this?

This is my first indication of an issue: $ sudo /sbin/service httpd restart Stopping httpd: [FAILED] Starting httpd: no listening sockets available, ...
2
votes
4answers
277 views

Macro, template, function or something similar to apache's conf files

Following another question I just solved, I wonder: is there anything we can do within Apache to avoid repeating lines of configuration? What about outside apache? In my case it would be AWS EC2's ...
2
votes
2answers
613 views

Use the ServerName as a variable in httpd.conf file

My current httpd.conf file looks something like this: <VirtualHost *:443> DocumentRoot /var/www/html/www.example1.com ServerName www.example1.com SSLEngine on SSLCertificateFile ...