How to upgrade apache 2.2.15 to apache 2.4.12 on CentOS 6.6? - apache

I tried ,but didn't work for me.
Apache 2.4 on CentOS 6.6:
Step 1:
cd /etc/yum.repos.d/
wget http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-httpd24.repo
Step 2:
yum install httpd24.x86_64
Step 3:
$ /opt/rh/httpd24/root/usr/sbin/httpd -version
Server version: Apache/2.4.6 (Red Hat)
Server built: Sep 25 2013 05:25:46
NOTE: config files are in: /opt/rh/httpd24/root/etc/httpd
$ ls
conf conf.d conf.modules.d logs modules run
EDIT: in case you want to switch off Apache 2.2
$ chkconfig httpd off
$ chkconfig --list | grep httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
httpd24-httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
EDIT 2: http://wiki.apache.org/httpd/PHP-FPM
yum install php-fpm
/etc/init.d/php-fpm start
Does any body knows the solutions, please let me know.

It would be best if you built it yourself from the Apache source code on a CentOS 6.6 system.
Compiling and Installing Apache 2.4:
http://httpd.apache.org/docs/current/install.html
Make note of the configure line during the build so you can make sure it includes all the modules you want (Like mod_ssl...etc..). Details on what is available for the configure line located here http://httpd.apache.org/docs/current/programs/configure.html
$ CC="pgcc" CFLAGS="-O2" \
./configure --prefix=/sw/pkg/apache \
--enable-ldap=shared \
--enable-lua=shared
If you want your own RPM, create a SPEC file with your own customizations.

The easiest way is to install the SCL version, as described here:
https://unix.stackexchange.com/questions/412122/how-to-update-apache-to-2-4-29-using-scl

Related

Homebrew Apache directories on MacOS Big Sur

I went thru any tutorial I could find to install and configure Apache on Big Sur. Invariably, the tutorial when discussing the config files will point to /usr/local/etc/httpd/httpd.conf that needs to be massaged a bit. The only trouble is that the file doesn't exist when I check that dir. Any idea? Thanks for your help in advance.
EDIT: I did an uninstall and install of httpd per requested and I still don't get the /usr/local/. There must be something different the homebrew configuration.
➜ ~ brew uninstall httpd
Uninstalling /opt/homebrew/Cellar/httpd/2.4.49... (1,660 files, 31.9MB)
➜ ~ brew install httpd
==> Downloading https://ghcr.io/v2/homebrew/core/httpd/manifests/2.4.49
Already downloaded: /Users/johnny/Library/Caches/Homebrew/downloads/6c60d66c3915be5c993e144a743960b9e6be26e557efeeb6c61f530c79ffed34--httpd-2.4.49.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/httpd/blobs/sha256:e6ebcb4a1307
Already downloaded: /Users/johnny/Library/Caches/Homebrew/downloads/8506f199d5d7def536481d6fa87aa94c25201b57072d032e97edb8ce78fa86a3--httpd--2.4.49.arm64_big_sur.bottle.tar.gz
==> Pouring httpd--2.4.49.arm64_big_sur.bottle.tar.gz
==> Caveats
DocumentRoot is /opt/homebrew/var/www.
The default ports have been set in /opt/homebrew/etc/httpd/httpd.conf to 8080 and in
/opt/homebrew/etc/httpd/extra/httpd-ssl.conf to 8443 so that httpd can run without sudo.
To restart httpd after an upgrade:
brew services restart httpd
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/httpd/bin/httpd -D FOREGROUND
==> Summary
🍺 /opt/homebrew/Cellar/httpd/2.4.49: 1,660 files, 31.9MB
➜ ~
[Edited and updated]
I am using macOS Catalina 10.15.7 / Xcode-select version 2373 and by running $ brew install httpd I can install the Apache service under /usr/local/
Can you please remove and install it again by using the same command and sharing all the output?
These are the important things:
DocumentRoot is /usr/local/var/www.
The default ports have been set in /usr/local/etc/httpd/httpd.conf to 8080 and in
/usr/local/etc/httpd/extra/httpd-ssl.conf to 8443 so that httpd can run without sudo.
To start httpd:
brew services start httpd
Or, if you don't want/need a background service you can just run:
/usr/local/opt/httpd/bin/httpd -D FOREGROUND
This is the list of directories.
$ ls -lrt /usr/local/etc/httpd
total 200
drwxr-xr-x 14 user admin 448 Sep 22 23:35 extra
-rw-r--r-- 1 user admin 21222 Sep 22 23:35 httpd.conf
-rw-r--r-- 1 user admin 13064 Sep 22 23:35 magic
-rw-r--r-- 1 user admin 60847 Sep 22 23:35 mime.types
drwxr-xr-x 4 user admin 128 Sep 22 23:35 original
And this is my test showing it is working.
$ curl localhost:8080
<html><body><h1>It works!</h1></body></html>
$ tail -f /usr/local//var/log/httpd/access_log
::1 - - [22/Sep/2021:23:39:35 -0500] "GET / HTTP/1.1" 200 45
Based on your output and the brew documentation I believe you are using Apple Silicon is that correct, can you confirm?
https://docs.brew.sh/Installation
This script installs Homebrew to its preferred prefix (/usr/local for macOS Intel, /opt/homebrew for Apple Silicon, and /home/linuxbrew/.linuxbrew for Linux) so that you don’t need sudo when you brew install. It is a careful script; it can be run even if you have stuff installed in the preferred prefix already. It tells you exactly what it will do before it does it too. You have to confirm everything it will do before it starts.

