![]() ![]() If only a port number is specified, then Apache responds to requests on the specified port arriving at all interfaces on the machine. If you only specify an IP address, the server will respond to requests coming to all ports of that address (also called an interface). ![]() The default configuration sets the server to listen to port 80, the default port for HTTP communication. If nothing is specified, Apache listens to all addresses and ports on the machine. The Listen directive tells Apache what IP addresses and/or ports it should listen to for incoming requests. By doing this, the server checks its hosts file before consulting with the DNS server.Īssuming our domain name is and our server’s IP address is 117.220.48.20, you need to add the following line to the server’s hosts file (/etc/hosts):Īfter editing the hosts file, you need to restart (or stop and start) Apache. Otherwise, you would need to add the domain name and IP address to the server’s hosts file- the same as you do with your PC’s hosts file. ![]() You will have to use the IP address of your machine if you don’t yet have a registered domain name. You should always set a ServerName for the server explicitly it is the only value you need to set to get your server running after installation. If the ServerName directive is not specified, the server tries to obtain it by performing a reverse DNS look-up on its IP address. The location of your configuration files depend on both the Apache version and Linux distribution. You can set this directive either in the server’s configuration or virtual hosts. It uses this name when responding to HTTP requests. The ServerName directive is used to set the host name of the server, this is how the server identifies itself. Let’s discuss some most basic directives of Apache Server: Lines that begin with the hash character “#” are considered comments, and are ignored.īasic Paths of nf file in Unix/Linux system. There must be no other characters or white space between the backslash and the end of the line.ĭirectives in the configuration files are case-insensitive, but arguments of directives are case sensitive. The backslash “\” may be used as the last character on a line to indicate that the directive continues onto the next line. The nf file is well-commented and mostly self-explanatory.Ĭhanges to the main configuration files are only taken by Apache only if started/restarted.It stores information on various functions of the server, which can be edited by removing or adding a number sign “#” at the beginning of the line, thus setting values for each directive.Īpache configuration files contain one directive per line. The Apache HTTP Server configuration file is /etc/httpd/conf/nf. Every person working with the Apache server is likely to encounter these directives.Īpache HTTP Server is configured by placing directives in plain text configuration files, the main configuration file is usually called nf. Apache has a great number of directives which you can set and manipulate in order to set your server’s behavior.Įvery server administrator will often update some of the directives, it all depends on their particular needs. ![]()
0 Comments
Leave a Reply. |