apache2: ERROR: Module not properly enabled - apache

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.

Related

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
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
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 ;)
This can happen if you switch to root user as su root instead of su - on Debian Buster
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

Apache doesn't start in AMPPS on Ubuntu

I'm trying to run the Ampps local server 3.8 on Ubuntu. Mysql works good but apache doen't run.
When I type
/usr/local/ampps/apache/bin/httpd
I get
/usr/local/ampps/apache/bin/httpd: symbol lookup error: /usr/local/ampps/apache/lib/libapr-1.so.0: undefined symbol: dlopen
How to solve?
I experienced a similar problem. Firstly you must check is there anything that uses 80 port.
If any you kill that.
Then you backup libapr and then install libs again.
Run following commands:
cd /usr/local/ampps/apache/lib
sudo mkdir backup
sudo mv ./libapr* ./backup/
sudo apt-get -y install libaprutil1 libaprutil1-dev libapr1 libapr1-dev
and try run ampps.

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

mCrypt not present after Ubuntu upgrade to 13.10

After I have upgraded my system from Ubuntu 13.04 to 13.10 several problems have occurred with apache, mysql and php configurations.
I solved most of them but I can't seem to get mCrypt library working.
Package is installed so i don't need to apt-get it. Server works and everything seems fine, but when I try to run php artisan serve with Laravel 4, I get a message that mCrypt is required.
I did php --ri mcrypt and the output was Extension 'mcrypt' not present.
I have tried putting extension=mcrypt.so to /etc/php5/apache2/php.ini but it didn't work.
Any ideas?
Output of dpkg --get-selections | grep php5
libapache2-mod-php5 install
php5 install
php5-cli install
php5-common install
php5-gd install
php5-json install
php5-mcrypt install
php5-mysql install
php5-readline install
I think I found the solution at launchpad.net.
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
sudo php5enmod mcrypt
sudo service apache2 restart
This worked for me.
I had this problem with Ubuntu 14.04 and I did the following to resolve it:
sudo apt-get install php5-mcrypt
sudo php5enmod mcrypt
sudo service apache2 restart
I also have this problem with Ubuntu 14.04 after install.
First enable the mcrypt
sudo gedit /etc/php5/apache2/php.ini
Add this command in any line
extension=mcrypt.so
Create conf.d folder in /etc/php5
sudo mkdir conf.d
And inside that folder create mcrypt.ini file
sudo gedit mcrypt.ini
Then add this command to that file
extension=mcrypt.so
Then create a link to file
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
Enable mcrypt module
sudo php5enmod mcrypt
Restart apache
sudo service apache2 restart
From Ubuntu 13.10 to 14.04:
sudo php5enmod mcrypt
sudo service apache2 restart
Works for me.
I also had this problem with Ubuntu 14.04 and Nginx,but the tip for me was restart the FPM service, so I did:
Install the library
apt-get install php5-mcrypt
Find the path
updatedb && locate mcrypt.so
Set the path of mcrypt.so inside the mcrypt.ini file located in /etc/php5/mods-available/mcrypt.ini
extension=/usr/lib/php5/20121212/mcrypt.so
And then restart the FPM service
service php5-fpm restart
Another solution if the package is already installed:
sudo aptitude reinstall php5-mycript
This worked for me after doing upgrade
Try this code:
ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/apache2/conf.d/20-mcrypt.ini
service apache2 restart
I had the same problem with PHP 5.5.14 running on Mac OS X Yosemite. I was trying to install Laravel 5.0. And when I tried to create a new project I got an error like below (even when I tried to start the laravel server with php artisan serve
Alejandros-MacBook-Pro:Documents Lexynux$ laravel new blog
Crafting application...
PHP Notice: Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128' in /Library/WebServer/Documents/blog/config/app.php on line 83
PHP Notice: Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128' in /Library/WebServer/Documents/blog/config/app.php on line 83
Generating optimized class loader
Compiling common classes
Compiling views
PHP Notice: Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128' in /Library/WebServer/Documents/blog/config/app.php on line 83
Application key [CCOPocoMjnJTx4AFXk64wqyTKyo3BlHq] set successfully.
Application ready! Build something amazing.
Alejandros-MacBook-Pro:Documents Lexynux$
So I just added the line below at the end of my php.ini file with the nano editor:
extension=mcrypt.so
sudo nano /etc/php.ini
Finally just restart the Terminal and restart the laravel app server with
php artisan serve
And it works fine!
just found on php.net
Note, for Ubuntu, simply installing php5-mcrypt did not get mcrypt to work. You need to execute the following commands as root to enable it:
apt-get install php5-mcrypt
mv -i /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/
php5enmod mcrypt
service apache2 restart
http://php.net/manual/en/mcrypt.installation.php#114609
Sometimes, this "problem" occurs because you entered an artisan command on your local machine instead of on your virtual machine. If you are using Homestead, mcrypt is already installed. Consider it a reminder to homestead ssh

PHP Fatal error: Class 'Phalcon\Script\Color' not found

I'm running Ubuntu Server 12.10 and have installed phalcon like this
sudo apt-get install php5-dev php5-mysql gcc git-core
git clone git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
then I've added
extension=/usr/lib/php5/20100525/phalcon.so
to php.ini which located in /etc/php5/apache2/php.ini and restarted apache2. If I execute
<?php print_r(get_loaded_extensions()); ?>
I can see that the phalcon extension is loaded. Then I've installed phalcon-devtools like that
git clone git://github.com/phalcon/phalcon-devtools.git
cd phalcon-devtools
sudo ./phalcon.sh
and restarted apache2. No errors were shown during that operations, but when I'm trying to execute
phalcon commands
I get an error like this
PHP Fatal error: Class 'Phalcon\Script\Color' not found in /home/user/phalcon-devtools/phalcon.php on line 84
What I'm doing wrong?
So the problem was in php.ini for CLI, which is located in /etc/php5/cli/, after I added extension=/usr/lib/php5/20100525/phalcon.so there, I was able to use Devtools. Thanks to #NikolaosDimopoulos
Official documentation is a bit confusing so try this:
I think this is a problem of extension not loaded
After successfully compile steps:
sudo apt-get install php5-dev php5-mysql gcc git-core
git clone git https://github.com/Phalcon/cphalcon.git
cphalcon cd/build
sudo ./install
Create a new file called "30-phalcon.ini"
and within it call the extension Phalcon with this single line:
extension=phalcon.so
save the file and copy the folder "/etc/php5/apache2/conf.d /" and "/etc/php5/cli/conf.d/"
restart the server: sudo service apache2 restart
While the devtools do this:
sudo git clone https://github.com/phalcon/phalcon-devtools /var/www/devtools
then create a symbolic link to run via terminal:
1: sudo ln -s /var/www/devtools/phalcon.php /usr/bin/phalcon
2: sudo chmod ugo+x /usr/bin/phalcon
3: type "phalcon" in the terminal and see if it's work.
it should work now: D
I always install the devtools from the PEAR channel
pear channel-discover pear.phalconphp.com
pear install phalcon/Devtools
You might get an error that the Devtools are not in stable mode but (as of the time of this writing) you can use this command:
pear install phalcon/Devtools-0.5.0
Source