Last update at :2023-12-30,Edit by888u
Under the Linux system, to build a common website environment of nginx+php+mysql+phpmyadmin with one click, Junge’s LNMP one-click installation is generally used (tutorial related to the Linux lnmp one-click installation package). After installation, it is the domain name. Bound! In fact, the so-called domain name binding is to simply create a conf file under /usr/local/nginx/conf/vhost in the form of a command. This process can be done manually to create the conf, or to modify the directory, domain name, etc. directly. conf file, the effect is exactly the same:
/root/vhost.sh
#lnmp domain name binding command
========================================== ===============================
Add Virtual Host
for
LNMP V0.9 , Written by Licess
========================================== ===============================
LNMP is a tool to auto-compile &
install
Nginx+MySQL+PHP on Linux< /code>
This script is a tool to add virtual host
for
nginx
For
more
information please visit http://www.lnmp.org/
========================================== ===============================
Please input domain:
(Default domain: www.lnmp.org):this site.com
#Enter the domain name you want to bind, this site.com and www .This website.com needs to be bound separately
============================
domain=this site.com
============================
Do you want to add
more
domain name? (y/n)
y
#Whether to add a subdomain name, you can enter y or n, enter y here
Type domainname,example(bbs.this site.com forums.this site.com luntan.this site.com):
www.thissite.com
#Enter other domain names you want to bind, support pan-analytics, for example: *.7vps.net
============================
domain list=www.thissite.com
============================
Please input the directory
for
the domain:this site.com :
(Default directory: /home/wwwroot/this site.com):/home/this site.com
#Website storage directory, which can be default or Enter it yourself
============================
Virtual Host Directory=/home/this网站.com
============================
============================
Allow Rewrite rule? (y/n)
============================
y
#Whether to add pseudo-static rules, the input here is
Please input the rewrite of program :
wordpress,discuz,typecho,sablog,dabr rewrite was exist.
(Default rewrite: other):wordpress
#Just enter wordpress
============================
You choose rewrite=wordpress
============================
============================
Allow access_log? (y/n)
============================
n
#Whether to create a log file, if not needed, don’t use it
Press any key to start create virtul host...
#Click to continue. The following is some relevant information, including creating directories, testing nginx, etc. If there is an error message, please analyze it carefully
Create Virtul Host directory......
set
permissions of Virtual Host directory......
You
select
the exist rewrite rule:/usr/
local
/nginx/conf/wordpress.conf
Test Nginx configure
file
......
nginx: the configuration
file
/usr/
local
/nginx/conf/nginx.conf syntax is ok
nginx: configuration
file
/usr/
local
/nginx/conf/nginx.conf
test
is successful< /code>
Restart Nginx......
========================================== ===============================
Add Virtual Host
for
LNMP V0.9 , Written by Licess
========================================== ===============================
For
more
information please visit http://www.lnmp.org/
Your domain:this site.com
Directory of this website.com:/home/this website.com
========================================== ===============================
Recommended site searches: domain name registration platform, filing system, independent IP space, free cloud server, independent IP space free domain name, virtual host service provider, multi-IP station group server, which foreign server rental is best, Jiangsu high-defense server ,

发表评论