Based on this links:
- https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-12-04
- https://docs.moodle.org/dev/Install_Moodle_On_Ubuntu_with_Nginx/PHP-fpm
$ cd /usr/share/nginx/html/
Based on this links:
$ cd /usr/share/nginx/html/
| # Automatically instal the latest nginx | |
| wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add - | |
| #Make a backup copy of your current sources.list file | |
| sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak | |
| #Now copy the following repositories to the end of ` /etc/apt/sources.list` | |
| echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" | tee -a /etc/apt/sources.list | |
| echo "deb-src http://nginx.org/packages/mainline/debian/ jessie nginx" | tee -a /etc/apt/sources.list |
| alias.a add . | |
| alias.aliases config --get-regexp alias | |
| alias.bi bisect | |
| alias.ci commit -m | |
| alias.co checkout | |
| alias.colast checkout - | |
| alias.db branch -D | |
| alias.laf fsck --lost-found | |
| alias.last log -1 HEAD | |
| alias.nb checkout -b |
| postgres: | |
| image: postgres:9.4 | |
| volumes: | |
| - ./init.sql:/docker-entrypoint-initdb.d/init.sql |
| #!/bin/bash | |
| if [ ! -x /usr/bin/curl ]; then | |
| echo "Please install curl" | |
| exit 1 | |
| fi | |
| if [ ! -x /usr/bin/jq ]; then | |
| echo "Please install jq" | |
| exit 1 |
| --- | |
| ######################################## | |
| ## Ansible Playbook for installing Nginx | |
| ######################################## | |
| - name: check registered the repository of nginx-release | |
| shell: rpm -qa | grep nginx-release | |
| register: result | |
| ignore_errors: True |
Let's say you have a SysV Init Script named foo
Copy the file to /etc/init.d/foo
Enable the SysV service: chkconfig --add foo
Enable the SysV service: chkconfig foo on
Start the service: service foo start. After this, systemd-sysv-generator will generate this file /run/systemd/generator.late/foo.service, copy this file to /etc/systemd/system by running: cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service
Edit /etc/systemd/system/foo.service by running systemctl edit foo.service, add in the following line to foo.servie (this makes the service installable)
[Install]
| # This config came around after a friend had problems with a Steam cache on his | |
| # Cox internet connection. Cox would intercept any requests to Steam content | |
| # servers and return a 302 to Cox's servers. The cache would return the 302 | |
| # to the Steam client, and the Steam client would go directly to Cox, bypassing | |
| # the cache. | |
| # This config makes nginx follow the 302 itself, and caches the result of the | |
| # redirect as if it was the response to the original request. So subsequent | |
| # requests to the URL that returned a 302 will get the file instead of a 302. |