Questions tagged [httpd.conf]

httpd.conf is a typical name for a web server configuration file. Historically this is the main Apache configuration file. It is also the configuration file for OpenBSD httpd.

Filter by
Sorted by
Tagged with
69 votes
4 answers
105k 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 /home/me/...
Mohit Jain's user avatar
54 votes
2 answers
60k 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
49 votes
2 answers
141k 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 /...
rfgamaral's user avatar
  • 1,000
48 votes
5 answers
93k 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
41 votes
5 answers
77k 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 ...
user avatar
29 votes
9 answers
109k 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 ...
wyqydsyq's user avatar
  • 405
28 votes
4 answers
102k views

Include files in Apache HTTP Server Version 2.2 httpd.conf

I have a large httpd.conf file, most of which is virtual hosts. Is there a way to make a file, say virtual_hosts.conf, and include it from httpd.conf? I've googled a bit, but can't seem to find much ...
Josh's user avatar
  • 425
23 votes
2 answers
8k views

Apache: What is the 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 ...
ucker's user avatar
  • 245
22 votes
3 answers
64k 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 ...
linthurst53's user avatar
20 votes
1 answer
28k 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 ...
Dave Forgac's user avatar
  • 3,596
17 votes
8 answers
61k views

How to disable the default document root in Apache?

I host some websites on my server running Apache Httpd. Each website has it's own domain or sub-domain and virtual host. Therefore, I need no default document root. Is it possible to disable ...
danijar's user avatar
  • 403
14 votes
4 answers
4k views

Load time impact of htaccess

There are in general two possibilities of handling stuff on Apache: make configurations for folders one by one using htaccess file to fully resign htaccess and put all the rules into the httpd.conf ...
Evgeniy's user avatar
  • 255
9 votes
3 answers
13k 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 ...
jonny's user avatar
  • 357
9 votes
2 answers
30k 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 ...
user569825's user avatar
9 votes
3 answers
23k views

Catch-All HTTPS Vhost on Apache 2.4

Is it possible to configure a catch-all (default) HTTPS Vhost on Apache 2.4? I currently have 4 domains, and an HTTP catch all but as soon as I try to add any sort of configuration my other vhosts ...
Nicolas Bouvrette's user avatar
9 votes
3 answers
27k views

How can I block a user agent from all sites on my server?

I originally this posted at webmasters.stackexchange.com, but was told I'd get a better reception here. For the last few days, I've been suffering from what appears to be a (presumably inadvertent) ...
Tom Wright's user avatar
9 votes
2 answers
11k 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 ...
RonSper's user avatar
  • 193
9 votes
1 answer
10k 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 ...
jasonaburton's user avatar
9 votes
2 answers
12k views

Apache Header Module Loaded but can't set headers in htaccess

I have Apache 2.2.29 (unix) setup and running on my new dev machine (mac). I am trying to set CORS headers for an API project - something that I have done many times. The htaccess file for the ...
Dan Lake's user avatar
8 votes
3 answers
11k 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 MinSpareServers ...
mmattax's user avatar
  • 1,314
8 votes
2 answers
7k views

Apache Conditional Redirect HTTP to HTTPS

all. I have a syntax problem. I've tried following other sources, but It's just not working. I've successfully created an unconditional HTTP to HTTPS redirect. Go to http://www.robjvargas.com, ...
Rob Vargas's user avatar
8 votes
2 answers
6k 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 ...
Daniel Ziltener's user avatar
8 votes
1 answer
8k views

is "ServerAdmin [email protected]" required in the VirtualHost in Apache?

I rather not have ServerAdmin in my VirtualHost because all it does is attract spam. has no use what so ever. can it be ignored ?
user235927's user avatar
8 votes
1 answer
20k views

Is there a way to increase the maximum allow url length for incoming requests on Apache HTTPd?

I'm running a web services site on Apache HTTPd and every once in while I get an error indicating the incoming URL is too long (HTTPError: HTTP Error 414: Request-URI Too Large). My site is servicing ...
Boaz's user avatar
  • 2,259
8 votes
2 answers
6k 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 ...
X10's user avatar
  • 205
8 votes
1 answer
4k views

Apache (Linux) httpd listen on link-local IPv6 address

I would like Apache to listen on the link-local ipv6 address on a particular interface. I have the following line in my httpd.conf: Listen [fe80::a00:16ff:fe89:420f]:80 Which is based on the Apache ...
bao7uo's user avatar
  • 1,714
8 votes
1 answer
16k views

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

Why?? <VirtualHost *:80> ServerAdmin [email protected] DirectoryIndex index.php <If "%{SERVER_PROTOCOL} != 'HTTPS'"> Redirect / https://www.mydomain....
NotGaeL's user avatar
  • 277
8 votes
2 answers
10k views

