http 오류: 컬 오류 7: wordpress.org 포트 80에 연결하지 못했습니다.

http 오류: 컬 오류 7: wordpress.org 포트 80에 연결하지 못했습니다.

LEMP 및 wordpress와 함께 Ubuntu 서버 16.04를 새로 설치했습니다. 그런데 홈페이지에 아래와 같은 오류가 뜨면서 그 과정에서 한 단계를 놓친 것 같습니다.

http error: curl error 7: failed to connect to wordpress.org port 80.

웹 사이트를 개발할 때 먼저 로컬 컴퓨터에서 모든 것을 테스트하기 위해 가상 컴퓨터에서 구성한 것 외에 사이트가 잘 작동합니다.

내 구성 파일은 다음과 같습니다.

server {
        listen 80;
        server_name 192.168.1.3; #ipaddress;
        root /usr/share/nginx/mrupgrade.be/;
        index index.php index.html index.htm;

        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;

        location = /50x.html    {
                root /usr/share/nginx/html;
        }
        location / {
                try_files $uri $uri/ /index.php;
        }

        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;

        location ~ \.php$ {
                try_files $uri = 404;
                fastcgi_pass unix:/run/php/php7.0-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
                root /usr/share/nginx/mrupgrade.be/;
                }
        }

해당 규칙을 사용하여 방화벽을 구성했습니다.

도움을 주셔서 미리 감사드립니다.

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:http
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED

wp-config.php

<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the
 * installation. You don't have to use the web site, you can
 * copy this file to "wp-config.php" and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * MySQL settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://codex.wordpress.org/Editing_wp-config.php
 *
 * @package WordPress
 */

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'mysite_wp_db');

/** MySQL database username */
define('DB_USER', 'mysite_user');

/** MySQL database password */
define('DB_PASSWORD', 'mysite');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         'put your unique phrase here');
define('SECURE_AUTH_KEY',  'put your unique phrase here');
define('LOGGED_IN_KEY',    'put your unique phrase here');
define('NONCE_KEY',        'put your unique phrase here');
define('AUTH_SALT',        'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT',   'put your unique phrase here');
define('NONCE_SALT',       'put your unique phrase here');

/**#@-*/

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix  = 'wp_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the Codex.
 *
 * @link https://codex.wordpress.org/Debugging_in_WordPress
 */
define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

/var/www/mrupgrade.be/public_html nginx 사이트 구성의 사이트 위치

user www-data;
worker_processes auto;
pid /run/nginx.pid;

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;

    ##
    # SSL Settings
    ##

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_disable "msie6";

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

내 /etc/nginx/nginx.conf

#mail {
#   # See sample authentication script at:
#   # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
# 
#   # auth_http localhost/auth.php;
#   # pop3_capabilities "TOP" "USER";
#   # imap_capabilities "IMAP4rev1" "UIDPLUS";
# 
#   server {
#       listen     localhost:110;
#       protocol   pop3;
#       proxy      on;
#   }
# 
#   server {
#       listen     localhost:143;
#       protocol   imap;
#       proxy      on;
#   }
#}

따라서 이미지에서는 모든 것이 괜찮습니다. lib가 누락되었거나 fpm fast cgi를 설치했는지 모르겠습니다.

WordPress에서 http 요청으로 웹에 연결할 수 없습니다.

RSS 플럭스 오류

어떤 단서도 환영받을 수 있을지 모르겠습니다.

도움을 주셔서 미리 감사드립니다.

답변1

귀하의 서버는 wordpress.org입니까?

구성 파일에 따르면 다음과 같습니다.

server_name 192.168.1.3; #ipaddress;

로컬에서 서버 이름을 사용하려면 /etc/hosts에 IP 주소와 이름을 입력해야 하며, 외부에서 액세스할 수 있어야 하는 경우 ISP에서 호스트 이름과 DNS 항목을 제공해야 합니다. 그리고 라우터에서 적절한 포트 전달을 설정해야 합니다.

답변2

컬이 문제인 경우 먼저 콘솔에서 실행하여 네트워크 관련 문제(방화벽 등)인지 확인합니다.

SELINUX를 활성화한 경우 이로 인해 웹 서버가 요청을 차단할 수 있는 것 같습니다. 여기에서 볼 수 있듯이https://wordpress.org/support/topic/error-curl-error-7-3/

컬이 콘솔에서 작동하고 SELINUX를 활성화하지 않은 경우 작은 PHP 스크립트를 테스트하여 컬이 작동하는지 확인하고 이를 더 잘 디버깅할 호스트를 테스트합니다.

건배

답변3

SELinux를 확인하세요. 자동으로 다시 켜지고 CURL을 방해하고 있었습니다.

Linux 박스가 재부팅될 때까지 SELinux를 일시적으로 비활성화하려면 를 실행하십시오 setenforce 0.

관련 정보