Apache local virtual host is listed but doesn't work - apache

I need help configuring my website to be accessed in the local server as a virtual directory in Apache.
I am trying to use the port 8050, and when i open localhost:8050 , it shows:
This site can’t be reached
localhost refused to connect. ERR_CONNECTION_REFUSED
when i try to access my localhost:80 in the browser, it shows the default blank page with the message "It Works"
if i change my virtualhost to *.80 in the config, it keeps showing the default message "It Works", instead of my page.
apachectl -t returns Syntax OK
the command:
apachectl -t -D DUMP_VHOSTS returns:
VirtualHost configuration:
*:8050 personal.com (/private/etc/apache2/extra/httpd-vhosts.conf:24)
the Servername in my httpd.conf file is localhost, and it also contains:
Listen 8050
and
Listen localhost:8050
this is my httpd-vhosts in etc/apache2/extra/httpd-vhosts.conf:
<VirtualHost *:8050>
ServerAdmin webmaster#dummy-host2.example.com
DocumentRoot "/Users/renatobento/Documents/Projetos/Personal"
ServerName personal.com
ErrorLog "/private/var/log/apache2/personal.com-error_log"
CustomLog "/private/var/log/apache2/personal.com-access_log" common
<Directory "/Users/renatobento/Documents/Projetos/Personal">
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
The path "/Users/renatobento/Documents/Projetos/Personal" seems correct, and contains a simple index.html with some content, which works in the browser with file protocol: "file:///Users/renatobento/Documents/Projetos/personal/index.html"
Already executed
apachectl stop , apachectl start , and apachectl restart thousand times
after the stop command, the localhost:80 still shows the message "It Works"
I am using MAC OSX 10.3 high sierra, apache 2.4
Server version: Apache/2.4.33 (Unix) Server built: Apr 3 2018
23:45:11 Server's Module Magic Number: 20120211:76 Server loaded: APR
1.5.2, APR-UTIL 1.5.4 Compiled using: APR 1.5.2, APR-UTIL 1.5.4 Architecture: 64-bit Server MPM: prefork threaded: no
forked: yes (variable process count) Server compiled with.... -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_FLOCK_SERIALIZE -D
APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D
APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D
DYNAMIC_MODULE_LIMIT=256 -D HTTPD_ROOT="/usr" -D
SUEXEC_BIN="/usr/bin/suexec" -D
DEFAULT_PIDLOG="/private/var/run/httpd.pid" -D
DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D
DEFAULT_ERRORLOG="logs/error_log" -D
AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types" -D
SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"
edit:
tried with a different port :9050 but still not working

Check whether permissions for DocumentRoot
/Users/renatobento/Documents/Projetos/Personal
are set to be accessible for everyone.
Your overall config seems to be good.
Check your /etc/hosts file, if it contains something like
127.0.0.1 localhost
127.0.0.1 personal.com
To edit this file, type sudo nano /etc/hosts in Terminal and after editing, type sudo killall -HUP mDNSResponder to flush DNS cache.

Problem solved.
Weird, looks like restarting Apache and cache commands sometimes are not enough.
The message changed to 403-forbidden after a system restart.
I checked the ports with
lsof -nP -i4TCP:80 | grep LISTEN
lsof -nP -i4TCP:8050 | grep LISTEN
lsof -nP -i4TCP:9050 | grep LISTEN
and it showed 4 httpd process listening to :80 even with apache stopped, then after a reboot appeared a process listening in the correct port.

Related

Could not reliably determine the server's fully qualified domain name ... How to solve it in Docker?

