Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

linux ami nginx sites_enabled missing [closed]

We are trying to install nginx on a Amazon Linux AMI to config uwsgi and django. But there is no sites-enabled dir under etc/nginx unlike on Ubuntu.

What am I missing here?

We are trying follow instructions from http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

like image 958
user3257548 Avatar asked Feb 12 '14 21:02

user3257548


People also ask

Where is sites-enabled folder nginx?

Use the Sites-Enabled Directory Ubuntu systems have a /etc/nginx/sites-available directory, which contains virtual host (vhost) files for each domain hosted on the Linode. For instance, the domain for example.com typically has a corresponding virtual host file named /etc/nginx/sites-available/www. example.com. conf .

What is nginx on the Amazon Linux AMI?

Nginx is a web server and a reverse proxy server for HTTP/HTTPS and more. It is part of LEAP stack. Simply type the following yum command to install it on Amazon Linux AMI: sudo yum search nginx.


1 Answers

Amazon Linux is based on RedHat/CentOS/Fedora so the default installation of nginx doesn't have a sites-avalable or a sites-enabled directory. (As opposed to Debian/Ubuntu) The directory where you usually put your configs is /etc/nginx/conf.d

Having said that, if you really want the sites-available/sites-enabled directories you can just run:

mkdir -p /etc/nginx/sites-enabled
mkdir -p /etc/nginx/sites-available

Then make sure the following is in the http section of your /etc/nginx/nginx.conf:

include /etc/nginx/sites-enabled/*.conf;

Then if you want to create a specific site configuration you can create your file 'whatever.conf' under /etc/nginx/sites-available . To enable it:

ln -s /etc/nginx/sites-available/whatever.conf /etc/nginx/sites-enabled/whatever.conf
service nginx restart
like image 110
Rico Avatar answered Sep 21 '22 12:09

Rico