Friday 19 September 2014

Setting Web server

Install Apache

Apache is a free open source software which runs over 50% of the world’s web servers.
To install apache, open terminal and type in these commands:
sudo apt-get update
sudo apt-get install apache2
That’s it. To check if Apache is installed, direct your browser to your server’s IP address (eg. http://12.34.56.789). The page should display the words “It works!" like this .
Apache has three main configuration files: access.confhttpd.conf, and srm.conf. If you are running Red Hat 4.0, these files will already be set with the correct directory paths. If you centralized the locations of all these files, but made those symbolic links as I mentioned above, things will still be fine since the symbolic links preserves where Red Hat installed everything.
If you are doing a "generic" installation or have some other setup, then you will need to do the following:
In access.conf, change/update these directory entries:
    <Directory /httpd/html>
    <Directory /httpd/cgi-bin>
In httpd.conf:
    ServerRoot /httpd
In srm.conf:
    DocumentRoot /httpd/html
    Alias /icons/ /httpd/icons/
    ScriptAlias /cgi-bin/ /httpd/cgi-bin/
Essentially, these are the necessary directives in the config files that need to be updated with the new "centralized" organization.
For further configuration options, I will have to give the standard statement, "Please refer to the docs." :)


To make a long story short, you simply to need to execute the binary "httpd". Typically, this is done when the system starts up, in one of the rc files.
In Red Hat 4.0, it has more of a System V'ish startup style. In /etc/rc.d/init.d resides httpd.init, which is the script used to start and stop httpd. You can also execute this by hand if you find the need.
For other systems (or a manual install), I suggest starting httpd after most other services have started (i.e.: put it in rc.local). A simple line such as
    /usr/sbin/httpd &



No comments:

Post a Comment