Apache

From Alpine Linux
Revision as of 15:03, 30 December 2013 by Alacerda (talk | contribs) (→‎Testing)

Installing Apache

Add the Apache2 package with the command:

#apk add apache2

Testing

Move to the directory where your site will resides:

#cd /var/www/localhost/htdocs

And create an index.html file to test if everything is ok:

#vi index.html

And add the following lines:

<html> <head> <title> My first page </title> </head> <body> It works! </body> </html>

That done, let us start apache2 web server:

rc-service apache2 start

Now access: http://<ip_address> and if everything is ok you will see the html page.

Ending

Finally let us set up apache2 to start on operating system startup:

rc-update add apache2

Now you can create your html site and host in this directory.