I am just starting in Docker and I was following that tutorial that shows basically these steps:
Create a Dockerfile like this:
From php:7.0-apache
copy src/ /var/www/html
EXPOSE 80
Build the container from where I have my dockerfile:
$ docker build -t mytest .
After the image "mytest" is generated I run it with:
$ docker run -p 80 mytest
That is what I get as error:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Sun Sep 17 16:25:12.340564 2017] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) PHP/7.0.23 configured -- resuming normal operations
[Sun Sep 17 16:25:12.340666 2017] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
So, I don't know how to solve it. Any idea?
I'd like to offer another (maybe more Docker-ish) way of solving the warning message. But first, it makes sense to understand what Apache is actually doing to figure out the domain name before just blindly setting ServerName. There is a good article at http://ratfactor.com/apache-fqdn.html which explains the process.
Once we can confirm that getnameinfo is what Apache uses to lookup the name and that it uses /etc/nsswitch.conf to determine where to go first for the lookup, we can figure out what to modify.
If we check out the nsswitch.conf inside the container we can see that it looks up hosts in the /etc/hosts file before external DNS:
# cat /etc/nsswitch.conf | grep hosts
hosts: files dns
Knowing this, maybe we can influence the file at Docker runtime instead of adding it to our configuration files?
If we take a look at the Docker run reference documentation there is a section on the /etc/hosts file at https://docs.docker.com/engine/reference/run/#managing-etchosts. It mentions:
Your container will have lines in /etc/hosts which define the hostname of the container itself as well as localhost and a few other common things.
So, if we just set the container hostname, it will get added to /etc/hosts which will solve the Apache warning. Fortunately, this is very easy to do with the --hostname or -h option. If we set this to a fully qualified domain name, Docker will set it in our /etc/hosts file and Apache will pick it up.
It is pretty easy to try this out. Example with the warning (no hostname):
$ docker run --rm php:7.0-apache
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Sun Sep 17 19:00:32.919074 2017] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) PHP/7.0.23 configured -- resuming normal operations
[Sun Sep 17 19:00:32.919122 2017] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
Now with the -h option set to a fully qualified domain name:
$ docker run --rm -h myapp.mydomain.com php:7.0-apache
[Sun Sep 17 19:01:27.968915 2017] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) PHP/7.0.23 configured -- resuming normal operations
[Sun Sep 17 19:01:27.968968 2017] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
Hope this helps answer the question and provide some learning about Apache and fully qualified domain names.
This is not an error it is just a warning and you can safely ignore it. What it is saying is that ServerName is not set so it will assume machine IP as the same.
If you look at the default configs present inside /etc/apache2/sites-available, you will find 000-default.conf and default-ssl.conf
root#d591ab6febff:/etc/apache2/sites-available# cat 000-default.conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster#localhost
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
The ServerName directive is commented in the config
#ServerName www.example.com
So if you are worried about the warning you should change it to the value you want like below
ServerName www.tarunlalwani.com
ServerAlias tarunlalwani.com
You would need to create a config in your folder and then overwrite the files from default config using Dockerfile. Then the warning would be gone.
Problem:
While running docker file giving below error:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
Solution:
goto root
goto etc file
then goto apache2
then nano apache2.conf file
and then below the line # The directory where shm and other runtime files will be stored. put a new line (Enter) and write:
ServerName localhost
Save the file and exit root and run the docker run command again, it will work.
Youtube video reference link for the same issue: Watch
If you are using docker do this: add ServerName localhost to apache2.conf from the Dockerfile and then restart the server
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
RUN service apache2 restart
this should get rid of the warning.
you can also do this from the terminal
echo "ServerName localhost" >> /usr/local/etc/apache2/apache2.conf
and don't forget to restart your server
sudo systemctl restart apache2
The error should be gone after the server restart.
To avoid that warning, you can set the ServerName with you IP.
See this example: tagplus5/docker-php/7-apache/Dockerfile
apt-get install -y --no-install-recommends iproute2 apache2 php7.0 libapache2-mod-php7.0 \
php7.0-mysql php7.0-sqlite php7.0-bcmath php7.0-curl ca-certificates && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* && \
echo "ServerName $(ip route get 8.8.8.8 | awk '{print $NF; exit}')" >> /etc/apache2/apache2.conf && \
(although iproute can work differently on a Mac: it depends on your host. See iproute2mac issue 8)
I use to add
sed -i -e 's/Listen 80/Listen 80\nServerName localhost/' /etc/apache2/ports.conf
either to the Dockerfile or to the entrypoint file if used.

