Gentoo install mod_proxy_balancer - apache

I installed in Apache in Gentoo and i need to use it like a proxy but i am unable to install mod_proxy_balancer. If i restart apache it display the following:
apache2 has detected an error in your setup: AH00526: Syntax error
on line 4 of /etc/apache2/vhosts.d/jira.conf: Invalid command
'ProxyRequests', perhaps misspelled or defined by a module not
included in the server configuration * ERROR: apache2 failed to stop
Any suggestion how to?
May seems a easy question for Gentoo expert, but not for beginners.

Please create a new file if not existing:
nano /etc/portage/package.use/apache2
Add the line containing the following:
www-servers/apache apache2_modules_proxy_balancer apache2_modules_slotmem_shm apache2_modules_proxy slotmem_shm mod_proxy_balancer mod_proxy apache2_modules_lbmethod_byrequests apache2_modules_proxy_balancer apache2_modules_slotmem_shm apache2_modules_proxy apache2_modules_proxy_ajp apache2_modules_proxy_balancer apache2_modules_proxy_http
Please run the following command in order to update the packages:
emerge -avDU #world
The purpose of this file is to add the following modules when apache2 ( www-servers/apache ) will be installed with the following command:
emerge www-servers/apache
After apache is installed with the requested modules need to add ( -D PROXY )
nano /etc/conf.d/apache2
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PROXY "
Now we should be ok with the apache modules.

Related

How can I check server configuration ("$ httpd -S") in MAMP?

I have previously installed Apache on my Mac Mini using Homebrew, but I'm currently using MAMP. When I issue the terminal command httpd -S to check Apache configurations, it checks the Homebrew configurations. Is there a way I can test the configurations for MAMP? I would like to use the same httpd -S command, but if there's another preferred way to do it for MAMP, that's fine too.
You do it with the -f flag, like this:
httpd -f /Applications/MAMP/conf/httpd.conf -S
This is in httpd options:
Options:
...
-f file: specify an alternate ServerConfigFile

How do I check the apache config for validity in Red Hat Linux?

My operating system is Red Hat Enterprise Linux 7. This isn't working...
# httpd -t
bash: httpd: command not found
In case it helps, this is the command I run to restart apache on this box...
# systemctl restart httpd24-httpd
But this doesn't work...
# httpd24-httpd -t
bash: httpd24-httpd: command not found
This doesn't work either...
# apachectl -t
bash: apachetl: command not found
Nor does this work...
# apachectl configtest
bash: apachetl: command not found
I know this is a couple months old but ended up here. I ran into the same issue initially, hence why I am here. I found that the location for the new httpd24-httpd wasn't in my env path to execute. While I could added it there, I found the command location and was able to execute.
How I found the command:
sudo find / -name apachectl
The output of the command:
/opt/rh/httpd24/root/usr/sbin/apachectl
Executed the command:
sudo /opt/rh/httpd24/root/usr/sbin/apachectl
Turns out I have to fix my configuration.
httpd: Syntax error on line 56 of /opt/rh/httpd24/root/etc/httpd/conf/httpd.conf: Syntax error on line 40 of /opt/rh/httpd24/root/etc/httpd/conf.modules.d/00-base.conf: Cannot load modules/mod_http2.so into server: libnghttp2-httpd24.so.14: cannot open shared object file: No such file or directory
Interesting that this came up for me, as I've not done anything with the configuration in this regard.
Here's the version I am running.
sudo /opt/rh/httpd24/root/usr/sbin/apachectl -v
Server version: Apache/2.4.34 (Red Hat)
Server built: Mar 17 2020 09:34:59
All the best!
Found something more for this as well from an old bug submitted to Redhat
Bug 1329639
Comment 10
scl enable httpd24 -- /opt/rh/httpd24/root/usr/sbin/apachectl configtest

nginx ldap module error

I was trying to include the LDAP module to nginx. I could add the module and make install nginx successfully, however, while trying to restart the nginx, I get the following error:
sudo /usr/local/nginx/sbin/nginx -c /var/www/conf/nginx.conf -t
nginx: [emerg] dlopen() "/usr/local/nginx/modules/ngx_http_auth_ldap_module.so" failed (/usr/local/nginx/modules/ngx_http_auth_ldap_module.so: undefined symbol: ngx_ssl_handshake) in /var/www/conf/nginx.conf:11
nginx: configuration file /var/www/conf/nginx.conf test failed
When I looked at the ngx_http_auth_ldap_module.c file, I found that there is a call to this function. I am not sure where is this function being called from. Is there any other library that needs to be installed?
I have already installed the following:
openssl-devel.x86_64
openldap-devel.x86_64
zlib-devel.x86_64
I figured it out that I wasn't configuring nginx with the http_ssl_module option.
To make it work, I re-configured the nginx as:
./configure --add-module=/path/to/ldap_module --with-http_ssl_module
And then issued make and install commands. The ngx_ssl_handshake error got removed.

mod_wsgi-express: error: Invalid command was specified

I am trying to run wsgi application (hello.wsgi) on localhost through apache24 with mod_wsgi module but it shows this:
cd c:/apache24/bin
mod_wsgi-express start-server hello.wsgi
Usage: mod_wsgi-express command [params]
Commands:
module-config
module-location
mod_wsgi-express: error: Invalid command was specified.
Please help me!
On Windows the start-server command is not available. Using pip install mod_wsgi on Windows is only for getting the mod_wsgi module compiled. Once you have it compiled, run:
mod_wsgi-express module-config
Copy the output from that into your Apache configuration file to have it load the mod_wsgi module. Then configure Apache manually to host your specific WSGI application.
See section "Connecting into Apache installation" in:
https://pypi.python.org/pypi/mod_wsgi
for more details about the module-config command.

installing mod_headers on Linux, apache 2.2.21

Trying to install the mod_headers to be able to append a HTTP header with the Header directive. But the installation process doesn't show the header module as being installed.
Did the following steps. Switched over to the httpd installation and under the modules/metadata directory did:
apxs -c mod_headers.c
the so file is created under the metadata/.libs directory (not sure why). Added the module with:
apxs -i -a -n mod_headers ./metadata/.libs/mod_headers.so
Restarted apache and tried a dump of the modules but getting:
httpd: Syntax error on line 54 of /www/fkwiki/apache/conf/httpd.conf: Can't locate API module structure `mod_headers' in file /www/fkwiki/apache/modules/mod_headers.so: /www/fkwiki/apache/modules/mod_headers.so: undefined symbol: mod_headers
Got a warning in the installation of the module (i.e. apxs -i ....):
Warning! dlname not found in /www/fkwiki/apache/modules/mod_headers.so
Anybody else have the same problem?