Nginx, a server tag is a virtual host.1, the domain-based virtual host, through the domain name to differentiate the virtual host-application: external website2, Port-based
index.html files to each of the two directories as follows:This is A!This is B!Then modify the HTTP portion of the Nginx configuration file as:HTTP {Include Mime.types;Default_type Application/octet-stream;Sendfile on;Keepalive_timeout 65;server {Listen 81;server_name localhost;Location/{root HTML;Index index.html index.htm;}}server {Listen 81;server_name www.a.com;Access_log Logs/www.a.com.access.log combined;Location/{Root html/www.a.com;Index inde
based on actual needs, typically below 10000, and 1024 by default.650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7B/65/wKiom1bNEIni3bUbAAAkoiIiGxg095.jpg "title=" Events.jpg "alt=" Wkiom1bneini3bubaaakoiiigxg095.jpg "/>3.HTTP configuration, using "http {}" to delimit tags, including access logs, HTTP port, web directory, default character set, connection hold and its virtual host, PHP parsing,
Nginx can use the server block to set multiple virtual hosts. In the server segment, use the server_name and listen commands to bind domain names and ports. For example: The code is as follows:Copy code Server {Listen 80;Server_name www.111cn.net;Location /{Root hzhui;Index index.html;}} The preceding configuration specifies a virtual
The following is a php shell script for managing nginx virtual hosts. I hope this script will help you to use php as a shell script, we can use php scripts to manage nginx virtual hosts... the following is a php shell script for managing nginx
Using php as a shell script is very convenient. Of course, we can use the php script to manage the nginx virtual host. The following is the author's script file for your reference. The code is as follows:Copy code #! /Usr/bin/php-qStart: fwrite (STDOUT, "=========== Vhost Script ===============\ n ");Fwrite (STDOUT, "= Choose an operation \
Version: centos6.5; mysql-5.6.26, nginx-1.6.3;p hp-5.4.37Environment Architecture: LNMP1. Configure a second virtual hostYou can add a line to the nginx.confInclude vhosts/*.conf;This allows us to create a virtual host configuration file under the/usr/local/nginx/conf/vhosts
;
#??? Ssl_ciphers? HIGH :! ANULL :! MD5;#??? Ssl_prefer_server_ciphers? On;
#??? Location /{#??????? Root ?? Html;#??????? Index? Index.html index.htm;#??? }#}
}: Wq # Save and exit
> Cd/home> Vi start. sh#! /Bin/bashActop = $1/Bin/bash/etc/rc. d/init. d/php-fpm $ actop blog.1000seo.com/Bin/bash/etc/rc. d/init. d/php-fpm $ actop crm.1000seo.com: Wq # Save and exit> Chmod + x start. sh
> Vi/etc/rc. local#! /Bin/sh## This script will be executed * after * all the other init scripts.# You can put
: This article mainly introduces tomcat and nginx for accessing linux virtual machines on Windows 7 host machines. if you are interested in PHP tutorials, refer to them. First, it is emphasized that the host and the virtual machine set up by VMware communicate in NAT mode.
Virtual Web Host:Build LNMP ServiceInstallationNginxMARIADB, Mariadb-server, Mariadb-develPHP, PHP-FPM, Php-mysqlStart Nginx, MariaDB, FPM service;and test whether the LNMP is working properly.Build two Web services with different domain namesProxy Server:Build Nginx Service#vim/usr/local/nginx/conf/nginx.conf......HTT
The first emphasis is on the NAT communication between the host and VMware-built virtual machines.
Rough description of successful access to service steps:
1. Make sure that Tomcat or Nginx service is turned on in your virtual machine.
2. Add port forwarding configuration to the
1 Enter the Conf directory under the Nginx installation path, open the nginx.conf, and the virtual host configuration is as follows
Nginx configuration Segment//
Global zone
worker_processes 1;//There are 1 working sub-processes that can be modified by themselves, but too great for the CPU, which is generally set to
Add a virtual host# vim/usr/local/nginx-1.9.0/conf/vhost/proxy.confserver { 8.8. 8.8; 8088 ; / { proxy_pass http://$http _host$request_uri; } }Nginx to implement the agent online, there are three key points must be noted that
Using PHP as a shell script is a handy thing to do. Of course, we can use PHP script to manage nginx virtual host, the following is the author's script file for your reference
The code is as follows
#!/usr/bin/php-q Start:fwrite (STDOUT, "===========vhost script===========\n"); fwrite (STDOUT, "= Choose an operation\n"); fwri
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.