{"id":6207,"date":"2021-04-03T13:24:20","date_gmt":"2021-04-03T07:54:20","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=6207"},"modified":"2021-04-03T13:24:31","modified_gmt":"2021-04-03T07:54:31","slug":"nginx-missing-sites-available-directory-in-the-nginx-configuration-directory","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/nginx-missing-sites-available-directory-in-the-nginx-configuration-directory\/","title":{"rendered":"Nginx missing sites-available directory in the Nginx configuration directory"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Nginx missing sites-available directory in the Nginx configuration directory<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">Date: 03-04-2021<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Once you installed Nginx on Centos 7 to set up virtual host files, you are unable to find the <strong><code>\/etc\/nginx\/sites-available<\/code><\/strong> in<strong><code> \/etc\/nginx<\/code><\/strong> directory. You can follow the below steps to enable this option. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 1:<\/strong> Create the below directories in the nginx configuration directory. <strong><code>\/etc\/nginx\/sites-availabe<\/code><\/strong> and  <strong><code>\/etc\/nginx\/sites-enabled<\/code><\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 2:<\/strong> Open <strong><code>\/etc\/nginx\/nginx.conf<\/code><\/strong> file and edit to add blow line in <strong><code>http<\/code><\/strong> block.<br><strong><code>include \/etc\/nginx\/sites-enabled\/*; <\/code><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 3:<\/strong> Restart the nginx service by using below command<br><strong><code>#systemctl restart nginx<\/code><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 4:<\/strong> Now you can create vhost file inside sites-available and you can create a symlink for them inside sites-enabled for those you want enabled.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 5:<\/strong> If you prefer a more direct approach to create vhost file without symlinking between sites-available and sites-enabled, you can follow below steps.<br>1. Create the <strong><code>conf.d<\/code><\/strong> directory in <strong><code>\/etc\/nginx<\/code><\/strong> if it doesn&#8217;t already exist and make sure to give it the right permissions\/ownership like root or www-data.<br>2. Open <strong><code>\/etc\/nginx\/nginx.conf<\/code><\/strong> file and edit to add blow line in <strong><code>http<\/code><\/strong> block.<br><strong><code>include \/etc\/nginx\/conf.d\/*.conf;<\/code><\/strong><br>3. Create your separate config files like <strong><code>domain name.conf<\/code><\/strong> into the directory conf.d<br>4. Restart the nginx service.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nginx missing sites-available directory in the Nginx configuration directory Date: 03-04-2021 Once you installed Nginx on Centos 7 to set [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[840,271,841],"class_list":["post-6207","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-missing-sites-available","tag-nginx","tag-vhost-file","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1C7","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=6207"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6207\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=6207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=6207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=6207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}