Apache: Difference between revisions

From Alpine Linux
(Formatting and adding links to related pages, homepage)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Installing Apache + PHP ==
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 main packages with the command:


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


Move to the directory where your site will resides:
Add the {{Pkg|apache2}} package:


{{Cmd|#cd /var/www/localhost/htdocs}}
{{Cmd|# apk add apache2}}


Create an index.php file to test if everything is ok:
Start the service:


{{Cmd|#vi index.php}}
{{Cmd|# rc-service apache2 start}}


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


{{Cmd|<?php
Enable apache on startup (if needed):
phpinfo();
?>}}


That done, let us start apache2 web server:
{{Cmd|# rc-update add apache2}}


{{Cmd|rc-service apache2 start}}
Edit the configuration in {{Path|/etc/apache2/}} and run


Now access: http://<ipa_ddress> and if everything is ok you will see the php info page.
{{Cmd|# rc-service apache2 restart}}


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


{{Cmd|rc-update add apache2}}
== Additional Guides ==
 
* [[Apache with php-fpm]]
* [[Apache authentication: NTLM Single Signon]]
 
== See Also ==
 
* [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