Because of Ubuntu updating, I made the mistake to upgrade Apache 2.2 to 2.4—many things went wrong.
I have no idea how to specify the version after apt-get remove apache2. apt-get install apache2 always installs 2.4.
How can I do it?
|
Because of Ubuntu updating, I made the mistake to upgrade Apache 2.2 to 2.4—many things went wrong. I have no idea how to specify the version after How can I do it? |
||||
|
|
|
You need to do the following:
The above command will display list of available versions for this package. Then select the needed version and do the following.
Example:
|
|||||||||
|
|
See the ubuntu howto on package pinning: Edit file The 'preferences' file is where the actual pinning takes place. To pin a package, set its Pin-Priority to higher number. Here's an example:
Test before running See Update: As Using this as
|
|||||||||||||||||
|
|
How to install Apache 2.2 on an Ubuntu distro that does not have it in the repositories. Requirements You need to have the build-essentials package installed to do this.
To give Apache the ability to compress output to browsers that support it, you need to install zlib. Download the current release from the zlip Hompage (zlib-1.2.11.tar.gz as of writing), extract it, navigate to the extracted folder, build, and install.
Install Apache 2.2 Download the curent version from the Apache Download Page (httpd-2.2.32.tar.gz as of writing), extract it, navigate to the extracted folder, build, and install.
Start Apache:
Check, if everything is OK Navigate to http://localhost in your browser, where you should see a message saying “It works!”. Alterntively, you can do this via terminal:
Which should output something like this in the terminal:
Create "service" for Apache2
Hint: you can call apachectl with sudo service apache22 now. Make Apache start at boot time
Secure Apache
Check new settings
If the terminal output of the last command shows some lines starting with "apache" then everything is OK. Configure your site(s) If you want to configure your apache for just one site, simply edit the httpd.conf
The essential parameters you may want to modify are:
If you want to configure more than one site, have a look at httpd-vhosts.conf
You will have to add a < Directory > section withing the < VirtualHost > similar to the one above, but for the document root of the VitualHost. For example:
|
|||||||||||||||||||||
|
|
You upgraded from Ubuntu 13.04 to 13.10? There is no way to get Apache 2.2 back without going outside the Ubuntu package repositories. It's better to just fix your Apache configuration so that it works with 2.4. |
|||||||||
|
|
To install apache2.2 use the following process: On a later distro (e.g. 16.04), I downloaded the 2.2.31 from the Apache site. I built it using the following configuration:
Then of course tweaking the httpd.conf and ssl.conf files. After that I just run the ./httpd -k start And it works ! note that I added the apache2.4 via apt-get but never removed it. This means that after system start, I need to kill the apache2 process. And then I am able to start apache2.2. I had to install apache2.4 to use apachectl but later disbanded that because I use ./httpd |
|||||
|