How to Install apache httpd from source for jboss clustering - apache

I am currently setting up a JBoss EAP 7 cluster in domain mode and the goal is for an apache webserver to be installed as a load balancer. However, I am unable to install the httpd service from yum repositories as this is a VM that was provisioned by a client. I need to install httpd from its source which I have downloaded. My problem is that I am not sure about the configuration options to enable for this purpose. Any help would be appreciated. From the official website, the instruction doesn't give details about what modules to be enabled and I'm not sure which of them are relevant for my own purpose.
Download Download the latest release from http://httpd.apache.org/download.cgi
Extract $ gzip -d httpd-NN.tar.gz
$ tar xvf httpd-NN.tar
$ cd httpd-NN
Configure $ ./configure --prefix=PREFIX
Compile $ make
Install $ make install
Customize $ vi PREFIX/conf/httpd.conf
Test $ PREFIX/bin/apachectl -k start

Above provided link will contain all module which provided with default Apache httpd. You can download the Apache httpd source folder and check module information in modules.In Apache source module/proxy folder contains module information regarding the proxy configuration. i.e mod_proxy module.

I was able to do my installation by following the guide here

Related

How to install mod_wsgi for apache2.4 with python 3.6 in centos?

I am a new to web development.I have created Django(-v 2.2) web application and I want to deploy it on my linux server(OS Centos).After installation apache2, when I was going to install libapache2-mod-wsgi-py3, it says that no package available. Is there different name for libapache2-mod-wsgi-py3 for OS Centos?
It is always recommended to install mod_wsgi directly into the python3 package using pip3.
pip3 install mod_wsgi
If you install mod_wsgi into the OS, it could cause conflict and unexpected behavior.
Do you have apache2-dev installed?
Also, for mod_wsgi it is better to go the CMMI path (configure-make-make install) in order to compile it with the correct version and load it in Apache as a module. This worked for me on Debian VPS:
To do so,
wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.6.5.tar.gz
tar xvfz 4.6.5.tar.gz
cd mod_wsgi-4.6.5
whereis apxs
whereis python3
./configure --with-apxs=/usr/bin/apxs --with-python=/usr/bin/python3.5
make
sudo make install
Double check the path for apxs and python, and run make install as sudo.
When it’s all ready, check the last line of prompt results, as there will be a path to a file: /usr/lib/apache2/modules/mod_wsgi.so
To cleanup after installation, run:
make clean
If you need to build the module for a different version of Apache, you should run:
make distclean
If you have a httpd.conf file, you should edit and add this line:
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
If not, create it and paste that line, and edit /etc/apache2/apache2.conf. file, by adding this line:
Include /etc/apache2/httpd.conf
You don't need that file to configure apache, but you can create it if other software relies on it being there.
You should restart Apache and check the log
sudo tail /var/log/apache2/error.log
as there should be a line that says:
Apache/2.4.25 (Debian) mod_wsgi/4.6.5 Python/3.5 configured -- resuming normal operations

Setup puppet and install apache package issues