How to enable Brotli on Debian 10 with DirectAdmin?

I'm running the latest version of DA (1.61.3), PHP 7.4.7 en Apache 2.4.43 on a Debian 10 server. I want to add Brotli support en did this:
Installed Brotli package on Debian (apt-get install brotli)
Added brotli module to apache for custombuild, following: https://help.directadmin.com/item.php?id=191 (--with-brotli)
After this I checked at https://www.brotli.pro and https://tools.keycdn.com/brotli-test, but it fails, says: no Brotli support.
In PHP info I see under the section curl this:
Before BROTLI was not mentoined here, so something is installed, but as you can see the value is "No".
What do I have to do more to enable Brotli?
Thanks for help!
Try this ...
Check if the brotli module is really active in Apache:
httpd -t -D DUMP_MODULES
then recompile the php
cd /usr/local/directadmin/custombuild
./build php
./build rewrite_confs

cloudflare install error on apache : httpd is needed by mod_cloudflare

I tried to install mod_cloudflare on Apache.
but it says :
# rpm -i mod_cloudflare-el6-x86_64.latest.rpm
mod_cloudflare-el6-x86_64.latest.rpm: Header V4 DSA/SHA1 Signature, key ID 8e5f9a5d: NOKEY
error: Failed dependencies:
httpd is needed by mod_cloudflare-1.2.0-1360806316.el6.x86_64
but I have apache installed :
# httpd -v
Server version: Apache/2.4.12 (Unix)
Server built: Apr 16 2015 16:27:46
Cpanel::Easy::Apache v3.28.7 rev9999
How can I make it work?!
have you install glibc
try yum install glibc.i686 and try rpm -i mod_cloudflare-el6-x86_64.latest.rpm again. hope it works
For CentOS:
# yum install libtool httpd-devel
# wget https://www.cloudflare.com/static/misc/mod_cloudflare/mod_cloudflare.c
# apxs -a -i -c mod_cloudflare.c
Add the following line within the Webuzo Apache Configuration:
LoadModule cloudflare_module /usr/lib64/httpd/modules/mod_cloudflare.so
Restart Apache.
mod_cloudflare is now working
You are probably better off following the manual installation guide on cloudflares site for mod_apache:
http://www.cloudflare.com/resources-downloads

Apache server is running but httpd is not running

