I've followed the instructions for installing phusion passenger with nginx in ubuntu. I had some issues while installing since I use rvm and I had to install as root and the installer was failing to find rake so i temporarily chmoded /opt to be owned by my user and after installation I resetted ownership to root. I can see nginx welcome page but when I try to visit a sinatra app I get forbidden, the virtual host is pointed to the sinatra app public dir and the permissions for the whole app are 777.
Try Passenger 3. It automatically detects most permission problems and tells you how to fix them.
If this is for a production system, you really don't need the flexibility of RVM as you should be using a single stable version of Ruby and Rails for Phusion. Install the version you need, using Aptitude if that version is available, and be done with it.
Because this is the page that Google brought me to for my issue, which isn't a Passenger issue, but a Nginx reverse-proxy issue, you need to add the line
disable :protection
somewhere in your sinatra app. I have mine at the very end, outside any method (in global scope).
Well my mistake was not using rvmsudo to install nginx with passenger, instructions here: http://rvm.io/integration/passenger/.
Related
I'm having a strange issue with Ubuntu 18.04 and Nginx with ModSecurity. I've compiled everything correctly and it's working when activating the ModSecurity module, however whenever I activate a rule, I get the following:
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid
Nginx crashes and doesn't serve the page - any ideas?
I'm having this issue in Ubuntu 16.04 as well. This seems to be an issue with the latest version of ModSecurity as seen in this bug: https://github.com/SpiderLabs/ModSecurity/issues/2180
If you downloaded ModSecurity via git, you can use this command to get back to a working version:
git reset --hard d5b93c1013ca9c9a96c75369576b54832e9a2b48
Then clean your ModSecurity build directory and build it again. Once you have ModSecurity rebuild, restart nginx. Once the above bug is closed in GitHub, it will probably be safe to update to the latest version again.
Edit: This issue has been corrected. Simply update and recompile ModSecurity.
My machine has Mac os. In this I have nginx 1.6.x. I initially installed with Homebrew.
I am trying to run a project which in production uses openresty (as it has lua 3rd party modules)
My confusion is regarding which one to install.
Do I need to completely remove nginx and install openresty, as it's documentation says it's a bundle of components,i.e. it will contain nginx?
or
Install new version of nginx with lua 3rd party modules and then install openresty too.
Sorry if there is a or too many typo in my question.
A good link will be helpful as I think I have confused myself enough.
Thanks in Advance.
Openresty is nginx bundled with lua and other 3rd party modules, so having both of them installed on your computer may lead to trouble, for example:
This case can happen if you try to run both of them at the same time: Your nginx conf file can have a server block listening to a port while your openresty also have a server block listening to that block. If nginx is already running, openresty won't be able to run, since the port is already bound.
I installed openresty with a previous installation of nginx and ran into some problems, so i would advise you to save relevant configuration and data from your nginx instalation and removing it.
Installing openresty seems better since besides installing nginx, it will install lua modules and a few more as it is listed on their github.https://github.com/openresty/lua-nginx-module
I don't know how your project is going, but i would suggest moving using openresty, since it will save potential trouble.
Trying to install and configure Sulu CMS.
I am using Homestead and have configured the vhosts to welcome a new site and have run vagrant provision:
sites:
- map: sulu.cms
to: /home/vagrant/Code/sulu_cms/public
I have pulled sulu-standard from the GIT repo, checkedout, ran composer install and followed the instructions given here to the dot. I am also using the Nginx configuration shown here and the default Webspace provided by the installation.
However, when trying to access the host after I am getting a 502 Bad Gateway error. Could anyone enlighten me on the issue?
I am running Homestead on Windows 10, I have a couple of other Laravel-based projects running in the same Homestead box without any issues.
You've also created an issue for that on Github and posted the answer there. You've mentioned there that the vagrant mapping was incorrect, because it showed to a non-existent public directory instead of the web directory.
So the correct vagrant mapping would look like this:
sites:
- map: sulu.cms
to: /home/vagrant/Code/sulu_cms/web
Would be nice if you could also mark this as the accepted answer, or create a more detailed one on your own.
I installed Nginx via apt-get on Debian a while ago, and I've got a couple of sites live on it. Now I need to install some additional modules, and as I don't want to mess anything up I'd like to double check my process before I perform it. Hopefully this will also help others that are unsure about this part.
As I've understood it I have to do the following to minimize the downtime:
Download the source for Nginx
Add the additional modules with ./configure --additional-module
Compile Nginx with make
Stop the current server (service nginx stop)
Install Nginx with make install
Start the new server (service nginx start)
Or do I have to uninstall Nginx first, as it's not compiled from source at this point?
Having done something similar on Ubuntu before, the installation should overwrite the existing nginx binaries with the newly compiled ones, so long as yes, you ensure nginx isn't running on the system at the time.
I'd recommend trying to install nginx elsewhere on the system, so in case you can't get it to work quickly, you can restart your web server with the old nginx binaries and not have significant downtime.
nginx -V - helpful command which shows options for .\configure which was used to make nginx, which is actually working.
Helpful to get detail imagination about.
apt-get source nginx - to get source
install will automatically substitute actual installed version by new one
Keep also in mind that some nginx-modules can require additional libs on server. geoip module is classical example of it
I have installed Nginx in our redhat machine using rpm. Now we want to add nginx-rtmp module, but inorder to add new module as per the document i need to build it by downloading the tar ball. Does it mean that i have to remove the rpm and install it as per the document.
Ref: https://github.com/arut/nginx-rtmp-module/wiki/Getting-started-with-nginx-rtmp
./configure --add-module=/usr/build/nginx-rtmp-module
make
make install
With nginx 1.9.11, it's not necessary to recompile the server, as they added support for dynamic modules. Take a look here:
https://www.nginx.com/blog/dynamic-modules-nginx-1-9-11/
Unlike Apache, all modules, including the 3rd party modules, are going to be compiled into nginx. So every time you want to add a new module, you have to recompile nginx.
So yes, you have to install it as per the document. There is no much value of keeping 2 nginx runtimes on the same server any way. So you may also want to remove the previous nginx.
I had a similar problem where the auth-pam module broke after an upgrade. Here's what fixed it for me (debian stretch/sid, nginx 1.10.2):
apt install libnginx-mod-http-auth-pam
ln -s /usr/share/nginx/modules-available/mod-http-auth-pam.conf /etc/nginx/modules-enabled/50-mod-http-auth-pam.conf
The config file contains a single “load_module” directive which tells nginx to dynamically load the module on startup. As jekennedy mentioned, this would only apply to newer versions of nginx that support dynamic module loading.
Yes, you have to uninstall nginx (installed via rpm) and re-install it according to the mentioned document that is from source file. There are some disadvantages of installing nginx using source, like you cannot use nginx as a service. Here, you can find instructions to do same thing with all the functionalities you get while installing nginx using OS-respective packages.
Following the steps in this post from the nginx blog page called "Compilation of Dynamic Modules for NGINX Plus", i could compiled the RTMP módule, downloading the nginx-rtmp-module from Github and import it on my webserver.
Regards.