For test purposes I wanted to setup puppet and deploy apache on Ubuntu 16.4 puppet master using puppet without bothering with using nodes by using the following steps:
$ wget https://apt.puppetlabs.com/puppet5-release-xenial.deb
Install the package by running:
$ dpkg –i puppet5-release-xenial.deb
Update package list
$ apt-get update
Install puppet server
$ sudo apt-get install puppetserver
On our Puppet server, install the puppetlabs-apache module:
$ sudo puppet module install puppetlabs-apache
From within the manifests directory, an init.pp class needs to be created
/etc/puppet/modules/apache/manifests/init.pp
class apache2 {
package {'apache2':
ensure => 'present',
}
}
To try to install the apache package I used:
$ sudo puppet apply init.pp
I then got the following:
Notice: Compiled catalog for osboxes.home in environment production in 0.03 seconds
Notice: Finished catalog run in 0.04 seconds
And when I check if apache is installed, it is not.
Where am I going wrong?
If you have the Apache module in the correct module path, then the problem is you don't have any code to include the module.
To keep it simple, let's forget about the file structure on the Puppet master and so forth and just create a file apache.pp (save it in /tmp or anywhere you like) and give it this content:
class apache2 {
package {'apache2':
ensure => 'present',
}
}
include apache2
Now try:
$ sudo puppet apply apache.pp
You should see Puppet install the apache2 package.
However, by convention, and also for proper integration with the Puppet master, you need to now place this content in expected file locations.
The class apache (the code you already had) needs to be in a file ${modulepath}/apache2/manifests/init.pp.
This is to satisfy Puppet's autoloader. You can find out more about that here.
Meanwhile, the modulepath is documented here, and it can vary depending on the version of Puppet, and how you set everything up.
To find out your modulepath try:
$ sudo puppet config print modulepath
Now, if you have all the files in place, you should next be able to include that class in a different way, like this:
$ sudo puppet apply -e "include apache2"
Once you get that working, it's time to read about the roles and profiles pattern.

apache default httpd.conf location

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.

Upgrade Apache 2.4.6 to 2.4.27 without losing config

I wan to updage my currently active apache v2.4.6 to latest ver 2.4.27. (CentOS 7)
I know how to install from stracth but I just want to upgrade the version with my configurations remain stil.
Would it be okay to remove whole httpd content with /etc/httpd, /run/httpd, and /usr/lib64/httpdwith takin configuration backup, then install 2.4.27 from scratch and paste the old config files?
Thank you in advance for any guidance
You can backup everything and add CodeIT rpm repo:
cd /etc/yum.repos.d && wget https://repo.codeit.guru/codeit.el7.repo
yum install -y epel-release
yum upgrade httpd
Please also be sure to merge your SSL configuration and mpm defaults to have new features like HTTP/2 protocol support enabled.

setting up tomcat in Ubuntu

I have gone through many tutorials for installing tomcat in my Ubuntu system. I installed tomcat7. tomcat7-admin, tomcat7-examples and tomcat7-docs by following commands:
apt-get install tomcat7
apt-get install tomcat7-admin
apt-get install tomcat7-docs
apt-get install tomcat7-examples
After this setup I can start, stop the server by:
/etc/init.d/tomcat7 start/stop
I have following files and folders:
/usr/share/tomcat7/
/etc/tomcat7/
/var/lib/tomcat7/
I have added the following user in tomcat-users.xml file under /usr/sharetomcat7/conf/tomcat-users.xml and /etc/tomcat7/tomcat-users.xml
<user username="admin" password="amdin" roles="admin-gui,standard,manager-gui"/>
Now when I open localhost:8080, I get a dull page saying 'It works' unlike the colorful page we get generally. These are the contents of page:
You might consider installing the following packages, if you haven't already done so:
tomcat7-docs: This package installs a web application that allows to browse the Tomcat 7 documentation locally. Once installed, you can access it by clicking here.
tomcat7-examples: This package installs a web application that allows to access the Tomcat 7 Servlet and JSP examples. Once installed, you can access it by clicking here.
tomcat7-admin: This package installs two web applications that can help managing this Tomcat instance. Once installed, you can access the manager webapp and the host-manager webapp.
But when I click on 'click here' link above to open admin, docs or examples I get "HTTP status 404: The requested resource is not available."
But I have installed admin, examples and docs. I am not getting it. Please help! I am using Ubuntu 13.04
on ubuntu 14.04 it worked for me using following command :
sudo apt-get install tomcat7-docs tomcat7-admin tomcat7-examples
Create a link for each application in webapps folder as below:
cd /var/lib/tomcat7/webapps
sudo ln -s /usr/share/tomcat7-examples/examples examples
sudo ln -s /usr/share/tomcat7-docs/docs docs
sudo ln -s /usr/share/tomcat7-admin/manager manager
sudo ln -s /usr/share/tomcat7-admin/host-manager host-manager