Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a CentOS linux machine hosting web pages for internal sites. How do I configure Apache to serve internal sites?

example virtual host config:

<VirtualHost yourhostname:80>
    DocumentRoot /www/your-domain/html
    ScriptAlias /cgi-bin/ /www/your-domain/html/cgi-bin/
    ErrorLog /www/your-domain/logs/error_log
    CustomLog /www/your-domain/logs/access_log combined

so if someone has access to the domain and navigates to: http://myipaddress/folder they get the index html of that folder

share|improve this question
up vote 1 down vote accepted

Using the example config you posted, you'd need to create a DNS A record for, pointing to the IP address of your server. After doing that, users navigating to in their browser will be served by the VirtualHost you created.

share|improve this answer
is there a way to get apache to just serve pages by requests directly to the ip address bypassing dns? – Chris Jun 6 '11 at 21:18
Yes, as long as the above is the only VirtualHost you configure on the server, it will serve all requests, whether by IP or DNS. – EEAA Jun 6 '11 at 21:21
what if I want to host multiple sites? – Chris Jun 6 '11 at 21:27
Instead of using a hostname... simply specify or *:80. This will bind to all interfaces & all ip addresses. By default apache will use named-hosts before it falls back to the catch-all rules. – TheCompWiz Jun 6 '11 at 21:28
@Chris - you don't do that. You create multiple VirtualHosts, one for each application. – EEAA Jun 6 '11 at 21:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.