0

My Question

Does anyone have a link to a proper source package of Apache 2.2 for CentOS, and if so are there any special instructions I'm missing ?

Summary

I am trying to install Apache 2.2 on a AWS Linux AMI, The specific AMI ID is below:

Amazon Linux 2 AMI (HVM), SSD Volume Type - ami-0d1000aff9a9bad89

Since yum does not support anything before Apache 2.4, I need to download my 2.2 version from the Apache website and build it from source.

I also know that since I'm running CentOS I should be installing the 'httpd' version instead of 'apache2'

Part 1: Installing httpd with yum works, but only for Apache 2.4

If I do:

sudo yum install httpd

Everything installs as I would expect:

  • /var/www/html directory is created
  • /etc/httpd/conf/httpd.conf is
  • created I can run 'sudo service start httpd'
  • I am able to deploy my application
  • However, it installs Apache 2.4

Part 2: Download Apache 2.2 and building from source does not work as I'd expect

Since I have this requirement that I must run a 2.2 version of Apache, I download it to the instance and build from source using the commands below:

sudo wget https://archive.apache.org/dist/httpd/httpd-2.2.29.tar.gz
tar -zxf httpd-2.2.29.tar.gz
./configure
Make 
sudo Make install

After I run the above commands and build from source:

  • There is no /var/www/html directory created
  • There is no /etc/httpd directory created
  • I get the message below:

'Failed to start httpd.service: Unit not found.'

when running 'sudo service httpd start'

Side Note: I am aware I can copy things around and manually alter the conf file, the reason I believe something is awry is because I cannot run 'httpd' commands with the 2.2 version.

  • You compiled it from source. There isn't going to be a /var/www/html or an /etc/httpd directory nor will there be a service. The www directory and the config directory and files are going to be inside of the directory where you compiled it. You'll need to create a service for it so that you can start it with systemd and you'll have to add the directory containing the executables to your $PATH. What you are looking for is only provided if you install it the package with either yum or rpm. – Nasir Riley Oct 27 '18 at 0:25
0

1. There is no /var/www/html directory created There is no /etc/httpd directory created

Manually create these two directories and assign proper permission and owner/group

2.Failed to start httpd.service: Unit not found when running 'sudo service httpd start'

Missing service file in /usr/lib/systemd/system Create httpd.service and edit the content from systemd documentation and softlink the file to /etc/systemd/system by enable the service

# systemctl enable httpd.service
# systemctl start httpd.service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.