{"id":288424,"date":"2021-07-01T14:01:00","date_gmt":"2021-07-01T11:01:00","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-find-your-apache-configuration-folder-cloudsavvy-it\/"},"modified":"2021-07-01T14:01:00","modified_gmt":"2021-07-01T11:01:00","slug":"how-to-find-your-apache-configuration-folder-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-find-your-apache-configuration-folder-cloudsavvy-it\/","title":{"rendered":"#How to Find Your Apache Configuration Folder \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a22faa936fc7\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a22faa936fc7\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-find-your-apache-configuration-folder-cloudsavvy-it\/#The_Usual_Places\" >The Usual Places<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-find-your-apache-configuration-folder-cloudsavvy-it\/#Configuration_with_htaccess_Files\" >Configuration with .htaccess Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-find-your-apache-configuration-folder-cloudsavvy-it\/#How_to_Find_The_Configuration_Folder_Manually\" >How to Find The Configuration Folder Manually<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#How to Find Your Apache Configuration Folder \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage  alignnone wp-image-1368 size-full\" data-pagespeed-lazy-src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/08\/028af1f2-1.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Apache logo\" width=\"700\" height=\"300\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Apache uses configuration files to change its behavior. It usually stores them at <code>\/etc\/apache2\/<\/code>\u00a0on Unix systems, but the configuration directory can vary, depending on how it was installed\u00a0and which operating system you\u2019re running it on.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"The_Usual_Places\"><\/span>The Usual Places<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The primary way of configuring Apache is by modifying the main configuration file, usually located at:<\/p>\n<pre>\/etc\/apache2\/apache2.conf<\/pre>\n<p>This file can also be named <code>httpd.conf<\/code>\u00a0on older installs. If it\u2019s not there, it\u2019s likely in one of the following places:<\/p>\n<ul>\n<li><code>\/etc\/httpd\/httpd.conf<\/code><\/li>\n<li><code>\/etc\/httpd\/conf\/httpd.conf<\/code><\/li>\n<li><code>\/usr\/local\/apache2\/apache2.conf<\/code>\u2014if you\u2019ve compiled from source, Apache is installed to <code>\/usr\/local\/<\/code>\u00a0or <code>\/opt\/<\/code>, rather than <code>\/etc\/.<\/code><\/li>\n<\/ul>\n<p>If you\u2019ve installed Apache on Windows, you likely installed it to your <code>C:Program Files<\/code>\u00a0directory,\u00a0 under \u201cApache Software Foundation\u201d:<\/p>\n<pre>C:Program FilesApache Software FoundationApache2.4<\/pre>\n<p>If you\u2019re using Apache on macOS (for local development), the config folder is at the regular <code>\/etc\/apache2\/<\/code>\u00a0location, if you\u2019re using the stock version of Apache that comes with macOS. If you\u2019ve installed an up-to-date version from <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/brew.sh\/\">brew<\/a>, it instead is at:<\/p>\n<pre>\/usr\/local\/etc\/httpd\/httpd.conf<\/pre>\n<p>Regardless of the operating system or the details of your install, within this root configuration folder you\u2019ll find a few files and directories:<\/p>\n<ul>\n<li><code>apache2.conf<\/code>\u00a0or <code>httpd.conf<\/code>\u00a0are the primary configuration files.<\/li>\n<li><code>ports.conf<\/code>\u00a0define on what ports Apache should listen.<\/li>\n<li><code>conf.d\/<\/code>\u00a0is used to store configuration snippets you can include in the primary config.<\/li>\n<li><code>sites-available\/<\/code>\u00a0is a directory containing a unique config file for each website your web server hosts. You can host multiple sites from the same IP; Apache splits them by domain name and uses separate config files for each. It\u2019s common practice to name these files according to your domain name, e.g. <code>sites-available\/example.com<\/code>. A default site already exists that you can copy.<\/li>\n<li><code>sites-enabled\/<\/code>\u00a0determines which sites are actually in use. It\u2019s a special folder containing symlinks to the actual configuration files in <code>sites-available<\/code>. With this, you can turn sites on and off easily with the <code>a2ensite<\/code>\u00a0command.<\/li>\n<\/ul>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Configuration_with_htaccess_Files\"><\/span>Configuration with .htaccess Files<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You can also configure Apache without even touching the root configuration. If the feature is enabled, Apache attempts to read a file named\u00a0<code>.htaccess<\/code>\u00a0from your site\u2019s document root (the place where you put your HTML and other site content).<\/p>\n<p>It\u2019s particularly useful for shared hosting. Most of the time, if you get cheap website hosting from a service like GoDaddy or SquareSpace, you\u2019re not renting a whole web server just for your site. Your site is bundled with many other smaller sites and ran off one big server, which cuts down on hosting costs significantly. The problem with this setup is that you don\u2019t want people to be able to modify the configuration for other people\u2019s sites running on the same server, so you can\u2019t just give access to the primary config folder.<\/p>\n<p><code>.htaccess<\/code>\u00a0files solve this issue by changing the behavior of Apache based on the folder from which the content is being served. Doing so has a bit of a performance overhead, so it\u2019s not recommended for use unless you\u2019re forced to by a shared hosting provider.<\/p>\n<p>In this case, the location of your config folder is simple\u2014create a new file simply named:<\/p>\n<pre>.htaccess<\/pre>\n<p>And place it in your document root alongside your <code>index.html<\/code>\u00a0or <code>index.php<\/code>\u00a0pages. The <code>.htaccess<\/code>\u00a0file will override the root config for the whole directory, and also <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>ly it to any subdirectories.<\/p>\n<p>You can have multiple <code>.htaccess<\/code>\u00a0files in separate directories; for example, if you have a part of your website hosted in the <code>\/admin\/<\/code>\u00a0folder, you could place an additional <code>.htaccess<\/code>\u00a0in that folder and add basic HTTP auth to secure it.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"How_to_Find_The_Configuration_Folder_Manually\"><\/span>How to Find The Configuration Folder Manually<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>On most distros, you can usually use the <code>whereis<\/code>\u00a0command to locate programs and their associated files:<\/p>\n<pre>whereis apache2<\/pre>\n<p>It outputs the location of the Apache binary, as well as the Apache configuration folder and all related directories:<\/p>\n<pre>apache2: \/usr\/sbin\/apache2 \/etc\/apache2 \/usr\/lib\/apache2 \/usr\/share\/apache2 \/usr\/share\/man\/man8\/apache2.8.gz<\/pre>\n<p>If you don\u2019t have this command or it isn\u2019t working, then use <code>find<\/code>\u00a0to search your whole drive for directories named \u201c<code>apache2<\/code>\u201c:<\/p>\n<pre>sudo find \/ -type d -name \"apache2\"<\/pre>\n<p>You can also try searching for \u201c<code>httpd<\/code>\u201c, as Apache may be installed under that name. If both of those commands don\u2019t list anything, you likely don\u2019t have Apache installed in the first place.\n<\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/1675\/how-to-find-your-apache-configuration-folder\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How to Find Your Apache Configuration Folder \u2013 CloudSavvy IT&#8221; Apache uses configuration files to change its behavior. It usually stores them at \/etc\/apache2\/\u00a0on Unix systems, but the configuration directory can vary, depending on how it was installed\u00a0and which operating system you\u2019re running it on. The Usual Places The primary way of configuring Apache is&#8230;<\/p>\n","protected":false},"author":1,"featured_media":288425,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/08\/028af1f2-1.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-288424","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/288424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=288424"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/288424\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/288425"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=288424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=288424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=288424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}