We had a good session on apache by our senior Mr.arwin. Here are some things on what we discussed on the session.
Apache:
Apache is a freely available (http) web server.The work of apache is that to create a open source http server that runs on all the operating systems..
The main task of a Web server is to translate a request into a response suitable for the circumstances at the time. When the client opens communication with Apache, it sends Apache a request for a resource. Apache either provides that resource or provides an alternative response to explain why the request couldn’t be fulfilled. In many cases, the resource is a Hypertext Markup Language (HTML) Web page residing on a local disk, but this is only the simplest option. It can be many other things, too—an image file, the result of a script that generates HTML output, a Java applet that’s downloaded and run by the client, and so on.
Here we go:
*In linux you can install apache using the following conmmand
sudo apt-get install apache2
*Then netstat it (ie.netstat is a network statistics)that will give the incoming ang outgoing connections using netstat -pan |grep apache
*This will show only a non own process do a sudo command so that u can view all the process.
*This will show a details like port,ipaddress and listen etc
*Then find where the apache is using the command $whereis apache2
*From here u can go the folder of where apache is..
*apache -V will give all the compiled contents of server including the root and config
*From the given path in the list u can go to the config file and view it
FOR CREATING A NEW MODULE:
*You can also create anew module by installing the
sudo apt-get install apache2-prefork-dev
*After installing you are ready to create a module using command
sudo apxs2 -g -n "module name"
*The module files will be created
*From there go to the module folder and view the .c file
sudo vi mod_filename.c
*You can make changes over this files and save it
*we have to compile this file using the command
sudo apxs2 -c -i "mod_filename.c"
*Then go the .c file and copy the load file with the locationand paste it in the apache2.conf wat we see earlier
*Paste it in the Apache2.conf
*After pasting restart the apache with the command
sudo apachectl restart
Hope it helped a bit to get started with apache..