How to disable mod_authn_file in apache2 loaded modules - apache

I disable the module using the a2dismod command in htaccess file. Here is the command, I tried to disable for both.
a2dismod mod_authn_file
(OR)
a2dismod authn_file_module
I got an error in my apache log,
.htaccess: Invalid command 'a2dismod', perhaps misspelled or defined by a module not included in the server configuration
How can i fix it?

Which OS you are using?
On CentOS there are no a2enmod and a2dismod commands. To disable unneeded modules in Apache you need to carry out steps as described at the lower end of - for instance - this post:
http://www.cyberciti.biz/faq/howto-disable-apache-modules-under-linux-unix/

Related

Cannot find the pachkage apache2-mpm-worker

getting error on installing mpm-worker in ubuntu apache2.
How to fix this problem?
There is no apache2-mpm-worker package because the mpm_worker module is included by default when you install Apache on Ubuntu's newer versions. It is contained in the apache2-bin package that is a dependency of apache2:
sudo a2dismod prefork event php* && sudo a2enmod worker
If you see any errors like cannot enable module (similar), then let me know with the whole output. Make sure you enable php-fpm when you use prefork, if you wish to use PHP.

Apache: Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration

When configure apache2 virtual hosts for ssl/https connection, after adding configuration and enable the configuration with this command " a2ensite pm.university.com.conf " i got this error "Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration". I will answer my own question.
It turned out I did enabled ssl module but i had to do it again and it works, here is the command:
sudo a2enmod ssl
Now restart apache like so service apache2 restart
no more error, FIXED!
sudo a2enmod ssl
and restart the apache service that will do the trick
Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration
Simply:
This error likely happens on apache if your "virtual host" is trying to use SSL but you did not install SSL module on your apache.
Case 1: For Centos (linux distro), run:
yum install mod_ssl openssh
Case 2: For Ubuntu or Debian (linux distros), run:
sudo a2enmod ssl
And it should install and configure everything (a new file *-ssl.conf should appear in your conf.modules.d folder)
sudo yum install mod_ssl
sudo a2enmod ssl
sudo apachectl restart
When you edit the site configuration file, you have to test the configuration before enabling the site just to ensure its Syntax is correct. Use the command below to test the configuration.
apache2ctl configtest
or
sudo apache2ctl configtest
So if the syntax is correct you get a response similar to the one below
If you get the SSLEngine: Invalid command error then run the following command and go back to step one, solve all Syntax errors until it says Syntax OK.
sudo a2enmod ssl
Restart apache using the following command
sudo apachectl restart
Hopefully that solves the error.
Try following Solution:
Open the file httpd.conf at "your apache folder"/conf
Find the following line using CTRL+f in your text editor: #LoadModule ssl_module modules/mod_ssl.so
Remove the #(uncomment the line)
Save and restart your apache

mod_rewrite.so is missing under /etc/httpd/modules

I was trying to use mod_rewrite but without success.
I searched online and found some articled but didn't solve my problem.
I finally realised that this article must solve my problem http://www.ewhathow.com/2013/09/how-to-enable-mod_rewrite-on-apache/
but the file mod_rewrite.so is missing under my system.
I have to note that i am using Centos 6 64BIT
.Is there any way to solve this ?
I tried my self to install xampp on an other computer go to modules folder and copy the mod_rewrite.so file and copy it on my server .After that i added
this
LoadModule rewrite_module modules/mod_rewrite.so
on /etc/httpd/conf/httpd.conf
But after restarting apache…apache couldn't start…so i deleted again the line and apache restarted successfully.
I want to make mod_rewrite works on my server.Any help ?
Thanks in advance
I am using Apache on CentOS 6.5 installed from the installation CD and it does have /etc/httpd/modules/mod_rewrite.so file. If this file is missing, I think you would be compiling your own Apache. In this case, you need to modify the SPEC file for apache and add --enable-rewrite to the configure line in the %setup section:
SPEC file %setup section:
%setup
./configure --prefix=%apache_dir --enable-rewrite
Build apache again and install the RPM and the mod_rewrite.so should be in the modules folder after it finished installing.
Options and modules available to compile on Apache:
http://httpd.apache.org/docs/2.2/programs/configure.html
The other thing you could probably do would be to install Apache using yum install httpd on a test system and grab the mod_rewrite.so file from the installation, save and copy to the modules folder on the system you're trying to get working. This would be my last resort method..
Without more information on what you have installed:
rpm -qi httpd
it hard to tell what would work best for your situation.

Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a module not included in the server configurationAction 'configtest' failed

I got the below error while I was configuring CKAN DataPusher.
Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a
module not included in the server configurationAction 'configtest'
failed.
How can I fix this?
Try to enable wsgi mod in Apache
sudo a2enmod wsgi
If you come across below error
ERROR: Module mod-wsgi does not exist!
You will have to install mod wsgi as below. What you have to do is run the following commands,
sudo apt-get install libapache2-mod-wsgi
sudo a2enmod wsgi
sudo service apache2 restart
To enable wsgi_mod in httpd, install the module
sudo yum install mod_wsgi
and make sure to load the module in the httpd config file
sudo nano /etc/httpd/conf/httpd.conf
then add the following line in the config file, to the list of other loaded module:
LoadModule wsgi_module modules/mod_wsgi.so
I had this error after messing up my Apache installation and restarting the setup after an apt purge apache2. This also seems to have removed the wsgi mod but Ubuntu 20 LTS kept thinking it's still around.
So I had to to purge and reinstall the wsgi mod from scratch:
apt purge -y libapache2-mod-wsgi-py3
apt install -y libapache2-mod-wsgi-py3
a2enmod wsgi
After that, Apache was able to find it again.
I faced this problem because
I installed mod_wsgi which was compatible with python3.5, but my project's virtual environment was using python3.7. So, mod_wsgi for 3.7 was required. I installed that as well (python3.7 -m pip install mod_wsgi). But a configuration was missing from apache2 which resulted in this issue.
run : mod_wsgi-express module-config
add the output in /etc/apache2/apache.conf
( LoadModule wsgi_module "/home/user/.local/lib/python3.7/site-packages/mod_wsgi/server/mod_wsgi-py37.cpython-37m-x86_64-linux-gnu.so"
WSGIPythonHome "/usr" )
then restart - sudo service apache2 restart
This solved the problem.
I think you might need to add this line in your apache2.conf
LoadModule wsgi_module "/usr/local/lib/python3.6/dist-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"
Below command will give you the above output
mod_wsgi-express module-config

Apache Command Line Not Functioning

Installed Apache Ver 2.2.3 on my vps with Centos 5.6 but when I try the a2dismod and a2enmod got Command not found error.
What can I do to fix it?
Thank you
This is my first vps and this is also my first experience with linux and centos.
The server is running fine just need to disable few modules.
On CentOS there are no a2enmod and a2dismod commands. To disable unneeded modules in Apache, you need to carry out steps as described at the lower end of – for instance – this post: http://www.cyberciti.biz/faq/howto-disable-apache-modules-under-linux-unix/
Perhaps those commands were not in your path? If the programs are in your current working directory, try ./a2dismod.
To see what path our shell is searching, try echo $PATH.