Difference between revisions of "Apache"

From Alpine Linux
Jump to: navigation, search
(Created page with "== Installing Apache + PHP == Add the main packages with the command: {{Cmd|#apk add apache2 php-apache2}} Move to the directory where your site will resides: {{Cmd|#cd /va...")
 
(Installing Apache + PHP)
Line 8: Line 8:
 
{{Cmd|#cd /var/www/localhost/htdocs}}
 
{{Cmd|#cd /var/www/localhost/htdocs}}
  
And create an index.php file to test if everything is ok:
+
Create an index.php file to test if everything is ok:
  
{{Cmd|#vi index.php
+
{{Cmd|#vi index.php}}
  
<?php
+
And add the following lines:
 +
 
 +
{{Cmd|<?php
 
phpinfo();
 
phpinfo();
 
?>}}
 
?>}}

Revision as of 15:55, 27 December 2013

Installing Apache + PHP

Add the main packages with the command:

#apk add apache2 php-apache2

Move to the directory where your site will resides:

#cd /var/www/localhost/htdocs

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

#vi index.php

And add the following lines:

<?php phpinfo(); ?>

That done, let us start apache2 web server:

rc-service apache2 start

Now access: http://<ipa_ddress> and if everything is ok you will see the php info page.

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

rc-update add apache2