Didn't work for me on Ubuntu It just returns the PID of grep. Add a comment. Or, on systems where httpd is renamed, perhaps apache2ctl -V This will return various details about how httpd is built and configured, including the default location of the main configuration file. Rich Bowen Rich Bowen 5, 2 2 gold badges 15 15 silver badges 15 15 bronze badges. For me, what worked is the apache2ctl -V command and looking for the path in what is listed after.
I get the command httpd was not found. Try "apachectl -V" if "httpd -V" don't work — Somnath Pawar. On ubuntu you may have apache2. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta. Now live: A fully responsive profile. Linked The result is that Apache dynamically generates an overarching configuration file on startup.
If you scroll to the bottom of the file, there are a number of different "Include" statements. These load module definitions, the ports. By default, this parameter is set to "", which means that the server has a maximum of seconds to fulfill each request.
This is probably too high for most set ups and can safely be dropped to something between 30 and 60 seconds. This option, if set to "On", will allow each connection to remain open to handle multiple requests from the same client. If this is set to "Off", each request will have to establish a new connection, which can result in significant overhead depending on your setup and traffic situation.
This controls how many separate request each connection will handle before dying. Keeping this number high will allow Apache to serve content to each client more effectively.
Setting this value to 0 will allow Apache to serve an unlimited amount of request for each connection. This setting specifies how long to wait for the next request after finishing the last one. If the timeout threshold is reached, then the connection will die. This just means that the next time content is requested, the server will establish a new connection to handle the request for the content that make up the page the client is visiting.
You can cross-reference which section your Apache installation was compiled with by exiting into the terminal and typing:. As you can see, in this server, "prefork. Your installation may have multiple to choose from, but only one can be selected.
The default Virtual Host declaration can be found in a file called "default" in the "sites-available" directory. We can learn about the general format of a Virtual Host file by examining this file.
Open the file with the following command:. The default Virtual Host is configured to handle any request on port 80, the standard http port. This does not mean that it will necessarily handle each request to the server on this port however. Apache uses the most specific Virtual Host definition that matches the request. This means that if there was a more specific definition, it could supersede this definition.
These options are set within the Virtual Host definition outside of any other lower level sub-declaration. They apply to the whole Virtual Host. The "ServerAdmin" option specifies a contact email that should be used when there are server problems. If we were using this as a template for other Virtual Host definitions, we would want to add a "ServerName" definition that specifies the domain name or IP address that this request should handle.
This is the option that would add specificity to the Virtual Host, allowing it to trump the default definition if it matches the ServerName value. You can also make the Virtual Host apply to more than one name by using the "ServerAlias" definition. This provides alternate paths to get to the same content. A good use-case for this is adding the same domain, preceded by "www". The "DocumentRoot" option specifies where the content that is requested for this Virtual Host will be located.
Within the Virtual Host definition, there are definitions for how the server handles different directories within the file system. Apache will apply all of these directions in order from shortest to longest, so there is again a chance to override previous options.
This will provide the baseline configuration for your Virtual Host, as it applies to all files served on the file system. By default, Ubuntu does not set up any access restrictions to the filesystem.
Apache recommends that you add some default access restrictions. You can modify this like so:. If you want to install Passenger in its Apache integration mode then you will reach a point where you have to edit Apache the configuration file.
This page provides information for those who are not familiar with how the Apache configuration file and its related directories are organized. On most systems if you installed Apache with a package manager, or it came preinstalled, the Apache configuration file is located in one of these locations:. Check your build script for more details.
Some paths are listed below, please refer to the macOS Server documentation for complete information. To allow better organization, many operating systems and Apache distributions also read configuration files in the conf.
0コメント