Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache2 command such as a2enmod and a2ensite no working its showing command not found in Ubuntu

I am deploying Flask application in Apache2 server during this i need to run a command for enabling mod_wsgi by using:

sudo a2enmod wsgi

but its showing:

sudo: a2enmod: command not found

please help thanks

like image 553
Shadab Ansari Avatar asked Mar 06 '18 19:03

Shadab Ansari


People also ask

What is a2enmod command?

a2enmod is a script that enables the specified module within the apache2 configuration. It does this by creating symlinks within /etc/apache2/mods-enabled. Likewise, a2dismod disables a module by removing those symlinks.

What is a2ensite command?

a2ensite is a script that enables the specified site (which contains a <VirtualHost> block) within the apache2 configuration. It does this by creating symlinks within /etc/apache2/sites-enabled. Likewise, a2dissite disables a site by removing those symlinks.


2 Answers

I share this tips because it append to me :

If you enter into the root account with su, the /usr/sbin folder is not in the path and the a2enmod command is not found...

So you have to use su - instead ;)

like image 161
fred727 Avatar answered Sep 21 '22 22:09

fred727


This can happen if you switch to root user as su root instead of su - on Debian Buster

like image 21
Gianpaolo Scrigna Avatar answered Sep 20 '22 22:09

Gianpaolo Scrigna