Apache: Difference between revisions

From Alpine Linux
(Formatting and adding links to related pages, homepage)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Installing Apache==
The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows.
Add the Apache2 package with the command:


{{Cmd|#apk add apache2}}
== Simple Setup ==


== Testing ==
Add the {{Pkg|apache2}} package:


Move to the directory where your site will resides:
{{Cmd|# apk add apache2}}


{{Cmd|#cd /var/www/localhost/htdocs}}
Start the service:


And create an index.html file to test if everything is ok:
{{Cmd|# rc-service apache2 start}}


{{Cmd|#vi index.html}}
Navigate a browser to the machine's address; there you should see the default "It works" page.


And add the following lines:
Enable apache on startup (if needed):


{{Cmd|<html>
{{Cmd|# rc-update add apache2}}
<head>
<title> My first page </title>
</head>
<body>
It works!
</body>
</html>}}


That done, let us start apache2 web server:
Edit the configuration in {{Path|/etc/apache2/}} and run


{{Cmd|rc-service apache2 start}}
{{Cmd|# rc-service apache2 restart}}


Now access: http://<ip_address> and if everything is ok you will see the php info page.
to enable your changes


== Ending ==
== Additional Guides ==


Finally let us set up apache2 to start on operating system startup:
* [[Apache with php-fpm]]
* [[Apache authentication: NTLM Single Signon]]


{{Cmd|rc-update add apache2}}
== See Also ==


Now you can create your html site and host in this directory.
* [https://httpd.apache.org/ Apache Homepage]
 
[[Category:Web Server]]

Latest revision as of 16:33, 14 May 2023

The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows.

Simple Setup

Add the apache2 package:

# apk add apache2

Start the service:

# rc-service apache2 start

Navigate a browser to the machine's address; there you should see the default "It works" page.

Enable apache on startup (if needed):

# rc-update add apache2

Edit the configuration in /etc/apache2/ and run

# rc-service apache2 restart

to enable your changes

Additional Guides

See Also