服务器无法认证我的网站名称

服务器无法认证我的网站名称

你好,首先抱歉我的英语不好,我两天前买了一个网站名,这是我的。

我想为我的公司建立一个网站,尽管我还不了解它...我有一台专用服务器,我不知道哪个 cpu 8gb ram 2terra 磁盘空间,我在上面安装了 webmin plexmediaplayer 和 bonobox 和 openvpn。我按照教程

apt-get -y install nginx
nano /etc/nginx/nginx.conf
user www-data;
worker_processes 8;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
    worker_connections 768;
    # multi_accept on;                                                                                                                                                                                                                   
}

http {

    ##                                                                                                                                                                                                                                   
    # Basic Settings                                                                                                                                                                                                                     
    ##                                                                                                                                                                                                                                   

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    server_tokens off;                                                                                                                                                                                                                 

    # server_names_hash_bucket_size 64;                                                                                                                                                                                                  
    # server_name_in_redirect off;                                                                                                                                                                                                       

    include /etc/nginx/mime.types;
    default_type application/octet-stream;
cd /var/www
wget http://fr.wordpress.org/latest-fr_FR.tar.gz
tar -xzvf latest-fr_FR.tar.gz
mv wordpress blog
rm latest-fr_FR.tar.gz
adduser blog
chown -R blog:www-data /var/www/blog
chmod -R o-rwx /var/www/blog
apt-get -y install php-cli php-mysql php-curl php-gd php-intl
php -v
apt-get install -y php-fpm
nano /etc/php/7.4/fpm/pool.d/blog.conf
[blog]
listen = /var/run/blog.sock

listen.owner = blog
listen.group = www-data

user = blog
group = www-data

pm = ondemand
pm.max_children = 10
pm.process_idle_timeout = 60s
pm.max_requests = 500
systemctl stop php7.4-fpm.service
free -m
systemctl start php7.4-fpm.service && ps --no-headers -o "rss,cmd" -C php-fpm7.4 | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'
nano /etc/php/7.4/fpm/pool.d/blog.conf
[blog]
listen = /var/run/blog.sock

listen.owner = blog
listen.group = www-data

user = blog
group = www-data

pm = ondemand
pm.max_children = 263
pm.process_idle_timeout = 60s
pm.max_requests = 500
systemctl restart php7.4-fpm.service
apt-get install -y mariadb-server mariadb-client

mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): [Touche Entrée]
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
mysql -u root -p
CREATE DATABASE blog;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON blog.* TO '*******'@'localhost' IDENTIFIED BY  '**********!';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
nano /etc/nginx/sites-available/blog
upstream php-wp {
    server            unix:/var/run/blog.sock;
}

server {
    listen            80;
    listen            [::]:80;
    server_name       blog.mondomaine.com;

    root              /var/www/blog;
    
    index             index.php;
    
    location / {
        try_files     $uri $uri/ /index.php?$args;
    }

    location = /favicon.ico {
        log_not_found off;
        access_log    off;
    }

    location = /robots.txt {
        allow                    all;
        log_not_found off;
        access_log    off;
    }

    location ~ .php$ {
        include       fastcgi.conf;
        fastcgi_pass  php-wp;
    }

    location ~* .(js|css|png|jpg|jpeg|gif|ico)$ {
        expires       max;
        log_not_found off;
    }
}
ln -s /etc/nginx/sites-available/blog /etc/nginx/sites-enabled/blog
systemctl restart nginx.service
apt-get install -y software-properties-common
apt-get install -y certbot
certbot certonly --webroot -w /var/www/blog --agree-tos --no-eff-email --email [email protected] -d blog.mondomaine.com --rsa-key-size 4096

虽然我在 debian10 上。在这一个上我在步骤 9.2 中阻止了证书我有这个域错误消息:

   www. ********. link
   Type: unauthorized
   Detail: Invalid response from http: //www.*******.link
   [*************]: "<html xml: lang = \" fr-FR \ "
   lang = \ "fr-FR \"> \ n <head> \ n <title qtlid = \ "28806 \"> Congratulations!
   Your domain has been successfully created at OVH! </ "

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A / AAAA record (s) for that domain
   contain (s) the right IP address.

另一方面,我正处于必须访问网站上安装的 wordpress 的阶段...

但我仍然被重定向到 ovh,所以我决定查看我的网站的托管端,我发现我在步骤 2.3.2 处阻止了它,然后当我执行 2.3.3 时,我在以下命令中收到此错误消息

% named-checkconf
-bash: fg:%: no such job

这里是我的 bind 的 named.conf 配置

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
server **********
server 127.0.0.1
server ************ {


zone "********.link" {
        type master;
        file "*********.zone";

我这样做:

           apt-get install bind9
           cd  /etc/bind/
           nano named.conf
options {
    directory "/var/cache/bind";

    forwarders {
        ***********;
        ***********;
     };

    auth-nxdomain no;
};
nano /etc/resolv.conf
search liste_de_domaines_pour_les_noms_DNS_dont_le_domaine_n'est_pas_précisé
nameserver127.0.0.1
nameserver **********
nameserver **********
nano named.conf
zone "*******" {
    type master;
    file "*********.zone";
};
cp ~/config/*********.zone /var/cache/bind/
% named-checkconf

编辑:我现在明白了,我已经为我的服务器请求了第二个 IP,我很快会回来告诉你更多信息!谢谢你的布局!!!你能帮助我吗?非常感谢 Sam

答案1

您不需要第二个 IP 地址。使用基于名称的虚拟主机,您可以拥有任何数字单个 IP 地址上的域名。响应certbot列表表明您获取的域名未指向您的服务器:

Detail: Invalid response from http: //www.*******.link
   [*************]: "<html xml: lang = \" fr-FR \ "
   lang = \ "fr-FR \"> \ n <head> \ n <title qtlid = \ "28806 \"> Congratulations!
   Your domain has been successfully created at OVH! </ "

这不是您的服务器会返回的响应。这是 OVH 域名停放页面。

您必须转到 OVH 域控制面板并将域的 A 记录更改为您服务器的 IP 地址。

您不需要自己设置 DNS 服务器。DNS 已包含在内。


我还可以推荐托管主机吗?保护和管理专用服务器需要高级 Linux 和网络知识。工作也永无止境。更新可用,新的漏洞被发现……

如果您想学习,廉价的 VPS 可能是更好的解决方案。慢慢来,从 Linux 基础知识、安全性(防火墙、安全 SSH 等)开始,然后也许再学习一些静止的(想想 HTML 文件)网络托管。一旦成功,您就可以继续使用 Let's Encrypt(使用certbot或不使用)来启动和运行 HTTPS。或者可能是使用 PHP 的动态网站。

我认为了解事物如何设置以及它们如何相互作用非常重要。

相关内容