Apache configuration is text based configuration file (or set of files) which are used to configure apache httpd web server
Questions tagged [apache-config]
264 questions
155
votes
13 answers
.htaccess ErrorDocument 404 not showing up
I have a server from AWS EC2 service running on Linux ubuntu and I have installed apache, php, and mysql.
I have added a .htaccess file in my document root /var/www/html.
I entered this code in it:
ErrorDocument 404 /var/www/html/404.php and it is…

Shalin Shah
- 8,145
- 6
- 31
- 44
151
votes
13 answers
How to change the default encoding to UTF-8 for Apache
I am using a hosting company and it will list the files in a directory if the file index.html is not there. It uses ISO 8859-1 as the default encoding.
If the server is Apache, is there a way to set UTF-8 as the default instead?
I found out that it…

nonopolarity
- 146,324
- 131
- 460
- 740
133
votes
2 answers
how to use "AND", "OR" for RewriteCond on Apache?
Is this how to use AND, OR for RewriteCond on Apache?
rewritecond A [or]
rewritecond B
rewritecond C [or]
rewritecond D
RewriteRule ... something
becomes if ( (A or B) and (C or D) ) rewrite_it.
So it seems like "OR" is higher precedence than…

nonopolarity
- 146,324
- 131
- 460
- 740
126
votes
9 answers
index.php not loading by default
I have just installed CentOS, Apache and PHP. When I visit my site http://example.com/myapp/, it says "forbidden". By default it's not loading the index.php file.
When I visit http://example.com/myapp/index.php, it works fine.
Any idea how to fix…

001
- 62,807
- 94
- 230
- 350
117
votes
8 answers
Configure apache to listen on port other than 80
I use centOS server. I want to configure apache to listen on port 8079.
I added LISTEN 8079 directive in httpd.conf.
I opened port 8079 in iptables and restarted iptables. I even stopped iptables service.
"netstat -nal | grep 8079" shows "tcp 0 0…

vivek.m
- 3,213
- 5
- 33
- 48
84
votes
7 answers
Need to allow encoded slashes on Apache
I'm currently trying to place a URL within a URL. For example:
http://example.com/url/http%3A%2F%2Fwww.url2.com
I'm aware that I have to encode the URL, which I have done, but now I am getting a 404 error back from the server rather than my app. I…

tommizzle
- 1,009
- 1
- 10
- 11
78
votes
9 answers
Best way to log POST data in Apache?
Imagine you have a site API that accepts data in the form of GET requests with parameters, or as POST requests (say, with standard url-encoded, &-separated POST data). If you want to log and analyze API calls, the GET requests will be easy, because…

Kevin Weil
- 1,549
- 2
- 14
- 17
60
votes
6 answers
How can I prevent tons of apache processes spawning when I start apache and proceeding to kill my machine?
I have a highly trafficked application on one debian machine and apache has started acting strange.
Every time I start apache, tons of apache processes are spawned, the app doesn't load at all, and very quickly the whole machine freezes and must be…

Adam Gries
- 1,751
- 3
- 14
- 12
52
votes
3 answers
Restart httpd after changes in the httpd.conf
Do I need to restart httpd after changes in the httpd.conf file for changes to take effect?

X10nD
- 21,638
- 45
- 111
- 152
46
votes
1 answer
How can I make a virtual host accept multiple domains?
I have two different domains I want to use for this website, how can I configure the virtual host to make this work?
Is it possible to assign it more than one server name?

agente_secreto
- 7,959
- 16
- 57
- 83
40
votes
8 answers
Virtual host on ubuntu 13.10 and apache 2.4.6
I have the following problem
My hosts file is as follows:
127.0.0.1 localhost
127.0.1.1 barbala4o-HP-ProBook-4530s
127.0.1.1 mysite.localhost
My file in the /etc/apache2/sites-available/mysite.localhost.conf is as follows :…

Lachezar Raychev
- 2,113
- 4
- 24
- 34
36
votes
2 answers
Is it possible to use variables in httpd.conf
Is there a way to use variables of some sort in an apache httpd.conf file? I'd like to define a value and use it throughout a block, as in
define myvar somename #or whatever the syntax would be
alias /my/path "/some/path/${myvar} #or whatever the…

Paul Spencer
- 1,355
- 1
- 8
- 16
28
votes
4 answers
How to check mod_headers and mod_expires modules enabled in apache
I want to check whether mod_headers and mod_expires modules enabled or not in my server
Is there a way available to list apache enabled/disabled modules using some php function just like we list php information with phpinfo(); function?

Giri
- 4,849
- 11
- 39
- 48
27
votes
3 answers
Apache Port Proxy
I have a non-Apache server listening to port 8001 and Apache listening port 80. I want a certain virtual domain to actually be served by the non-Apache server over port 80.
Example:
Servername example.com
# Forward this on…

Dave
- 1,658
- 3
- 17
- 19
26
votes
4 answers
How do I run Django and PHP together on one Apache server?
I can currently run either Django through mod_wsgi or PHP on my Apache server.
My Django projects run at: http://localhost and source is at C:/django_proj
My PHP projects run at: http://php.localhost and source is at C:/web
If I turn both on,…

Thierry Lam
- 45,304
- 42
- 117
- 144