본문 바로가기



우분투 리눅스 nigex에 워드프레스 설치하기



1. 웹 서버의 루트 디렉토리로 이동합니다:

cd /var/www/html/

 

2.워드프레스를 다운로드하고 압축을 해제합니다:

sudo wget https://wordpress.org/latest.tar.gz
sudo tar -xzvf latest.tar.gz

 

3. 압축을 해제한 후, 워드프레스 파일들을 현재 디렉토리로 이동시킵니다:

sudo mv wordpress/* .

 

4. 워드프레스 설치에 사용되었던 디렉토리를 삭제합니다:

sudo rm -r wordpress/

 

5. 웹 서버 사용자로 소유자를 변경합니다:

sudo chown -R www-data:www-data .

 

6. 환경파일 셋팅 - sudo vi /etc/nginx/sites-available/default

 

[변경전]

        # See: https://bugs.debian.org/773332
        #
        # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        # include snippets/snakeoil.conf;

        root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;

        server_name _;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

        # pass PHP scripts to FastCGI server
        #
        #location ~ \.php$ {
        #       include snippets/fastcgi-php.conf;
        #
        #       # With php-fpm (or other unix sockets):
        #       fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        #       # With php-cgi (or other tcp sockets):
        #       fastcgi_pass 127.0.0.1:9000;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #       deny all;
        #}
}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#       listen 80;
#       listen [::]:80;
#
#       server_name example.com;
#
#       root /var/www/example.com;
#       index index.html;
#
#       location / {
#               try_files $uri $uri/ =404;
#       }
#}

 

[변경후]

vi 여러줄 삭제 5dd 5줄 삭제 10dd 10줄삭제 

server {

    listen 80;
    server_name 150.007.007.007;

    root /var/www/html;
    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }

}

 

[ nginx 재부팅 ]

sudo service nginx restart

 

 

 

7. http://your_ip 처음적속이라면 인스톨화면을 볼수있습니다.