Nginx Install doesn't create /etc/rc.d/init.d/nginx - ruby-on-rails

I'm installing Nginx using Passenger on an ubuntu server. I install Nginx using rvmsudo passenger-install-nginx-module but when I try to create a Nginx script using nano /etc/rc.d/init.d/nginx the directory rc.d does not exist. Any idea why?
I have the directories rc0.d through rc6.d but none of them have the init.d file in them. I'm following the Digital Ocean Tutorial

This is explained in detail in the Passenger documentation here: https://www.phusionpassenger.com/library/install/nginx/install/oss/rubygems_rvm/#note_about_nginx
The solution is to install Nginx from the Phusion Passenger APT repository, or to create an Nginx init script yourself.

Related

Can't run gitlab using exising Nginx installation

I have installed Gitlab through omnibus installation with existing NGINX installation. I was following the docs guide, installed Passenger using this guide (it also updated my installed nginx): https://www.phusionpassenger.com/library/install/nginx/install/oss/xenial/
Also i've updated /etc/gitlab/gitlab.rb to following settings:
external_url 'http://git.domain.kz'
nginx['enable'] = false
Here's the output of command sudo gitlab-ctl tail
https://pastebin.com/XKAwUY3U

Deploying Rails app using Nginx, Unicorn, Postgres and Capistrano to Digital Ocean : nginx eror

I have done all the steps by using this tutorial but while running below statement, I am getting the following error. I have created my Digital Ocean VPS host in port 3000.
$ sudo rm /etc/nginx/sites-enabled/default
$ sudo service nginx restart
* Restarting nginx nginx [fail]
$ sudo nginx -t
nginx: [emerg] "listen" directive is not allowed here in /etc/nginx/sites-enabled/hosting:1
nginx: configuration file /etc/nginx/nginx.conf test failed
Check for the solution here:
Nginx unknown directive "upstream" error when deploying Rails
That guy followed the same tutorial, and had the exact same problem. He also posted a solution.
Also, to avoid the issue altogether, you might consider using this plugin: https://github.com/bruno-/capistrano-unicorn-nginx

Change default nginx location

I am stuck in a scenario. I had nginx already installed on my linux server at /etc/nginx/ but it did not has passenger mod enabled. So i run
passenger-install-nginx-module
to but then in the wizard i chosen the option 1 to download and configure fresh nginx because i did not know the "source" location of previously installed nginx. So it downloaded and configure the nginx but at different location: /opt/nginx/
Now the problem is server is getting only previously installed at /etc/nignx/.
Do i have to change the default location somewhere? IF yes, then how? i couldnt find it anywhere on google.
stop the nginx process running at /etc/nginx and then start the server from /opt/nginx.
sudo /opt/nginx/sbin/nginx
will start nginx. You should have the root path set properly in the nginx conf.
You can simply backup your /etc/nginx somewhere, remove it and then make symbolic link with ln /opt/nginx /etc -s to point both places to the same location.

Gitlab hosting issue in linode VPS

I purchased a linode 1 GB plan recently. I have installed the basic LAMP stack on it.
I wanted to install gitlab on the server. I followed the documentation at: https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md
The documentation also says the official server is Nginx and I have got Nginx start with no issues.
Problem is when I start the gitlab service using:
sudo service gitlab start
I get:
rm: cannot remove `/home/git/gitlab/tmp/sockets/gitlab.socket': No such file or directory
bash: bundle: command not found
GitLab service started

Nginx configuration

When I run
sudo mate /opt/nginx/conf/nginx.conf
my nginx.conf file opens but is blank, what did i do wrong?
trying to deploy my rails app to a ubuntu 10.04 lucid with passenger, nginx, and REE
On which machine are you running "sudo mate ..."? If you're trying to deploy, you should be on the Ubuntu server. I suspect you're using a Mac for development and the command you've issued is to edit the local nginx installation on your Mac, not on the deployment server.
You can check where you are with command:
$ uname -a
Are you sure you're not looking for:
sudo nano /etc/nginx/nginx.conf
on your server?

Resources