Enable nginx module on Laravel Homestead? - nginx

How can I install and enable the file upload and upload progress module on nginx with the Laravel Homestead box on Vagrant?

I believe all you need to do, like it was mentioned above, is log in with ssh to your box and install the nginx-extras package. So:
Got to your Homestead directory.
Do 'vagrant ssh'
Once in do 'sudo apt-get install nginx-extras'
Restart nginx with 'sudo service nginx restart'
Check for the module in the output of 'sudo nginx -V'. Messy but you should see 'nginx-upload-progress' somewhere near the end of the output.

You can do everything via ssh. Read more detail about using ssh in Homestead at here.

Related

Fresh install: httpd.service: Unit not found

Currently I'm trying to follow this guide:
https://marxtudor.com/how-to-install-wordpress-using-ssh-on-centos-vps/
I'm using Google Cloud Platform (free edition to test) and I've created a fresh CentOS 7 VM. The guide above are the first commands I fill in and I keep getting this error:
I've followed so many tutorials, created a new VM and all the time I bump into this error that it doesn't know the httpd command.. I even deleted the project and started all over, but still no luck.
[rsa-key-XXXXXX]$ sudo service httpd restart
Redirecting to /bin/systemctl restart httpd.service
Failed to restart httpd.service: Unit not found.
[rsa-key-XXXXXX]$ httpd -t
-bash: httpd: command not found
[rsa-key-XXXXXX]$
Could anyone please let me know what could be causing this ?
Thanks in advance!
I was also getting the same error, this is how i resolved my issue.
After logging to the machine:
Step 1: Become the root user.
command: sudo su
Step 2: Update Kernal
command: yum update -y
Step 3: Install Apache command: yum install
httpd -y
Step 4: Start Apache command: service httpd start
Step 5: Check Status of Service command: service httpd status
This should solve your problem. good luck
Do you want to install WordPress for your Compute Engine VM instance, using CentOS 7?
If this is the case, you may do so by setting up LAMP for your VM, as described here [1], and then download the WordPress release of your choice [2] and install it on your VM.
I understand that you have successfully set up a VM instance using Centos 7, is this correct? Assuming this, and as you may see from [1], for CentOS 7, these would be the commands to perform this installation:
1) Update and install Apache and PHP:
sudo yum check-update
sudo yum -y install httpd php
2) Start the Apache service:
sudo service httpd start
sudo chkconfig httpd on
3) Install, configure and start DB:
sudo yum -y install httpd mariadb-server php php-mysql
sudo systemctl start mariadb
4) Configure MySQL (set a password for the root user if you want):
sudo mysql_secure_installation
5) Restart Apache
sudo service httpd restart
Once MySQL is set up, you will have to create a database for your WordPress installation.
Following this procedure, you will have Apache, MySQL and PHP installed and running on your Compute Engine VM instance.
Then, you can download the WordPress release of your choice [2], unzip the file and install WordPress by visiting your IP address and the folder where WordPress was downloaded. For example, http://YOUR_PUBLIC_VM_IP_ADDRESS/wordpress.
You will be asked for a database name, the user and password. This will allow WordPress to create the wp-config.php file on your behalf and proceed with the installation.
At this point, you should have WordPress already installed on your Compute Engine VM instance using CentOS 7.
An easier way to install WordPress on Compute Engine VM instances, would be by using the Marketpĺace in the Cloud Platform Console. Go to your Products and Services menu > Marketplace, and search for "Wordpress". You will be presented with many different options to launch WordPress in a Compute Engine VM instance. Nevertheless, it seems that Debian is the deafult OS used for these options.
Links:
[1] https://cloud.google.com/community/tutorials/setting-up-lamp
[2] https://wordpress.org/download/
In my case, I resolved it by looking what actual package name had "httpd" in it.
yum search httpd
It returned httpd.x86_64
Also, later on, when doing sudo service httpd start, I received the notification that PolicyKit1 was needed. So, all up, that command installed the package:
yum install -y httpd.x86_64 polkit-qt.x86_64
service httpd start

How to enable dynamic module with an existing NGINX installation

