nsx lab – set up simple apache web server

How to – configure apache on CentOS 5.6

To test firewall rules, load balancing and ssl redirection a pair load web servers are needed. Here are some simple guidelines that can help you get these up and running.

My web server are centOS 5.6 32 bit, installed with no graphics –  2.6.18-238.e15 kernel

Once servers are up and running

Set hostname
Login with putty.exe
vi /etc/sysconfig/network

Set IP address

Add httpd service
mount the original installation cd

mkdir /mnt/cdrom
mount /dev/hdc /mnt/cdrom

Search original installation cd for the package*

cd /mnt/cdrom/CentOS
ls | grep
rpm -i –test http-2
rpm -Uvh apr-1.2.
rpm -Uvh postgresql-libs-8
rpm -Uvh apr-util-1
rpm -Uvh http-2

*you may have to add more packages depending on the dependencies in your distribution


Disable advanced security options




Enable httpd listener

vi /etc/httpd/conf/httpd.conf
edit Listen and servername

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (
#Listen 80
#Listen 443

# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work.  See also the UseCanonicalName directive.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
ServerName www.web-2:80

modify the file /var/www/error/noindex.html to indicate the server

for example edit the head title and the body title

      <title>web-1 Test Page</title>

      <h1>Web-1<br><font size="-1"><strong></font>TEST PAGE</strong></h1>


Set httpd to start automatically after vm restart

chkconfig httpd on
service httpd start


Check that the http service is listening on the ports

netstat -tulpn


Check that pages are available

From a windows vm check that pages respond
ssl is not configured so https:// does not respond but does, check as well

Note: When checking the availability of pages I found that both web servers needed to be on the same nested host as the vm I used to check the pages, even though I can ping and telnet both web vms without issue.

web-1- apache