Warning in Apache log: Cannot get media type from 'x-mapp-php5'

I have no idea what is causing this issue, but it seems to be related to the displayed file (just a simple index.php to print phpinfo) being in an aliased directory. Any suggestions what I can do to ...
IronGoofy's user avatar
  • 201
7 votes
6 answers
8k 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 ...
Geo's user avatar
  • 3,081
7 votes
1 answer
25k 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 ...
hjpotter92's user avatar
7 votes
3 answers
3k views

Apache: Testing against multiple module

We can use Apache's IfModule directive to test presence or absence of a specific module. Apache also allows nested IfModule directives which can be used to test multiple modules, in other words we can ...
Emre Yazici's user avatar
6 votes
3 answers
3k 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 ...
nedlud's user avatar
  • 273
6 votes
1 answer
14k views

Can't restart httpd.service on CentOS 7 (Apache server)

I used the command "service httpd restart" on my centOS apache server, and the following error occurred: Job for httpd.service failed because the control process exited with error code. See "...
Denise's user avatar
  • 273
6 votes
3 answers
19k views

PHP memory_limit local value does not match php.ini value

CentOS system. Summary: changed memory_limit in master and local php.ini and yet no change in the local value for a particular virtual host. Trying to improve performance, I set the memory_limit to ...
Buttle Butkus's user avatar
6 votes
3 answers
29k 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, ...
ghbarratt's user avatar
  • 163
6 votes
1 answer
4k 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 ...
forestclown's user avatar
6 votes
2 answers
14k 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 ...
Jordan's user avatar
  • 163
5 votes
1 answer
24k views

Setting up IPv6 on Apache2

Currently I have the "ports.conf" with the following content: NameVirtualHost *:80 Listen 80 <IfModule mod_ssl.c> Listen 443 NameVirtualHost *:443 </IfModule> <IfModule ...
kghbln's user avatar
  • 441
5 votes
1 answer
10k 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 ...
Adam Benayoun's user avatar
5 votes
5 answers
42k views

Apache doesn't log remoteIP when RemoteIPHeader X-Forwarded-For is present

I'm using Apache/2.4.27 Within the VirtualHost I'm forwarding the remote client IP header from the Loadbalancer with: RemoteIPHeader X-Forwarded-For Which is needed by the application served by ...
DaWe4444's user avatar
  • 131
5 votes
3 answers
19k 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. My ...
Dave Chen's user avatar
5 votes
3 answers
38k views

Apache 2.4 updated, now throws: Cannot define multiple Listeners on the same IP:port

I've just updated Apache to 2.4.3 on my AWS instance (running Linux AMI). After the update finished, Apache crashed with the following: Starting httpd: AH00526: Syntax error on line 5 of /etc/httpd/...
Edmond Tamas's user avatar
5 votes
1 answer
8k views

OpenBSD: How to use `relayd` and `httpd` for redirecting subdomain requests

Situation I created the following setup on OpenBSD: So I have my OpenBSD server on 192.168.1.250 redirecting all http-requests to the host-vm on 192.168.30.2. The host-vm itself operates nginx for ...
Jan's user avatar
  • 107
5 votes
1 answer
5k views

How to impose two conditions at once for Apache CustomLog?

I currently have separate access logs for static and dynamic pages. My httpd.conf has (inside <VirtualHost>): <LocationMatch "^/(img|js|css|thumb|banner)/(.+)$"> SetEnv static 1 </...
mkaama's user avatar
  • 191
5 votes
1 answer
11k 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 http://it....
DOOManiac's user avatar
  • 811
5 votes
3 answers
27k views

How add SSL/443 to Apache server without virtual host?

I have an apache server set up on CentOS. I am trying to add SSL. I was able to create the certificate and keys and then updated /etc/httpd/conf.d/ssl.conf to have the following configurations: /etc/...
Don Rhummy's user avatar
5 votes
2 answers
2k 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 ...
Lothar_Grimpsenbacher's user avatar
5 votes
2 answers
15k views

Apache rewrite all URLs to lowercase if contains at least one uppercase

I have been trying to get Apache to rewrite all URL's that contain an uppercase character anywhere in it to be lowercase. All the solutions I have found do not work in my case for some reason. I am ...
BigB8767's user avatar
5 votes
1 answer
6k views

Settings in httpd.conf not working

I have the following (maybe very simple) problem: I have a fresh install of apache2 on debian. In my /etc/apache2 directory I have an apache2.conf and a httpd.conf. I thought that any change I need ...
sleepless's user avatar
  • 221
5 votes
1 answer
186 views

VirtualHost Defaulting to Wrong Deployment on Restart

We have a server running seven domains/subdomains. To try to go as minimal as possible here I'll include four of them. example.com www.example.com dwf.example.com chris.example.com The server works ...
chris85's user avatar
  • 81

1
2 3 4 5
13