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
- run apk for need packages
- make the htdos public web root directories
- configure the default ports and server information
- setup the permissions
- added the service to the boot process
- start the service
- 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
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.
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!