using certbot-auto for nginx

I have an nginx running.
Now I want my nginx to use SSL:
certbot-auto --nginx -d my.domain.com -n --agree-tos --email admin#mail.com
OUTPUT:
Performing the following challenges:
tls-sni-01 challenge for my.domain.com
Cleaning up challenges
Cannot find a VirtualHost matching domain my.domain.com.
my.domain.com is pointing to the IP of my server. It's its dns name.
What am I doing wrong? I did this already for apache and it was working fine. My nginx is running (and I'm not able to restart it manually after the certbot-auto but this wasn't necessary when I used certbot-auto --apache
In my case, I had to add the "server_name" line because it wasn't in my nginx config so it was giving me the error message "Cannot find a VirtualHost matching domain my.domain.com" when I ran:
certbot --nginx
Make sure this is in your config:
server {
server_name my.domain.com;
....
}
Your are probably missing some Server Blocks (virtual hosts) files in the sites-enabled folder. Check if your config files exist in /etc/nginx/sites-available and /etc/nginx/sites-enabled. If they are not present in the sites-enabled folder, create symbolic links for them:
$ sudo ln -s /etc/nginx/sites-available/my.domain.com /etc/nginx/sites-enabled/
Add your site, check for config errors and restart nginx:
$ sudo certbot --nginx -d my.domain.com
$ sudo nginx -t
$ sudo service nginx restart

Unable to reach default server web site with name-based vhost configuration

I'm currently using name-based virtual host configuration /conf/extra/httpd-vhosts.conf in apache to serve few different websites from the same IP address, just like in the apache documentation.
<VirtualHost *:80>
ServerName domain1.example.com
DocumentRoot /www/domain1
</VirtualHost>
<VirtualHost *:80>
ServerName domain2.example.com
DocumentRoot /www/domain2
</VirtualHost>
If I try to open a web site, that is configured in /conf/httpd.conf, defined by directive ServerName, which is basically FQDN of Linux server, I'm getting the very 1st page defined in /conf/extra/httpd-vhosts.conf - apache is acting that DNS name does not match any ServerName defined, therefore I'm getting the 1st one from /conf/extra/httpd-vhosts.conf.
If I change the directive Listen in /conf/httpd.conf to a different port (from that defined in /conf/extra/httpd-vhosts.conf; I'm using standard port 80) and then try to hit http://ServerName:Port (Port defined in Listen - I used 8000 for testing purpose), I'm getting content of web site configured in /conf/httpd.conf (ServerRoot), which is what I want.
I tried to change the port defined in /conf/extra/httpd-vhosts.conf to match it with that one temporary configured in /conf/httpd.conf e.g.:
<VirtualHost *:8000>
ServerName domain1.example.com
DocumentRoot /www/domain1
</VirtualHost>
<VirtualHost *:8000>
ServerName domain2.example.com
DocumentRoot /www/domain2
</VirtualHost>
Now, when I hit http://ServerName:Port (port = 8000), apache again gives me 1st web site from /conf/extra/httpd-vhosts.conf - domain1.example.com
I tried to update directives Listen (in /conf/httpd.conf) with server IP, IP:port but it does not work either.
My server has DNS A record, web sites in /conf/extra/httpd-vhosts.conf are configured in DNS as ALIAS records for server A record.
EDIT:
Adding ouput of apachectl -S:
VirtualHost configuration:
*:80 is a NameVirtualHost
default server domain1.example.com (/appl/apache24/conf/extra/httpd-vhosts.conf:24)
port 80 namevhost domain1.example.com (/appl/apache24/conf/extra/httpd-vhosts.conf:24)
alias domain1.example.com
port 80 namevhost domain2.example.com (/appl/apache24/conf/extra/httpd-vhosts.conf:38)
alias domain2.example.com
ServerRoot: "/appl/apache24"
Main DocumentRoot: "/appl/apache24/htdocs"
Main ErrorLog: "|/appl/apache24/bin/rotatelogs /appl/apache24/logs/admin-error_log.%Y%m%d 86400"
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/appl/apache24/logs/" mechanism=default
Mutex ssl-stapling-refresh: using_defaults
PidFile: "/appl/apache24/logs/httpd.pid"
EDIT2:
Adding output of apachectl -V:
Server version: Apache/2.4.23 (Unix)
Server built: Sep 21 2016 11:23:28
Server's Module Magic Number: 20120211:61
Server loaded: APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture: 64-bit
Server MPM: event
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/opt/app/workload/apache24"
-D SUEXEC_BIN="/opt/app/workload/apache24/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"

Apache/mod_wsgi process dies unexpectedly

I'm testing the limit of my Python Flask web application running on an Apache web server by making a request that takes over 30minutes to complete. The request requires thousands of database requests (one after the other) to a MySQL database. I understand this should ideally be run as a separate asynchronous process outside the apache server, but let's ignore that for now. The problem I'm having is that although this runs completely when I test it on my mac, it dies abruptly when running it on a linux server (Amazon linux on AWS EC2). I've not been able to figure out exactly what's killing it. I've checked that the server isn't running out of memory. The process uses very little RAM. I've not been able to find any Apache config parameter or any error message that makes sense to me (even after setting apache logLevel to debug). Please I need help on where to look. Here're more details about my setup:
Run Time
Server: It died after 8mins, 27mins, 21mins & 22mins respectively. Note that most of these runs were on a UAT server and this was the only request the server was processing.
Mac: It ran much slower that it runs on the server. The process ran successfully and took 2hours 47mins.
Linux Server details:
2 virtual CPUs and 4GB RAM
OS (output of uname -a)
Linux ip-172-31-63-211 3.14.44-32.39.amzn1.x86_64 #1 SMP Thu Jun 11 20:33:38 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Apache error_log: https://drive.google.com/file/d/0B3XXZfJyzJYsNkFDU3hJekRRUlU/view?usp=sharing
Apache config file: https://drive.google.com/file/d/0B3XXZfJyzJYsM2lhSmxfVVRNNjQ/view?usp=sharing
Apache version (output of apachectl -V)
Server version: Apache/2.4.23 (Amazon)
Server built: Jul 29 2016 21:42:17
Server's Module Magic Number: 20120211:61
Server loaded: APR 1.5.1, APR-UTIL 1.4.1
Compiled using: APR 1.5.1, APR-UTIL 1.4.1
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="/var/run/httpd/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
Mac details:
Apache config file: https://drive.google.com/file/d/0B3XXZfJyzJYsRUd6NW5NY3lON1U/view?usp=sharing
Apache version (output of apachectl -V)
Server version: Apache/2.4.18 (Unix)
Server built: Feb 20 2016 20:03:19
Server's Module Magic Number: 20120211:52
Server loaded: APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_FLOCK_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/usr"
-D SUEXEC_BIN="/usr/bin/suexec"
-D DEFAULT_PIDLOG="/private/var/run/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types"
-D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"
If you are using embedded mode of mod_wsgi that can happen as Apache controls the life time of processes and can recycle them if it thinks a process is no longer required due to insufficient traffic.
You might be thinking 'but I am using daemon mode and not embedded mode', but reality is that you aren't as your configuration is wrong. You have:
<VirtualHost *:5010>
ServerName localhost
WSGIDaemonProcess entry user=kesiena group=staff threads=5
WSGIScriptAlias "/" "/Users/kesiena/Dropbox (MIT)/Sites/onetext/onetext.local.wsgi"
<directory "/Users/kesiena/Dropbox (MIT)/Sites/onetext/app">
WSGIProcessGroup start
WSGIApplicationGroup %{GLOBAL}
WSGIScriptReloading On
Order deny,allow
Allow from all
</directory>
</virtualhost>
That Directory block doesn't use a directory which matches the path in WSGIScriptAlias, so none of it applies.
Use:
<VirtualHost *:5010>
ServerName localhost
WSGIDaemonProcess entry user=kesiena group=staff threads=5
WSGIScriptAlias "/" "/Users/kesiena/Dropbox (MIT)/Sites/onetext/onetext.local.wsgi"
<directory "/Users/kesiena/Dropbox (MIT)/Sites/onetext">
WSGIProcessGroup start
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</directory>
</virtualhost>
The only reason it worked at all without that matching is that you had opened up access to Apache to host files in that directory by having:
<Directory "/Users/kesiena/Dropbox (MIT)/Sites">
Require all granted
</Directory>
It is bad practice to also set DocumentRoot to be a parent directory of where your application source code exists. With the way it is written there is a risk I could come in on a different port or VirtualHost and download all your application code.
Do not stick your application code under the directory listed against DocumentRoot.
BTW, even when you have the WSGI application running in daemon mode, Apache can still recycle the worker processes it will use to proxy requests to mod_wsgi. So even if your very long running request keeps running in the WSGI application process, it could fail as soon as it starts to send a response if the worker process had been recycled in the interim because it had been running too long.
You should definitely farm out the long running operation to a back end Celery task queue or similar.
You might be hitting forced socket closures, though with the times you gave that does not look too likely. For a project I had on Azure, any connection that was idle for about 3 minutes would get closed by the system. I believe these closures were done ahead of the server in the network routing, so there was no way to disable them or increase the timeout.
Hm tricky problem.
Guess 1: I had a similar problem once. Have you played a bit around with your KeepAlive time? Set it to 60 minutes or more and test to see if the problem persist. More details here https://httpd.apache.org/docs/2.4/de/mod/core.html
Guess 2: Could amazon "move" your machine in the background, which interrupts your database connection or flask cannot handle the "unloading" and "loading" of the VM?

Cannot get started with mod_rewrite

I have in the past successfully managed to copy/edit/paste rewrite rules on an apache server over which I had limited control.
Now however I am experimenting with an Apache server which I can restart and configure to my heart's content but I cannot get even a basic rewrite example to work and that is after I have read at least two tutorials. I have played with LogLevel and RewriteLog but I can find no real evidence that my really basic rewrite rules are being used. My rewrite log file was created but its empty. I have also tried commenting out every thing from httpd.conf but the rewrite stuff.
Let's see what other information I can add:
chilcott:/etc/apache2/conf.d# uname -a
Linux chilcott 2.6.26-1-486 #1 Sat Jan 10 17:46:23 UTC 2009 i686 GNU/Linux
chilcott:/etc/apache2/conf.d# apache2ctl -V
Server version: Apache/2.2.9 (Debian)
Server built: Jan 20 2009 17:29:25
Server's Module Magic Number: 20051115:15
Server loaded: APR 1.2.12, APR-Util 1.2.12
Compiled using: APR 1.2.12, APR-Util 1.2.12
Architecture: 32-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT=""
-D SUEXEC_BIN="/usr/lib/apache2/suexec"
-D DEFAULT_PIDLOG="/var/run/apache2.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
-D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"
Do you have your rewrite rules under the right section of your httpd.conf? They should probably be in a vhost section.
Posting your httpd.conf (or at least some of it) might help.
It should look a bit like this:
LoadModule rewrite_module modules/mod_rewrite.so
RewriteLogLevel 9
RewriteLog ".....rewrite.log"
<VirtualHost *:80>
DocumentRoot "..."
RewriteEngine On
RewriteRule ^/foo /bar
</VirtualHost>
You need to load the module to use it. Look into your httpd.conf file for a line like the following and remove the leading comment character # if there is any:
#LoadModule rewrite_module modules/mod_rewrite.so
Then you just need restart your Apache server.