Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ The source code compiler installation Nginx 1.8.0 under Ubuntu 14.10     - Java how to achieve bubble sort the problem Arraylist (Programming)

- Linux, Firefox unloading and installation and upgrade (Linux)

- Android realize RippleEffect water (Programming)

- Redhat Close SELinux correct step (Linux)

- Linux Getting Started Tutorial: / var / spool / clientmqueue fill the root directory (Linux)

- Oracle Bug caused by the collection of AWR Snapshot fault (Database)

- Using packet capture libpcap be reconciliation package in Ubuntu 14.04 64 bits (Linux)

- CentOS installation of the ftp (Linux)

- To share Linux script automatically change passwords (Linux)

- Use Ambari rapid deployment Hadoop big data environment (Server)

- Ubuntu install virtual machine software VirtualBox 4.3.10 (Linux)

- Oracle RAC 10.2.0.5 upgrade to 11.2.0.4 problems encountered (Database)

- Glibc support encryption by modifying the DNS (Programming)

- Linux Command Tutorial: cat command to view the contents of the file (Linux)

- How to set IonCube Loaders in Ubuntu (Linux)

- Docker + Nginx + Tomcat7 simple load balancing configuration (Server)

- Ubuntu 14.04 installed NVIDIA graphics driver (Linux)

- Build Python3.4 + PyQt5.5.1 + Eric6.1.1 development platform under Mac OS X 10.11.1 (Server)

- Linux server alarms using Java (Server)

- Based on Google Cloud Storage Mirroring open Maven Central Repository (Server)

 
         
  The source code compiler installation Nginx 1.8.0 under Ubuntu 14.10
     
  Add Date : 2017-08-31      
         
         
         
  1, update the system Ubuntu Server 14.10

Sudo apt-get update && sudo apt-get upgrade

2, the installation of nginx dependencies zlib pcre openssl (source code can be installed directly to the system installation)

Sudo apt-get install libpcre3 libpcre3-dev zlib1g-dev libssl-dev build-essential

3, download openssl source package

Wget http://www.openssl.org/source/openssl-1.0.2a.tar.gz

Sudo tar -zxvf openssl-1.0.2a.tar.gz -C / usr / local / src /

Cd /usr/local/src/openssl-1.0.2a/

Sudo ./config

Sudo make && sudo make install

4, download nginx source package

Wget http://nginx.org/download/nginx-1.8.0.tar.gz

Sudo tar -zxvf nginx-1.8.0.tar.gz -C / usr / local / src /

Cd /usr/local/src/nginx-1.8.0

Sudo ./configure --prefix = / usr / local / nginx --with-openssl = / usr / include / openssl

Sudo make && sudo make install

5, configuration nginx boot service.

So after we installed Ubuntu 14.04 official source, to set up a nginx service to the system, we check the configuration to facilitate the restart Nginx restart and boot automatically Nginx

Sudo vim /etc/init.d/nginx

Insert the following:

#! / Bin / sh

### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $ local_fs $ remote_fs $ network $ syslog
# Required-Stop: $ local_fs $ remote_fs $ network $ syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
### END INIT INFO

PATH = / usr / local / sbin: / usr / local / bin: / sbin: / bin: / usr / sbin: / usr / bin
DAEMON = / usr / sbin / nginx
NAME = nginx
DESC = nginx

# Include nginx defaults if available
If [-f / etc / default / nginx]; then
  . / Etc / default / nginx
Fi

Test -x $ DAEMON || exit 0

Set -e

. / Lib / lsb / init-functions

Test_nginx_config () {
  If $ DAEMON -t $ DAEMON_OPTS> / dev / null 2> & 1; then
      Return 0
  Else
      $ DAEMON -t $ DAEMON_OPTS
      Return $?
  Fi
}}

Case "$ 1" in
  Start)
      Echo -n "Starting $ DESC:"
      Test_nginx_config
      # Check if the ULIMIT is set in / etc / default / nginx
      If [-n "$ ULIMIT"]; then
        # Set the ulimits
        Ulimit $ ULIMIT
      Fi
      Start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
          --exec $ DAEMON - $ DAEMON_OPTS || true
      Echo "$ NAME."
      ;

  Stop)
      Echo -n "Stopping $ DESC:"
      Start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
          --exec $ DAEMON || true
      Echo "$ NAME."
      ;

  Restart | force-reload)
      Echo -n "Restarting $ DESC:"
      Start-stop-daemon --stop --quiet --pidfile \
          /var/run/$NAME.pid --exec $ DAEMON || true
      Sleep 1
      Test_nginx_config
      # Check if the ULIMIT is set in / etc / default / nginx
      If [-n "$ ULIMIT"]; then
        # Set the ulimits
        Ulimit $ ULIMIT
      Fi
      Start-stop-daemon --start --quiet --pidfile \
          /var/run/$NAME.pid --exec $ DAEMON - $ DAEMON_OPTS || true
      Echo "$ NAME."
      ;

  Reload)
      Echo -n "Reloading $ DESC configuration:"
      Test_nginx_config
      Start-stop-daemon --stop --signal HUP --quiet --pidfile /var/run/$NAME.pid \
          --exec $ DAEMON || true
      Echo "$ NAME."
      ;

  Configtest | testconfig)
      Echo -n "Testing $ DESC configuration:"
      If test_nginx_config; then
        Echo "$ NAME."
      Else
        Exit $?
      Fi
      ;

  Status)
      Status_of_proc -p /var/run/$NAME.pid "$ DAEMON" nginx && exit 0 || exit $?
      ;
  *)
      Stop | restart | reload | force-reload | status | configtest} "> & 2" echo "Usage: $ NAME {start |
      Exit 1
      ;
Gt;

Exit 0

Note to set the nginx startup path DAEMON = / usr / sbin / nginx

6, set the file permissions and add to the system services

Sudo chmod + x ./nginx

Sudo update-rc.d nginx defaults

7, start nginx

Sudo /etc/init.d/nginx
     
         
         
         
  More:      
 
- How to customize your Linux desktop: Gnome 3 (Linux)
- Git 2.5 increase in the working tree, triangle improved workflow performance (Linux)
- Docker knowledge base (Server)
- How to manage and use Logical Volume Management LVM in Ubuntu (Linux)
- Sudo and Root Account in Ubuntu related (Linux)
- Ubuntu modify DNS restart loss problem (Linux)
- Android development, may cause a memory leak problem (Programming)
- VirtualBox virtual machine to install Linux (Linux)
- VMware virtual machine can not start VMnet0 no Internet access and other issues (Linux)
- iOS GCD multithreading simple to use (Programming)
- Java class loading order (Programming)
- How to monitor network usage by nload in Linux (Linux)
- Linux use chattr and lsattr commands to manage file and directory attributes (Linux)
- Java and C / C ++ data conversion when network communication (Programming)
- How to use Android Studio development / debugging Android source code (Linux)
- 64-bit Windows Server 2012 R2 install Oracle 10g Second Edition (Database)
- MongoDB polymerization being given (Database)
- Teach you self-built Linux firewall free (Linux)
- Copy U disk files to the Linux system on a virtual machine (Linux)
- findmnt- Looking mounted file system (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.