I'm facing a weird problem. When I access the web-accessible directory of my server via domain linked to it. It says:-
Not Found
The requested URL / was not found on this server.
When I run this command on my server (via putty), it displays few processes ids demonstrating that Apache web server is running (correct me).
root#...:~# pgrep apache
4733
13505
13506
13507
13508
13686
14199
17672
But when I run this command, it says that httpd: unrecognized service
root#...:~# service httpd status
httpd: unrecognized service
Some other commands output:-
root#...:~# ps aux|grep -i http
root 29401 0.0 0.0 6460 792 pts/0 S+ 02:21 0:00 grep --color=auto -i http
How can I fix this?
Update:-
root#...:~# chkconfig --list | grep httpd
-bash: chkconfig: command not found
root#...:~# find / -name httpd*
/var/www/vhosts/lvps5-35-241-230.dedicated.hosteurope.de/httpdocs
/var/www/vhosts/.skel/0/httpdocs
/opt/psa/var/httpd_restart
/usr/lib/apache2/modules/httpd.exp
/usr/share/doc/apache2-doc/manual/fr/programs/httpd.html
/usr/share/doc/apache2-doc/manual/pt-br/programs/httpd.html
/usr/share/doc/apache2-doc/manual/da/programs/httpd.html
/usr/share/doc/apache2-doc/manual/zh-cn/programs/httpd.html
/usr/share/doc/apache2-doc/manual/tr/programs/httpd.html
/usr/share/doc/apache2-doc/manual/en/programs/httpd.html
/usr/share/doc/apache2-doc/manual/ja/programs/httpd.html
/usr/share/doc/apache2-doc/manual/ko/programs/httpd.html
/usr/share/doc/apache2-doc/manual/de/programs/httpd.html
/usr/share/doc/apache2-doc/manual/es/programs/httpd.html
/usr/share/doc/apache2-doc/examples/apache2/original/httpd.conf.gz
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-autoindex.conf
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-manual.conf
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-userdir.conf
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-vhosts.conf
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-languages.conf.gz
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-ssl.conf.gz
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-mpm.conf.gz
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-multilang-errordoc.conf
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-default.conf
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-dav.conf
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-info.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-autoindex.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-manual.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-userdir.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-vhosts.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-languages.conf.gz
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-ssl.conf.gz
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-mpm.conf.gz
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-multilang-errordoc.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-default.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-dav.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-info.conf
/etc/apache2/httpd.conf
/etc/apache2/httpd.pem
root#...:~# whereis httpd
httpd:
root#...:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise
root#...:~# ls /etc/init.d
README hostname network-interface-container plymouth-upstart-bridge rc spamassassin udevtrigger
apache2 hwclock network-interface-security portmap rc.local ssh umountfs
bind9 hwclock-save networking portmap-wait rcS stop-bootlogd umountnfs.sh
bluetooth keymap.sh ondemand postfix reboot stop-bootlogd-single umountroot
bootlogd killprocs passwd procps rpcbind-boot sudo unattended-upgrades
console-screen.sh klogd pc-remote psa rsync sw-cp-server urandom
courier-imap module-init-tools plymouth psa-firewall saslauthd sysklogd wide-dhcpv6-client
cron modules_dep.sh plymouth-log psa-firewall-forward screen-cleanup udev x11-common
dbus mongodb plymouth-ready psa-spamassassin sendsigs udev-fallback-graphics xinetd
fetchmail mysql plymouth-splash quota single udev-finish
halt network-interface plymouth-stop quotarpc skeleton udevmonitor
root#...:~# ls /etc/xinetd.d
chargen daytime discard echo ftp_psa poppassd_psa time
Is httpd listed in your /etc/xinetd, /etc/xinet.d, /etc/xinitd.d, or /etc/init.d directory? Also use chkconfig to see if httpd is listed.
# chkconfig --list | grep httpd
If it's not:
# find / -name httpd*
or
# whereis httpd
to find where it might be installed at. Then I'd make a symbolic link to it in (depending on you linux / unix flavor) /etc/xinetd, /etc/xinet.d, /etc/xinitd.d, or /etc/init.d.

Apache httpd setup and installation

