2013-02-13 2 views
0

현재 Fedora 18 x64에서 Nginx + MySQL + Wordpress 작업을하고 있습니다.Nginx Wordpress

다음 설명서를 읽으셨습니까? http://www.tecmint.com/install-wordpress-using-lamp-or-lemp-on-rhel-centos-fedora/ 아무 것도 작동하지 않습니다.

기본 Nginx 인사말은 여전히 ​​localhost : 80에 표시됩니다.

예제로 일부 구성 파일을 제공해야합니까?

정말 도움이되도록 도와주세요. Google는 공식적인 Nginx 매뉴얼을 읽었습니다.

# For more information on configuration, see: 
# * Official English Documentation: http://nginx.org/en/docs/ 
# * Official Russian Documentation: http://nginx.org/ru/docs/ 

user nginx; 
worker_processes 1; 

error_log /var/log/nginx/error.log; 
#error_log /var/log/nginx/error.log notice; 
#error_log /var/log/nginx/error.log info; 

pid  /run/nginx.pid; 


events { 
worker_connections 1024; 
} 


http { 
include  /usr/local/etc/nginx/sites-enabled/*; 
include  mime.types; 

default_type application/octet-stream; 

log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 
        '$status $body_bytes_sent "$http_referer" ' 
        '"$http_user_agent" "$http_x_forwarded_for"'; 

access_log /var/log/nginx/access.log main; 

sendfile  on; 
#tcp_nopush  on; 

#keepalive_timeout 0; 
keepalive_timeout 65; 

#gzip on; 

server { 
    listen  80; 
    server_name localhost; 

    #charset koi8-r; 

    #access_log /var/log/nginx/host.access.log main; 

    location/{ 
     root /srv/www/wordpress/public_html; 
     index index.php index.html; 
    } 

    # redirect server error pages to the static page /40x.html 
    # 
    error_page 404    /404.html; 
    location = /40x.html { 
     root /usr/share/nginx/html; 
    } 

    # redirect server error pages to the static page /50x.html 
    # 
    error_page 500 502 503 504 /50x.html; 
    location = /50x.html { 
     root /usr/share/nginx/html; 
    } 

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80 
    # 
    #location ~ \.php$ { 
    # proxy_pass http://127.0.0.1; 
    #} 

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 
    # 
    #location ~ \.php$ { 
    # root   html; 
    # fastcgi_pass 127.0.0.1:9000; 
    # fastcgi_index index.php; 
    # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 
    # include  fastcgi_params; 
    #} 

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


# another virtual host using mix of IP-, name-, and port-based configuration 
# 
#server { 
# listen  8000; 
# listen  somename:8080; 
# server_name somename alias another.alias; 

# location/{ 
#  root html; 
#  index index.html index.htm; 
# } 
#} 


# HTTPS server 
# 
#server { 
# listen  443; 
# server_name localhost; 

# ssl     on; 
# ssl_certificate  cert.pem; 
# ssl_certificate_key cert.key; 

# ssl_session_timeout 5m; 

# ssl_protocols SSLv2 SSLv3 TLSv1; 
# ssl_ciphers HIGH:!aNULL:!MD5; 
# ssl_prefer_server_ciphers on; 

# location/{ 
#  root html; 
#  index index.html index.htm; 
# } 
#} 

} 
+0

귀하의 WordPress 사이트에 대한 nginx 설정으로 게시물을 편집 할 수 있습니까? – CDub

+0

설명서에 언급되지 않았기 때문에 나는 실제로 nginx.conf 파일을 건드리지 않았습니다. –

+0

방금 ​​깨달은 것, 내가 먼저해야 할 일 http://www.tecmint.com/install-lemp-linux-nginx-mysql-php-on-rhel-centos-5-6-fedora-12-17/ 가이드 및 그 다음 나는 메인 포스트에서 링크 된 하나에 뛰어 올라 탔다. –

답변

4

다음은 내 워드 프레스 사이트 중 하나에 대한 내의 nginx의 설정 뺀 도메인 이름과 IP 주소는 물론 ... 나는 온라인으로 많은 참조를 사용하여이 일을 구축하고 꽤 잘 작동하는 것 같다.

server { 
    listen <ip-address>; 
    server_name domain.com; 
    rewrite ^(.*) $scheme://www.domain.com$request_uri? permanent; 
} 

server { 
    listen <ip-address>; 
    server_name www.domain.com; 
    root /www/domain.com/public_html; 

    access_log /www/domain.com/logs/access.log; 
    error_log /www/domain.com/logs/error.log; 

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

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

    location/{ 
    index index.html index.htm index.php; 
    try_files $uri $uri/ /index.php; 
    } 

    location ~ \.php$ { 
    include /etc/nginx/fastcgi_params; 
    if ($uri !~ "^/images/") { 
     fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket; 
    } 
    fastcgi_index index.php; 
    fastcgi_param SCRIPT_FILENAME /www/domain.com/public_html$fastcgi_script_name; 
    } 

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 
    expires max; 
    log_not_found off; 
    } 
} 
+0

내일 사용해 주셔서 감사합니다. 건배. –

+0

좋아요! 작동하지 않는다면 나에게 메시지를 보내거나 여기에 다시 게시하십시오. 우리는 계속 작업 할 것입니다. :) – CDub

관련 문제