VPS侦探论坛

 找回密码
 注册
查看: 3485|回复: 5

一键按照了LNMP,安装了wordpress,现在想添加新域名绑定该主机,如何操作?

[复制链接]
发表于 2018-6-29 09:36:35 | 显示全部楼层 |阅读模式

一键按照了LNMP,安装了一个wordpress,绑定了一个域名,现在想添加新域名绑定该主机,和原有域名一起使用,请问如何操作?现在用新域名CNAME原域名会直接跳转到一键安装界面,不知道应该修改哪里,麻烦军哥解答下,谢谢。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2018-6-29 20:19:35 | 显示全部楼层


在要添加域名的虚拟主机上修改配置文件,加上这个新域名
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2018-6-30 09:44:37 | 显示全部楼层

好不容易找到了配置文件,:lol 添加的虚拟主机配置文件:/usr/local/nginx/conf/vhost/域名.conf
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2018-6-30 10:10:28 | 显示全部楼层



军哥帮忙看看,我修改了配置文件,还是不行
bbbbb.org *.bbbbb.org是后加的,还是访问默认lnmp页面

server
    {
        listen 80;
        #listen [::]:80;
        server_name aaa.plus *.aaa.plus bbbbb.org *.bbbbb.org;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/aaa.plus;

        include other.conf;
        #error_page   404   /404.html;

        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

        include enable-php.conf;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.
        {
            deny all;
        }

        access_log  /home/wwwlogs/aaa.plus.log;
    }
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2018-6-30 12:10:31 | 显示全部楼层

解决了,修改以后,重启服务器就好了。

军哥运维代购:http://shop63846532.taobao.com/

发表于 2018-7-1 10:55:28 | 显示全部楼层

回复 5# 的帖子


修改nginx配置文件是必须要reload或重启nginx才能生效的
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-23 23:27 , Processed in 0.026956 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表