Sat Mar 17 15:57:31 2018 UTC

Setup of an HTTP server

Introduction

An http server can be useful if we want to test some html pages on a real browser. If we want to create our own website to be locally accessible from home or why not make it public on the net.

Packages to install

To install and activate the http service, you will see, it's very simple. Open a terminal and enter the command:

get apache apache.service

That's it, the installation is already done.

Configuration

The default configuration of the apache http server is basic. It is recommended you make a custom configuration.

An example follows, starting to create a customised html file.

As root:

cat > /srv/www/index.html << EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
     "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
   <HEAD>
      <TITLE>Welcome on your HTML server</TITLE>
   </HEAD>
   <BODY>
    <H1>Your NuTyX http server is working</H1>
      <P>Hello everybody !
   </BODY>
</HTML>
EOF

Service starting

Activate the service, still as root:

/etc/rc.d/init.d/httpd start
  *   Starting Apache HTTP daemon... [  OK  ]

You can check the result of your work by going to the URL address: http://localhost/ with your favourite browser