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

4

14

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

Acceptation answered 6/3, 2018 at 19:5 Comment(2)
Are you using the system Apache and is it installed? Is the appropriate system mod_wsgi package installed?Cornfield
For such installation debugging request, please post all details you can: OS (Ok It's Ubuntu), Version ??, Architecture: ??, Harsware ??, Host purpose: Desktop or server? How did you install apache? Etc... (some more observation you could share about your specific case)Version
T
18

I had the same problem with using Ubuntu 16.04 in AWS. However, installing apache2 along with libapache2-mod-wsgi and python-dev solved the issue.

Try:

sudo apt-get update
sudo apt-get install apache2 libapache2-mod-wsgi python-dev

Then,

sudo a2enmod wsgi
Triggerhappy answered 9/9, 2018 at 18:32 Comment(1)
After above steps , sudo systemctl reload apache2 will be neededToilsome
J
11

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 ;)

Jaunita answered 14/8, 2020 at 11:34 Comment(0)
S
6

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

Surfboarding answered 13/7, 2020 at 12:57 Comment(1)
This was what it was for me. It happens to the best (or worst) of us.Pelota
V
2

Installation debugging

For asking about installation debugging, you have to post (and think) about

  • Architecture (hardware)
  • OS with version
  • Host attibution (server, desktop, other)
  • Procedure followed for installation
  • Software (apache) version

Anyway

You could try to reinstall your package. If under Ubuntu, you could try:

sudo apt update &&
    sudo apt reinstall apache2 libapache2-mod-wsgi

Then rerun:

sudo a2enmod wsgi
Version answered 18/9, 2020 at 6:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.