Apache2 for alpine linux professional installation - McKAY brothers, multimedia emulation and support

About McKAY's blog

ads

Post Top Ad

Your Ad Spot

2022/08/26

Apache2 for alpine linux professional installation

The most famous cos was the first Linux server that was widely deployed. The apache2 server is the main choice when you want to get support in development, cos some setup are in a way of granular customization, with extended documentation.

If do you note the command php$phpverx-apache2 in many tutorials, that is a prof that are incomplete, here you will learn why this ilogic command.

The recommendation its to use apache2 behind a reverse proxy setup, such like lighttpd or hiawatta servers. Currently the most lazy and slow server .. just for windosers that wants to learn..

PART 1: Apache2 alpine linux installation

Widely deployed. The apache2 server is the main choice when you want to get support in development, cos some setup are in a way of granular customization, with extended documentation.

The recommendation its to use apache2 behind a reverse proxy setup, such like lighttpd or hiawatta servers. Currently the most lazy and slow server .. just for windosers that wants to learn..

Apache2 Installation

  1. run apk for need packages
  2. make the htdos public web root directories
  3. configure the default ports and server information
  4. setup the permissions
  5. added the service to the boot process
  6. start the service
  7. put a default page to test the service
apk add apache2 apache2-utils

mkdir -p /var/www/localhost/htdocs /var/log/apache2

sed -i -r 's#^Listen.*#Listen 80#g' /etc/apache2/httpd.conf

sed -i -r 's#^ServerTokens.*#ServerTokens Minimal#g' /etc/apache2/httpd.conf

chown -R apache:www-data /var/www/localhost/

chown -R apache:wheel /var/log/apache2

rc-update add apache2 default

rc-service apache2 restart

echo "it works" > /var/www/localhost/htdocs/index.html

For testing open a browser and go to http://<webserveripaddres> and you will see “it works”. The “webserveripaddres” are the ip address of your setup/server machine.

WARNING: alpine packagers are a mess, the apache2 default configuration is not ordered so all the conf files under /etc/apache2/conf.d/ will be loaded with no specific order.

Controlling Apache2

Start apache2: After the installation lighttpd is not running. As we made in first section was started already but if you want to start lightttpd manually use: rc-service apache2 start

You will get a feedback about the status.

* Starting apache2... [ ok ]

Stop apache2: If you want to stop the web server use stop in the same way of previous command: rc-service apache2 stop

Restart lighttpd: After changing the configuration file lighttpd needs to be restarted. rc-service lighttpd restart

Apache2 Configuration

If you just want to serve simple HTML pages apache2 can be used out-of-box. No further configuration needed.

Due to the minimalism of alpine linux, unfortunately the apache2 packaging is the worst ever seen, its configuration file makes it impossible to configure with only single line commands so the commands for quick configuration with cares of overwriting are very dedicated.

NEXT ARTICLE: configuring the apache2 in alpine Linux

Complete documentation at https://codeberg.org/alpine/alpine-wiki/src/branch/main/tutorials/professional-way/server-alpine-apache2-professional.md

Those crap tutorials are incomplete, note the wrong command


No hay comentarios.:

Publicar un comentario

no stupid winbuntu users allowed!

Entradas populares

Post Top Ad

Your Ad Spot