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

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

Related

apache2: ERROR: Module not properly enabled

I am getting this error:
ERROR: Module wsgi not properly enabled:
/etc/apache2/mods-enabled/wsgi.load is a real file, not touching it
I have this:
USER root
RUN apt-get install -y apache2
RUN a2enmod wsgi
does anyone know what this error would signify?
I can't figure out how to resolve it.
if I forgo the a2enmod wsgi line, then I get:
/usr/lib/apache2/modules/mod_wsgi.so: cannot open shared object file:
No such file or directory
The error means that the file or directory mod_wsgi.so doesn't exist on your server. You may follow the instructions below on how to enable this module.
SSH to your machine.
Once you'r logged in, please execute the following commands below:
$ sudo apt-get install libapache2-mod-wsgi
$ sudo a2enmod wsgi
Please execute the find command to locate the mod_wsgi.so module.
$ sudo find / -name *mod_wsgi.so
You should see this result.
/usr/lib/apache2/modules/mod_wsgi.so
Furthermore, to install apache2 please execute the command below:
$ sudo apt-get install apache2 -y
Hope this information works for you.

a2enmod command not found in apache server using cpanel in linux vps

after going to /etc/httpd/conf/httpd.conf and even after changing
Allow override none -> Allow override All , and then restarting the server using
service httpd restart
and then i type the command
a2enmod proxy
then i get an error :
bash- a2enmod command not found. .
Can you please help me? i am getting an error in the developer tools console when i am using web-sockets and so for that i need to enable web-sockets proxy.
I had the same problem, and this answer solved my issue:
Apache2 command such as a2enmod and a2ensite no working its showing command not found in Ubuntu
Try:
sudo apt-get update
sudo apt-get install apache2 libapache2-mod-wsgi
Then,
sudo a2enmod wsgi
Then, you might also want to try sudo a2enmod instead of just a2enmod
On Debian a2enmod is located at /usr/sbin/a2enmod and sometimes /usr/sbin is not in your PATH.

Why localhost's phpmyadmin is empty with no login window?

I installed phpmyadmin following the instructions here. Installation has completed and I have phpmyadmin inside /usr/share/phpmyadmin and has linked to
sudo ln -s /usr/share/phpmyadmin/ /var/www/html/phpmyadmin
But doesn't show anything (the whole page is blank with no login window) when I access to http://localhost/phpmyadmin
What could be wrong?
My os is Ubuntu14.04 and installed Apache 2.4.7.
For those who has similar problem, please follow the steps below.
Please check error at /var/log/apache2/error.log
My error is PHP Fatal error: require_once(): Failed opening required './libraries/php-gettext/gettext.inc' (include_path='.')
So install sudo apt-get install php-gettext
Then restart sudo service apache2 restart.

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

How to disable mod_authn_file in apache2 loaded modules

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/