How to install apache 2.4.46 from Source on Ubuntu [closed] - apache

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
How can I install Apache 2.4.46 in Ubuntu from source, because I want to have the pure package, without tweaks.
The apache2 installed from apt might be more secure, but this is my intention.

Please note that you should always install the latest version of a software for more security. I suggest you to install Apache from Ubuntu's apt package manager 'if you are on a production server'. Installing it from source on a local environment doesn't matter. This tutorial is for Ubuntu/Debian based systems.
Please follow this for the instructions of installing it, by me, with a bit more explanation. Go to the terminal, and enter the following commands one by one and hit enter for no confusion:
Install some required libraries:
sudo apt install libnghttp2 libpcre3 libssl build-essential -y
Navigate to the directory from which we will be compiling apache.
cd /usr/local/src
In your browser, go to http://httpd.apache.org/download.cgi.
Right click and copy the link location of the link looking like Source: httpd-2.4.46.tar.gz
sudo wget -O- <download-link> | tar -zxf -
Also go to http://apr.apache.org/download.cgi and copy the link location for Unix Source: apr-1.7.0.tar.gz
sudo wget -O- <apr-download-link> | tar -zxf -
Go to http://apr.apache.org/download.cgi and copy the link location for Unix Source: apr-util-1.6.1.tar.gz
sudo wget -O- <apr-util-download-link> | tar -zxf -
Move the downloaded and extracted apr files to the right location:
sudo mv apr- httpd-/srclib/apr
Move the downloaded and extracted apr-util files to the right location:
sudo mv apr-util- httpd-/srclib/apr-util
Navigate into the httpd directory:
cd httpd-
According to me, this configuration is better than any other. The --prefix is where apache is installed.
sudo ./configure --prefix=/usr/local/apache2 --enable-mods-shared="reallyall" --enable-mpms-shared="all"
Compile the sources:
sudo make
Install the compiled application to your system:
sudo make install
These directories could be altered using different arguments in step 9. (the sudo ./configure command)
The apache directory is /usr/local/apache2.
The apache conf directory is /usr/local/apache2/conf.
The apache main conf file is /usr/local/apache2/conf/httpd.conf.
For more info go to http://httpd.apache.org/docs/current/install.html.

Related

How to install apache 2.4.12 from source onto Ubuntu 14.04

I tried to install Apache 2.4.12 from the installation page on the Apache website but to no avail. It said that I needed to install APR, APR-Util and Perl-Compatible Regular Expressions Library (PCRE). So I downloaded them and installed them, so I thought it still gave me an error I think that I am compiling something wrong so if someone could lead me in the right direction that would be great.
Thanks.
why don't you just use:
sudo apt-get install apache2
Cheers,
Nioidai
Please note that you should always install the latest version of a software for more security. I suggest you to install Apache from Ubuntu's apt package manager 'if you are on a production server'. Installing it from source on a local environment doesn't matter.
I've also been trying to do this lately.
Please follow this for the instructions of installing it, by me, with a bit more explanation.
Hope it helps.
To be clean, follow the same steps:
1) Go to http://httpd.apache.org/download.cgi
2) Right click and copy the link of the link like 'Source: httpd-2.4.41.tar.gz'
3) Go to the terminal, and enter the following commands one by one and hit enter for no confusion:
a.
cd /usr/local/src
b.
sudo wget -O- <download-link> | tar -zxf -
c.
sudo apt install libnghttp2 libpcre3 libssl build-essential -y
d. Go to http://apr.apache.org/download.cgi and copy the link like 'Unix Source: apr-1.7.0.tar.gz'
sudo wget -O- <apr-download-link> | tar -zxf -
e. Go to http://apr.apache.org/download.cgi and copy the link like 'Unix Source: apr-util-1.6.1.tar.gz'
sudo wget -O- <apr-util-download-link> | tar -zxf -
f.
sudo mv apr-<apr-version> httpd-<apache-version>/srclib/apr
g.
sudo mv apr-util-<apr-util-version> httpd-<apache-version>/srclib/apr-util
h.
cd httpd-<apache-version>
i. According to me, this configuration is better than any other. The --prefix is where apache is installed.
sudo ./configure --prefix=/usr/local/apache2 --enable-mods-shared="reallyall" --enable-mpms-shared="all"
j.
sudo make
k.
sudo make install
These directories could be altered using the Step 'i'
The apache directory is /usr/local/apache2.
The apache conf directory is /usr/local/apache2/conf.
The apache main conf file is /usr/local/apache2/conf/httpd.conf.
For more info go to http://httpd.apache.org/docs/current/install.html.
Thanks

Compiling libapache2-svn for Apache 2.4.4

