Appendix F: Apache as Backend¶
- Install Apache. We will use it as backend.
- All commands are executed as
To install Apache in Ubuntu or Debian, type the command:
$ apt-get install apache2
For CentOS, RHEL or Fedora:
$ yum install httpd
curl is the tool typically used to transfer data from or to a server, but you might want to use something else, like
HTTPie, which has a very pretty color printing in the terminal.
To install HTTPie in Ubuntu or Debian:
$ apt-get install httpie
Verify that Apache works by typing
http -h localhost. You should see a
200 OKresponse from Apache.
Change Apache’s port from 80 to 8080. In Ubuntu or Debian, you do this in
/etc/apache2/sites-enabled/000-default.conf. In CentOS, RHEL or Fedora, edit
Restart Apache. In Ubuntu or Debian type
service apache2 restart. In CentOS, RHEL or Fedora:
$ systemctl enable httpd.service $ apachectl start
Verify that Apache listens on port
http -h localhost:8080