Does an rpm or deb package which contains an apache2 module that was compiled against Apache 2.4 likely work on a system that has Apache 2.2, or is this asking for trouble? I'm not worried about the config files, just the shared object mod_foo.so .
Related
This might be a dumb question, but anyway here it goes.
From the below link I could see that default config link for apache httpd2 is at
"/usr/local/apache2/conf/httpd.conf"
https://wiki.apache.org/httpd/DistrosDefaultLayout
how ever when I install httpd using yum on centos 6 and 7 config files seems to be at "/etc/httpd/conf/httpd.conf
Why doesn't yum install it to the location defined on the default distribution layout.
Default location primary httpd config file for Fedora Core, CentOS, RHEL is /etc/httpd/conf/httpd.conf
In general the path /usr/local is meant for "locally" installed packages. For a single computer that probably just means packages installed outside of the normal distribution. So I would argue a package manager like yum shouldn't even touch anything under /usr/local.
On the other hand it makes sense for the apache project to specify their default paths there, since if you download Apache directly from their site and install it you do it outside of your standard system distribution.
Standard installation of Apache 2.4 on Ubuntu puts the apache2.conf file in /home/miro/etc/apache2. You can locate the main config file using:
/usr/sbin/apache2 -V | grep SERVER_CONFIG_FILE
Modify the path /usr/sbin/ to the location of the installation, if you have changed its default when installing.
As title says "How to install mod_wgsi for python3.5 on CentOS 7"?
$pip3.5 install mod_wgsi did not work
Collecting mod_wgsi
Could not find a version that satisfies the requirement mod_wgsi (from versions: )
No matching distribution found for mod_wgsi
sudo yum install libapache2-mod-wsgi-py3 failed too:
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* base: mirror.daniel-jost.net
* epel: mirrors.n-ix.net
* extras: mirror.daniel-jost.net
* ius: mirror.amsiohosting.net
* remi: mirror.23media.de
* remi-php56: mirror.23media.de
* remi-safe: mirror.23media.de
* updates: mirror.daniel-jost.net
No package libapache2-mod-wsgi-py3 available.
Error: Nothing to do
Any suggestions on how to run apache2.4+ mod_wsgi with python3.5 on CentOS 7 are very welcome!
I tried following Carl's answer, but it didn't solve the problem. It turns out that the version I installed required some extra configuration steps after installation.
Background
I looked at Apache's modules folder before I installed the mod_wsgi upgrade:
$ ls -l /lib64/httpd/modules
[...]
-rwxr-xr-x. 1 root root 172800 Oct 30 22:44 mod_wsgi.so
Then I installed the SCL repository, and looked to see which versions of mod_wsgi are available.
$ sudo yum install -q -y centos-release-scl
[...]
$ yum search mod_wsgi
[...]
koschei-frontend.noarch : Web frontend for koschei using mod_wsgi
mod_wsgi.x86_64 : A WSGI interface for Python web applications in Apache
python27-mod_wsgi.x86_64 : A WSGI interface for Python web applications in Apache
python33-mod_wsgi.x86_64 : A WSGI interface for Python web applications in Apache
rh-python34-mod_wsgi.x86_64 : A WSGI interface for Python web applications in Apache
rh-python35-mod_wsgi.x86_64 : A WSGI interface for Python web applications in Apache
rh-python36-mod_wsgi.x86_64 : A WSGI interface for Python web applications in Apache
viewvc-httpd-wsgi.noarch : ViewVC configuration for Apache/mod_wsgi
[...]
I'm using Python 3.6, so I installed the matching version and restarted Apache.
$ sudo yum install -q -y rh-python36-mod_wsgi
[...]
$ sudo systemctl restart httpd
Sadly, that didn't solve the problem. When I looked in Apache's modules folder, nothing had changed. Weird!
$ ls -l /lib64/httpd/modules
[...]
-rwxr-xr-x. 1 root root 172800 Oct 30 22:44 mod_wsgi.so
So what did get installed?
$ rpm -ql rh-python36-mod_wsgi
/opt/rh/httpd24/root/etc/httpd/conf.modules.d/10-rh-python36-wsgi.conf
/opt/rh/httpd24/root/usr/lib64/httpd/modules/mod_rh-python36-wsgi.so
/opt/rh/rh-python36/root/usr/share/doc/rh-python36-mod_wsgi-4.5.18
/opt/rh/rh-python36/root/usr/share/doc/rh-python36-mod_wsgi-4.5.18/CREDITS.rst
/opt/rh/rh-python36/root/usr/share/doc/rh-python36-mod_wsgi-4.5.18/LICENSE
/opt/rh/rh-python36/root/usr/share/doc/rh-python36-mod_wsgi-4.5.18/README.rst
Extra Configuration Steps
It installed the files I need, but it didn't put them anywhere useful. With some hints from the README.rst file, I copied them into the right place.
sudo cp /opt/rh/httpd24/root/usr/lib64/httpd/modules/mod_rh-python36-wsgi.so /lib64/httpd/modules
sudo cp /opt/rh/httpd24/root/etc/httpd/conf.modules.d/10-rh-python36-wsgi.conf /etc/httpd/conf.modules.d
sudo systemctl restart httpd
Now I have the right version of mod_wsgi, and my Django app will run under Apache.
I see you already have the IUS repo enabled. Rather than jumping through SCL hoops, you can just install a normal package.
yum install python35u-mod_wsgi
This will use standard filesystem locations to work with stock Apache HTTPD 2.4.
/etc/httpd/conf.modules.d/10-wsgi-python3.5.conf
/usr/lib64/httpd/modules/mod_wsgi_python3.5.so
Have you check the rh-python35 Software Collection which provides a rh-python35-mod_wsgi package ?
More information about SCL, see:
The Software Collection (SCL) Repository
The Software Collection Special Interest Group
RHSCL 2.3 release announcement
I would use the SCL packages for python 3.6 (though feel free to substitute 3.5 below).
To start:
yum install centos-release-scl
yum install rh-python36 rh-python36-mod_wsgi
Note that will bring in the SCL package httpd24-httpd and put the mod_wsgi file in that installation. I would recommend you use that installation and not install the base CentOS httpd package. At time of writing, for CentOS 7, the httpd package is 2.4.6 and the httpd24-httpd package is 2.4.37.
Then you create a virtualenv with:
/opt/rh/rh-python36/root/usr/bin/python -m venv /path/to/venv36
source /path/to/venv36/bin/activate
pip install ...
Now you can put the config for your site in /opt/rh/httpd24/root/etc/httpd/conf.d/mysite.conf, which could contain something like:
<VirtualHost *:80>
LoadModule wsgi_module modules/mod_wsgi.so
ErrorLog /var/log/httpd24/mysite-err.log
CustomLog /var/log/httpd24/mysite.log combined
# recommended way of setting DJANGO_SETTINGS_MODULE http://stackoverflow.com/a/25496668/3189
WSGIProcessGroup mysite.settings.production
WSGIDaemonProcess mysite.settings.production python-path=/path/to/mysite/:/path/to/venv36/lib/python3.6/site-packages
WSGIScriptAlias / /path/to/mysite/wsgi.py process-group=mysite application-group=%{GLOBAL}
</VirtualHost>
Now you start the SCL apache with:
systemctl start httpd24-httpd
And your site should be working.
After I updated to php7.0 now it's viewing the files, I firstly thought it was in apache itself, but i have reinstalled it, what could be the problem..?
ubuntu 15.04
Install PHP 7 and the Apache PHP module as follows:
apt-get -y install php7.0 libapache2-mod-php7.0
Then restart Apache:
service apache2 restart
Another possible reason could be short open tag. Configure php.ini files related line as: short_open_tag = On and restart php service.
There are a lot of guides out there about setup php-fpm for Apache on CentOS 5x or 6x but none of them are working on Centos 7. I searched for days but can't find any solution.
yum install php-fpm
This command succesfully working.
But then i stuck with this line:
yum install mod_fastcgi
The error is "There is no package as mod_fastcgi"
Is there any mod_fastcgi module compatible with CentOS 7? If so, how can i complete php-fpm setup? Please guide me.
My server have some trouble about memory usage. So i have to optimize Apache. Here is my "top" result.
Deploy PHP with FastCGI
If you are using PHP code with your application, you will need to implement “PHP-FastCGI” in order to allow Nginx to properly handle and parse PHP code. You can install this via YUM from the EPEL repository that was previously installed:
yum install php-cli php spawn-fcgi
Which SVN binaries support Apache 2.4.2 HTTP server?
Because I got an error on loading modules for SVN modules such as mod_dav_svn.so and mod_authz_svn.so.
Currently I am using Apache 2.4.2 with SVN 1.7.6 modules.
I managed to get it working on Windows with the binaries from Apache Haus:
https://www.apachehaus.com/cgi-bin/download.plx#MODULES24
Anyway, the error could be because of a missing library in the Apache bin folder.
You may try:
yum install mod24_dav_svn
See forum post mod_dav_svn for apache 2.4.