NethServer Version: 8
Module: lamp
Hello. Is it possible to specify a non-standard directory for Apache? /var/www/html/htdocs, for example. I use Dolibarr for CRM.
NethServer Version: 8
Module: lamp
Hello. Is it possible to specify a non-standard directory for Apache? /var/www/html/htdocs, for example. I use Dolibarr for CRM.
Hi and welcome to NethServer Community.
It could be possible to use a .htaccess file, see GitHub - NethServer/ns8-lamp: configure a lamp module with phpmyadmin · GitHub
Thereâs also a Dolibarr app available, see ns8:applications:applications [NethServer & NethSecurity] and NS8-Dolibarr App
Iâve already set up .htaccess. However, I canât completely remove /htdocs from the address bar; either takepos isnât working or itâs not downloading files. I also saw the app, but I understand itâs not updated. I thought maybe there was a feature I didnât know about. I even tried adding APACHE_DOCUMENT_ROOT=/var/www/html/htdocs to the configuration, but that didnât help. Weâll use it as is.
Does it work when you change the documentroot? This is just for testing, the config isnât persistent and will be lost after a container restart.
Edit the default site:
runagent -m lamp1 podman exec -ti apache2-app nano /etc/apache2/sites-available/000-default.conf
Change the DocumentRoot:
DocumentRoot /var/www/html/htdocs
Restart apache:
runagent -m lamp1 podman exec -ti apache2-app apache2ctl restart
It would be great to add this functionality to the appâs settings. Iâm ready for any testing.)
Letâs hail the Oracle @stephdl
Do not know if it is possible without breaking the container, you can bind mount the httpd.conf by editing the systemd service for now.
The post marked as a solution will not survive a restart of the container
Could you elaborate on how to do this? Iâm still learning how to work with containers.
A bind mount wasnât working (I guess due to permissions) so I added a volume.
The problem is that the configuration is dynamic so after adding the volume, for example enabling/disabling phpmyadmin from the cluster-admin UI doesnât work anymore but the change survives a container restart.
Edit the systemd service file:
runagent -m lamp1 systemctl --user edit --full apache2-app
Add the following at line 34:
--volume sites-available:/etc/apache2/sites-available:Z \
Restart the service/container:
runagent -m lamp1 systemctl --user restart apache2-app
Perfect!!! Thank you very much!
probably we need to add a new environment for this option with a sed directive inside the container
basically if the env if found then the sed does the change if not present does nothing and the file present in the container is used as default
implemented