Giter VIP home page Giter VIP logo

custom-httpd's Introduction

Custom Apache HTTPD Server GCI Badge

Screenshot of its working

This guide will help you modify, compile and install a custom HTTPD server!

Getting Apache HTTPD

Downloading

To download the HTTPD Source code, you can go to the Apache Site. Or you could just directly download the file into your downloads folder like so

(On the day of creating this guide, the latest version is 2.4.41)

wget https://www-us.apache.org/dist//httpd/httpd-2.4.41.tar.gz

Extracting

Extract the gzip like so

gzip -d httpd-2.4.41.tar.gz
tar xvf httpd-2.4.41.tar

Now, you should see a directory containing all the files required to build httpd

Adding a custom version name

To add a custom version name, you can navigate to include/ap_release.h where it contains the httpd versioning parameters and modify the AP_SERVER_ADD_STRING.

#if !AP_SERVER_DEVBUILD_BOOLEAN
#define AP_SERVER_ADD_STRING "-gci"
#else
#ifndef AP_SERVER_ADD_STRING
#define AP_SERVER_ADD_STRING "-gci-dev"
#endif
#endif

Configuring Build

To configure the build, you can easily run the provided configure file

./configure

This will automatically configure to install to /usr/local/apache2. If you wanted to install this somewhere else you can define the prefix parameter and the path where you want it to be installed.

./configure --prefix=/path/to/installation

Compiling and Installing

To compile and install the custom Apache HTTPD server, run

make

and then

sudo make install

This will compile and install automatically to /usr/local/apache2.

Starting the server

To start the server, you can run

sudo /usr/local/apache2/bin/apachectl -k start

or

sudo /path/to/installation/bin/apachectl -k start

Testing if it works

After starting the server, you can test it by going to localhost and it should return you the index.html

Checking the log

The logs will also include your custom name, to check it you can go to logs/error_log in your installation.

[Fri Jan 10 20:17:50.912250 2020] [mpm_event:notice] [pid 16855:tid 140452566600640] AH00489: Apache/2.4.$
[Fri Jan 10 20:17:50.912731 2020] [core:notice] [pid 16855:tid 140452566600640] AH00094: Command line: '/$

Replacing index.html

You can replace the index.html that is located in the htdocs of your installation to see if it works!

Congratulations! You've build your own custom apache server!

custom-httpd's People

Contributors

reaganiwadha avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.