I am trying to install Apache HTTP server locally in my box as a regular user (non-root).
I have downloaded Apache 2.4.1 version of Apache HTTP server [http://httpd.apache.org/download.cgi]. However when I am trying to build and install locally in my box I am getting below error:
httpd/httpd-2.4.1 1059> ./configure
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
Configuring Apache Portable Runtime library ...
checking for APR... no
configure: error: APR not found. Please read the documentation.
I am not sure what dependency it is looking for - I mean the download package does not contains it? What I need to do to build / deploy Apache HTTP server?
When it tells you Please read documentation it means that you should go read Apache documentation ( http://httpd.apache.org/docs/2.4/install.html ) which tells you to
download the latest versions of both APR and APR-Util from Apache APR,
unpack them into ./srclib/apr and ./srclib/apr-util (be sure the
domain names do not have version numbers; for example, the APR
distribution must be under ./srclib/apr/)
then do
./configure --with-included-apr
For Ubuntu 11.10 this option seems to be working well:
# APR
wget http://mirrors.axint.net/apache//apr/apr-1.4.6.tar.gz
tar -xvzf apr-1.4.6.tar.gz
cd apr-1.4.6/
./configure
make
make install
cd ..
# APR Utils
wget http://mirrors.axint.net/apache//apr/apr-util-1.4.1.tar.gz
tar -xvzf apr-util-1.4.1.tar.gz
cd apr-util-1.4.1
./configure --with-apr=/usr/local/apr
make
make install
cd ..
# Apache
wget http://apache.petsads.us//httpd/httpd-2.4.1.tar.gz
tar -xvzf httpd-2.4.1.tar.gz
cd httpd-2.4.1
./configure --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache --enable-deflate --enable-expires --enable-headers --enable-usertrack --enable-ssl --enable-cgi --enable-vhost-alias --enable-rewrite --enable-so --with-apr=/usr/local/apr/
make
make install
cd ..
You can find more about it below
Source: VaporCreations.com
If you have Debian/Ubuntu you can just:
apt-get install libapr1-dev libaprutil1-dev
Then ./configure
Done
Here are the steps of how I installed apache-httpd on a non-root users:
Download and extract apache-httpd-2.4.2 (but before ./configuring,
making and installing it, follow the steps below:)
Download and extract APR & APR-UTIL into "./srclib/apr" &
"./srclib/apr-util" folders. This requires ./configure
--with-apr=./apache/httpd-2.4.2/srclib/apr (and) --with-included-apr (options).
Download, extract, ./configure (with) --prefix=localURL, make and
make install PCRE into "./pcre" folder. This requires ./configure
--with-pcre=/home/username/apache/pcre (option).
Configure apache-httpd by entring following command (I like to
enable certain options as written in the command below):
./configure --enable-file-cache --enable-cache --enable-disk-cache
--enable-mem-cache --enable-deflate --enable-expires --enable-headers --enable-usertrack --enable-cgi --enable-vhost-alias --enable-rewrite --enable-so --with-apr=/home/username/apache/httpd-2.4.2/srclib/apr --prefix=/home/username/apache/httpd-2.4.2/ --with-included-apr --with-pcre=/home/username/apache/pcre
Note: When configuring apache-httpd, use option "--enable-ssl" ONLY if OpenSSL is installed otherwise DON'T enable it.
Now on the command-line, enter 'make' and 'make install' command.
Open and configure the 'httpd.conf' file e.g.:
"vi /home/eddie_kumar/apache/httpd-2.4.2/conf/httpd.conf"
IMPORTANT: don't forget to change the default port from 80 to something else e.g. 8080, this is especially important for non-root
user. (How to? open httpd.conf -> search "Listen 80" -> change it
to "Listen 8080".
And that's it, now open your browser enter "localhost:8080", it should display "It works!".
If you are using fedora, you can use yum to install APR, APR-Util and PCRE. You'll also need to download apr-devel, apr-util-devel and pcre-devel.
That being said, you can just run the following command on your terminal and no more "configure: error: APR not found.. ..APR-Util and PCRE" errors.
yum -y install arp apr-devel apr-util apr-util-devel pcre pcre-devel
I'm using fedora 17 and planning on using a shell script to setup apache 2.4.3. So yum works pretty slick instead of manually downloading apr, apr-util, and pcre.
1, You need APR (apache portable runtime), which is core component of apache web server
2, If you wnat to do make install, you may need root account
3, Even if not, apache can not start to listen on unprivileged port (lower then 1024) without root account
4, gain root or ask someone with root to install apache from official repo(I don;t know which distro you run) like using yum, apt-get, etc...
Apr or pcre related errors require the source to be downloaded and Apache HTTPD "configure" process needs to be made aware of these source locations on your file system. For instance: if you downloaded the source for APR at ./srclib (relative to apache httpd) then you would use
--with-included-apr
as the configure option.
On the other hand if you want to not build but install APR / APR-UTIL, then you need the following on CentOS / RedHat:
yum install apr-util-devel apr-devel
However it might so happen that the APR version provided by yum does not match what is expected by this version of Apache httpd. In that case you could download APR and APR-UTIL and use the --with-included-apr option.
You could also build PCRE utilizing the same "configure, make, make install" process and then continue where you left off building Apache httpd.
Or you could install pcre:
yum install pcre-devel
If while building PCRE: you see "compile: unrecognized option" then perhaps you would need other dependencies as well: Please see the details at:
http://khanna111.com/wordPressBlog/2012/09/11/94087-2/
It also covers "mod_deflate" and "zlib" as well.
Basic steps
tar -xvf httpd-2.4.1-customized.tar -C ../
#Balancer folder will be created
tar -xvzf openssl-1.0.1.tar.gz -C /balancer/
cd ->/balancer/openssl-1.0.1
./config --prefix=/usr/local/ssl/ shared zlib-dynamic enable-camellia
make depend
make
make install
tar -xvzf pcre-8.30.tar.gz -C ../balancer/
/balancer/pcre-8.30
./configure --prefix=/usr/local/pcre/
make
make install
remove pcre and openssl
Installing and compiling the Apache server on Ubuntu machine
step 1:Install the Java JDK
sudo apt install openjdk-11-jdk
sudo gedit /etc/environment
JAVA_HOME="/usr/lib/jvm/openjdk-11"
source /etc/environment
echo $JAVA_HOME
verify the java version
javac --version
**** install Other required packages:**
sudo apt-get install apache2-dev -y
sudo apt-get install libpcre3 libpcre3-dev
Step 2 :To Install Apache HTTP Server
#1 For ubuntu ,install development tools including the C compiler:
sudo apt-get install build-essential checkinstall
#2 Download and Extract the required files
assuming that all the files have been downloaded into the ~/Downloads directory
Download the Apache HTTP Server httpd-2.4.41.tar.gz from Apache download page (https://httpd.apache.org/download.cgi)
and following required libraries for compiling the apache HTTP server:
apr-1.7.0.tar.gz(http://apr.apache.org/download.cgi)
apr-util-1.6.1.tar.gz(http://apr.apache.org/download.cgi)
pcre2-10.34.tar.gz (ftp://ftp.pcre.org/pub/pcre/) http://pcre.org/
****Read Requirements Section(http://httpd.apache.org/docs/2.4/install.html)***
#3 Extract the tar files
tar -xvf httpd-2.4.41.tar.gz
tar -xvf apr-1.7.0.tar.gz
tar -xvf apr-util-1.6.1.tar.gz
tar -xvf pcre2-10.34.tar.gz
after extraction you should see following list of directories in ~/Downloads
httpd-2.4.41
apr-1.7.0
apr-util-1.6.1
pcre2-10.34
#4 Create a directory for the apache HTTP Server
*make sure to give all rights to this directory so that while compiling files can be read/written
sudo mkdir /home{your username here}/apache
To give all permissions to a apache directory :
sudo chmod -R 777 /home{your username here}/apache
#5 copy the arp and arp-util directory into the ~/Downloads/httpd-2.4.41/srclib/
cd ~/Downloads
mv apr-util-1.6.1 ~/Downloads/httpd-2.4.41/srclib/apr-util
mv apr-1.7.0 ~/Downloads/httpd-2.4.41/srclib/apr
#6 Configure the sources for compilation.
The --prefix option can be used to install the Web server in a location where you can write files.
cd ~/Downloads/httpd-2.4.41/
./configure --prefix=/home/{username here}/apache --with-pcre=~/Downloads/pcre2-10.34
NOTE:
If you have some problems while running above command,you can also try
insallting pcre in /usr/local/pcre, using
./configure --prefix=/usr/local/pcre
make
sudo make install
commands and then by running folllowing commands:
cd ~/Downloads/httpd-2.4.41/
./configure --prefix=/home/{username here}/apache --with-pcre=/usr/local/pcre
make
sudo make install
If you still face some problems ,make sure that ~/apache and its nested directory have read/write permissions. if not run **sudo chmod -R 777 /home{your username here}/apache** command again.
#7 Compile Apache HTTP Server.
cd ~/Downloads/httpd-2.2.25
sudo make
#8 Install Apache HTTP Server.
cd ~/Downloads/httpd-2.2.25
sudo make install
Optional
#9 To Prepare Your Hosts File
sudo gedit /etc/hosts
27.0.0.1 localhost www.example.com
sudo gedit /home/{your username here}/apache/conf/httpd.conf
and copy:
Listen 8000
ServerName www.example.com:8000
#10 Test the installation to ensure Apache HTTP Server is working.
/home/{your username here}//apache/bin/apachectl -k start