I want to use Apache 2.4.4 with SVN on Ubuntu server 12.04 (Precise Pangolin). But when I use
apt-get install libapache2-svn
I get the following dependencies error
The following packages have unmet dependencies:
libapache2-svn : Depends: apache2.2-common but it is not going to be installed
Googling around I got some suggestion about compiling from source by hand. I don't know how to do that. How can I do it?
I have two solutions:
Follow the instructions in this Server Fault Q&A.
*Note: Create another user if you're using a root account on the server.
I've asked Ondřej Surý on Launchpad to add Subversion to his Apache PPA. You can add Ondřej Surý's PPA to perform a normal update/upgrade.
You did ask Ondrej to include Subversion in his PPA launchpad. But I couldn't install the libapache2-svn package after adding Ondrej's PPA.
Somehow the instructions provided for compiling didn't work for me so here's an alternative way to get it working.
Reference:
(https://askubuntu.com/questions/312568/where-can-i-find-a-subversion-1-8-binary)
WANDisco has Subversion 1.8 for Ubuntu then:
sudo sh -c 'echo "# WANdisco Open Source Repo" >> /etc/apt/sources.list.d/WANdisco.list'
sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu precise svn18" >> /etc/apt/sources.list.d/WANdisco.list'
wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add -
sudo apt-get update
After that:
apt-cache show subversion | grep '^Version:'
And then you should be good to install normally:
sudo apt-get install subversion libapache2-svn

Passenger/Apache missing gcc/zlib-devel on AWS/CENTOS

I am trying to install Passenger for Apache on an AWS instance running CENTOS. When I try to install it, it tells me:
GNU C++ compiler... not found
Zlib development headers... not found
These have both been installed (yum install gcc zlib-devel) and are at the latest version. gcc -v says that it's at 4.6.2.
I have seen similar questions where the accepted answer was to run
mount -o remount,rw,exec,nosuid /tmp
This returns the following:
mount: can't find /tmp in /etc/fstab or /etc/mtab
I have tried changing the permissions on the /tmp directory (it does exist, just doesn't appear to be mounted) with chmod 777 /tmp, but this did not allow the Passenger install to see the two packages.
Could someone please help me with this? I'm not sure what else to do at this point.
I couldn't solve the issue above, but I managed to install anyway by adding EPEL, then installing mod_passenger through yum:
rpm -Uvh http://ftp.linux.ncsu.edu/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum install mod_passenger

Upgrade native apache from 2.2.21 to 2.4.2 - Lion 10.7.4

As stated in the title, i have apache 2.2.21 running natively as part of my LAMP stack. I would like to upgrade apache to the latest version - 2.4.2. Is there a recommended or best practice to safely perform this operation without breaking stuff of loosing existing settings, etc?
Thank you for the time and direction.
I was able to install the latest version (2.4.2) using the steps below.
Install pcre (perl compatible regular-expression library) using fink (or what ever osx package manager you use)
$ fink install pcre
Install the latest (2.4.2 as of writing this) using the steps below
$ sudp apachectl stop
$ cd ~/Downloads/
$ curl -O http://mirror.uoregon.edu/apache//httpd/httpd-2.4.2.tar.gz
$ gzip -d httpd-2.4.2.tar.gz
$ tar xvf httpd-2.4.2.tar
$ cd httpd-2.4.2
$ ./configure
$ make
$ sudo make install
However, the new binaries got installed under /usr/local and doesn't seem to have overridden the default install locations on OSX lion. And I could not find a config.nice file to use as suggested by the apache upgrade documentation.
The original apache files httpd, apachectl and ab were located on /usr/sbin. Without having found any documentation to confirm this was the right thing to do, I went ahead and backed up the original files and sym-linked the new files from /usr/local/bin into /usr/sbin, as follows.
$ cd /usr/sbin
# backup the original files ...
$ sudo ln -s ../local/bin/ab ab
$ sudo ln -s ../local/bin/apachectl apachectl
$ sudo ln -s ../local/bin/httpd httpd
This seems to have worked, although it would be nice to get a confirmation from someone in the know.

How to download source code with Pacman on Arch Linux? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am using Arch Linux. I want to do the same thing like apt-get source coreutils; is it possible to download sources with Pacman? I didn't find a solution in the man pages.
How can I get the source code of a package?
pacman -S asp
say if you want the source code of the Linux command find
find out which package the command find belongs to:
pacman -Qo $(which find). The result is
"/usr/bin/find is owned by findutils 4.4.2-3".
asp export findutils
cd findutils
makepkg -o
Now you have your source code.
2018 Update:
The abs tool described below has been deprecated and it along with its rsync endpoint have been dropped since mid 2017.
The asp tool now provides similar functionality. More information here.
As already mentioned you can use the ABS (Arch Build System):
Install it using pacman:
sudo pacman -S base-devel abs
First, download the ABS tree:
sudo abs
Then, get a specific package:
sudo abs [package_name]
Then copy the package, whose source you want to have, from the local abs tree (e.g. /var/abs/core/findutils) to another directory, e.g. /home/blabla/abs
Then run makepkg:
if you only want to get the sources and don't want to build the package you can run makepkg -od
otherwise run makepkg -s, which will then handle all the package's dependencies automatically
watch out becaouse makepkg will overwrite your modifications, use makepkg -e to build your local sources instead
If you want to install the package you've built, run
pacman -U name-of-package.xz
Edit: This answer is outdated due to changes on ABS.
You get the package sources from the Arch Linux SVN repository, called ABS.
First find the package online:
http://www.archlinux.org/packages/?q=coreutils
Then, on the package details page, on the right side use the SVN links, e.g.:
http://repos.archlinux.org/wsvn/packages/coreutils/trunk/
And there, you have a sweet "Download" button, in this case it leads to:
http://repos.archlinux.org/wsvn/packages/coreutils/trunk/?op=dl&isdir=1
It is a little bit more complicated than apt-get source. But perhaps you find a tool on AUR that does the job for you, for example yaourt supports building from sources and exporting them.