Error on apache start: Could not open configuration file /etc/apache2/mods-enabled/proxy_scgi.load - apache

In ubuntu server when I try to start apache it gives following error message.
apache2: Syntax error on line 210 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/mods-enabled/proxy_scgi.load: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
What is the reason for the error? And how can I get through this issue?

This issue can be fixed by enabling the proxy_scgi module. Following is the command to enable the module in linux.
sudo a2enmod proxy_scgi

Related

Flask Apache Start Fails with Permission Denied

I am trying to install Flask on my CentOS 7.9.2009 VM running Apache HTTP Server. I've installed Python3.8 and mod_wsgi but when I attempt to start Apache I get the below Permissioned denied when loading the mod_wsgi. I've checked multiple blogs and forums and cannot find a resolution. Any idea why I am getting this error?
Error: cannot open shared object file: Permission denied
httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf.modules.d/02-wsgi.conf: Cannot load /home/myuser/.local/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-x86_64-linux-gnu.so into server: /home/myuser/.local/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-x86_64-linux-gnu.so: cannot open shared object file: Permission denied
I installed python3.8 from source using ./configure --enable-optimizations --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib" but I am still getting the above permission denied error.
Below is how my app.conf file looks like and also output of mod_wsgi module-config.
app.conf:
LoadModule wsgi_module "/home/myuser/.local/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-x86_64-linux-gnu.so"
mod_wsgi module-config:
[myuser#mycentos conf.d]$ mod_wsgi-express module-config
LoadModule wsgi_module "/home/myuser/.local/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-x86_64-linux-gnu.so"
WSGIPythonHome "/usr/local"
I get the error when I try to start Apache - sudo systemctl start httpd.
The permission issue was because of SELinux enabled/enforced on my system. I reached out to one of the mod_wsgi source code authors and he pointed me to check this. For now disabling this resolved my immediate issue. If others have suggestions to resolve this without turning it off please suggest.
$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 31

Transport Layer Security module fails to load

I am using Ubuntu 12.04 LTS, and Apache 2.4.
I've installed TLS by following the steps on this link: https://help.ubuntu.com/community/GnuTLS
When restarting Apache I get the following error:
apache2: Syntax error on line 212 of /etc/apache2/apache2.conf:
Syntax error on line 1 of /etc/apache2/mods-enabled/gnutls.load:
Cannot load /usr/lib/apache2/modules/mod_gnutls.so into server:
/usr/lib/apache2/modules/mod_gnutls.so: undefined symbol: unixd_config
If I remove the #gnutls.conf file from the /etc/apache2/mods-enabled directory Apache restarts.
What is causing the module not to load?
Your level of mod_gnutls isn't aware of Apache 2.4, one breaking change in 2.4 is the symbol unixd_config is replaced by ap_unixd_config. There will probably be a slew of similar issues.

Apache2 cannot load mod_tile

I had installed mod_tile and apache2 and tile server worked without problem. after that i installed php5.5.3. it changed all file structures of apache2 conf. i think something has changed. "LoadModule tile_module"had been removed from the config file. I added it in new apache2.conf file. but now when i restart apache it shows this message:
apache2: Syntax error on line 141 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/mod_tile.conf: Cannot load /usr/lib/apache2/modules/mod_tile.so into server: /usr/lib/apache2/modules/mod_tile.so: undefined symbol: unixd_set_global_mutex_perms
Action 'configtest' failed.
and this is /etc/apache2/mods-enabled/mod_tile.conf
LoadModule tile_module /usr/lib/apache2/modules/mod_tile.so

Configuration http not running after installing mod_jk.so

I installed: mod_jk-1.2.31-httpd-2.2.x.so
When restart httpd after updateing mod_jk
/sbin/service http stop
ERROR:
httpd: syntax error on line 30 of /usr/local/apache/conf/httpd.conf: syntax error on line 2 of /usr/local/apache/conf.d/mod_jk.conf: cannot load /usr/local/apache/modules/mod_jk.so into server: /usr/local/apache/modules/mod_jk.so: wrong ELF class: ELFCLASS32
Found the correct compiled version for 64bit system.

apache2.conf errors

The actual directory of the apache2.conf is /etc/apache/apache.conf. And there is sites-enabled directory. I changed the directory path of the sites-enabled directory to /var/www/sites-enabled. Further went on to change the directory pat of the sites-enabled in the apacche2.conf as ../../var/www/sites-enabled/
It throws the error
apache2: Syntax error on line 230 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/var/www/sites-enabled/: No such file or directory
Action 'configtest' failed.
Any ideas on how I could resolve this?
Put in the correct path now it throws this error
apache2: Syntax error on line 230 of /etc/apache2/apache2.conf: Could not open configuration file /var/www/sites-enabled/000-default: No such file or directory
Action 'configtest' failed.
Thanks
Jean
You might have built the dangling a while ago. You should remove the association by
d2dissite 000-default
Then add your website alias with
a2ensite yoursite.com
I met similar errors before. It occurred when I was installing new modules but configured it wrongly. My solution was to locate the error configuration and remove the configure file.
If the error was caused by modules related configuration, you can try:
/etc/init.d/apache2 -M
This generated error message for me
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/mods-enabled/ example.load: No such file or directory
I checked that directory, and found there is an example.load file, I deleted it and restart the server, and the problem solved.
Generally, I think you should try:
locate which was the origin of the error.
systemctl status apach2.status
If it is originated by wrong module configurations, locate which configuration file was the origin of the error.
/etc/init.d/apache2 restart
In your case, it may be caused by your wrong configuration on the site, you can check the configuration and modify it correctly.
It was due to permission error
sudo apache2 restart