Introduction
From NGINX version 1.9.11 and upwarts, a new feature is introduced: dynamic modules. With dynamic modules, you can optionally load separate shared object files at runtime as modules – both third-party modules and some native NGINX modules. (source)
My setup and the problem
I have NGINX installed from the mainline (currently 1.9.14) so it is capable to use dynamic modules. It has also the module I want dynamicly enabled:
nginx -V
nginx version: nginx/1.9.14
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
built with OpenSSL 1.0.1f 6 Jan 2014
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules ... --with-http_geoip_module=dynamic ...
Note the --with-http_geoip_module=dynamic which loads the module I need (dynamically).
Unfortunately, the documentation is lacking (some details) and I am unable to set this up.I have an existing NGINX installation (not from source). But so far as I can understand I just need to build the module, place the generated module file in the right NGINX folder and enable it in the config file.
What I tried so far
I tested this on a different machine (with the same configuration, but not a production machine), but I don't see the ngx_http_geoip_module.so file.
The commands I used:
wget http://nginx.org/download/nginx-1.9.14.tar.gz
tar -xzf nginx-1.9.14.tar.gz
cd nginx-1.9.14/
./configure --with-http_geoip_module=dynamic
The questions
Is it a problem that I try to build the module on a system that has
NGINX installed not from source?
Why is there no .so file generated by my commands?
I had the same question, and #vladiastudillo answer was the missing piece I needed.
First add the nginx stable repo:
sudo add-apt-repository ppa:nginx/stable
Then run apt update:
sudo apt-get update
And get the nginx geoip module:
sudo apt-get install nginx-module-geoip
This will download and load the module to /usr/lib/nginx/modules
To load the nginx module,
open nginx.conf:
sudo nano /etc/nginx/nginx.conf
add add below in the main context:
load_module "modules/ngx_http_geoip_module.so";
The module will be loaded, when you reload the configuration or restart nginx.
To dynamically “unload” a module, comment out or remove its load_module directive and reload the nginx configuration.
Found this to be slightly different on Amazon Linux 2016.09, Amazon Linux 2016.03 after performing yum update.
You can confirm this ahead of time by using this command on your ec2 instance sudo yum search nginx-mod-http-geoip and you will see an N/S matched: nginx-mod-http-geoip entry in the response with specifics of nginx-mod-http-geoip.x86_64 : Nginx HTTP geoip module
In these cases, the installed nginx version will be 1.10.1. When this is true, you can simple install the nginx geoip module from Amazon's existing yum repo via:
sudo yum install nginx-mod-http-geoip
Then associate the module with your nginx.conf and placing this line in the main context
include /usr/share/nginx/modules/mod-http-geoip.conf;
(note this is subtly different from the main answer - in aws you have an entry in nginx.conf pointing to another *.conf file which then points to the *.so file)
If you are using docker nginx:latest this module is already included in the image as such you only need specify load_module as such:
"/usr/lib/nginx/modules/ngx_http_geoip_module.so";
You also need to create a geoip folder in your nginx mapped volume.
Though the databases seem to no longer been updated or available and geoip2 modules are not included. So you many need to google...
I had the same issue, you have to install the http_geoip_module lib for your ubuntu version with:
$ sudo apt-get install nginx-module-geoip

multiple nginx installation on same server how to set one as default

I'm configuring an nginx server to stream using rtmp.
As I just found out I have different nginx installations.
One is located on /etc/nginx (the old one, and the one that is running by default), and other one it's on /usr/local/nginx.
I want to make a symbolic link somewhere so I can define that the server executes the one located at /usr/local
Doing some more reading, I realized that I had 2 nginx was because I installed one with apt-get and a newer version from source. I uninstalled with apt-get purge. Now what I need to find out is how to set the nginx installed from source as default system.
The nginx installed from source is up and running, but I can't do a restart by any means.
/usr/local/nginx/sbin$ sudo ./nginx -s stop
/usr/local/nginx/sbin$ sudo ./nginx
Did the trick.

Nginx not working properly after update

Okay, so I had nginx 1.4.6 running on ubuntu 13.10 without any problems.
I tried to update nginx to 1.6.0 via this url (http://leftshift.io/upgrading-nginx-to-the-latest-version-on-ubuntu-servers)
Now nginx is not running and not willing to start (no reaction at all). nginx -v gives "nginx: command not found" as a result. So looks like nginx can't be found.
I looked around here and on other sites, but wasn't able to find the solution. So, if anyone can.. plz do..
As this was a server without any active tools or software I decided to remove and reinstall nginx.
I used this answer: How can I restore /etc/nginx?
QUOTE:
To recreate it, first uninstall using purge to remove even configuration files and records:
sudo apt-get purge nginx nginx-common nginx-full
then reinstall:
sudo apt-get install nginx
After these two commands, nginx was up and running again. I can now use my backup to upload the predefined .vhosts files to sites-enabled again.

Install phpmyadmin without selection apache2 or lighttpd

I use command Ubuntu: sudo apt-get install phpmyadmin
In process installing I inform about selection type of server: apache2 and lighttpd.
My server is build only on Nginx + php_fpm.
How i can install phpmyadmin without selection apache2 or lighttpd?
Sorry for stupid question
First install php5-fpm and then install phpmyadmin.
sudo apt-get install php5-fpm
sudo apt-get install phpmyadmin
The software, phpMyAdmin, requires a Web server and PHP. If PHP and a Web server have not yet been installed, then the default action is to use Apache. The package, php5-fpm, satisfies the requirements; thus, installing phpmyadmin after php5-fpm results in only the following additional package dependencies.
dbconfig-common javascript-common libjs-codemirror libjs-jquery
libjs-jquery-cookie libjs-jquery-event-drag libjs-jquery-metadata
libjs-jquery-mousewheel libjs-jquery-tablesorter libjs-jquery-ui
libjs-underscore libmcrypt4 php-gettext php5 php5-gd php5-mcrypt php5-mysql
Although PHP-FPM is not a Web server, the package maintainer understood that if php5-fpm has been installed, then the Ubuntu server will utilize some other Web server that uses the FastCGI Process Manager (FPM), and there is no need to know which Web server.
considering you have a lemp stack
you could also skip the queston with tab to "ok".
this might force phpmyadmin to install apache2, at least on the newest built, it wasnt like that before.
than when an error arrives that apache2 could not start, this is due nginx php-fpm already using the port, just toggle apache to start with this shell command
sudo update-rc.d -f apache2 remove

Resources