| Author |
Message |
ambuj
Joined: 12 Jan 2012
Posts: 6
|
| Posted: Thu Jan 12, 2012 2:38 pm Post subject: Domain/Wordpress setup |
|
|
Hello,
I completely new to Linode and Linux. Just been trying out hosting a Wordpress site using a domain. I've gone quite a few documentation pages but I'm stuck with something.
I've registered my domain ( http://www.findmill.co.uk ) and trying to host it in Nginx but I can't seem to connect the website from browser. Keep getting "could not connect " errors. Strangely, I could connect a few minutes ago and I was getting "Welcome to nginx" page. So, I don't think it's a domain registration issue. I just can't browse to any of the pages that I have got under srv/www/findmill.co.uk/public_html
Any help will be appreciated.
I've been following these docs:
http://library.linode.com/lemp-guides/ubuntu-10.04-lucid
http://library.linode.com/web-applications/cms-guides/wordpress |
|
| Back to top |
|
obs
Joined: 07 Mar 2010
Posts: 1403
Location: Earth
|
| Posted: Thu Jan 12, 2012 3:33 pm Post subject: |
|
|
Works for me I see
Welcome to nginx! xxx |
|
| Back to top |
|
ambuj
Joined: 12 Jan 2012
Posts: 6
|
| Posted: Thu Jan 12, 2012 3:39 pm Post subject: |
|
|
Thanks! I figured it out - it was because I had accidently deleted my default config file! Silly me!
Any ideas how do I point nginx to my public_html folder rather than this static HTML file? I want the domain to point to the Wordpress folder. |
|
| Back to top |
|
pannix
Joined: 01 Dec 2010
Posts: 39
Location: Belgium
|
| Posted: Thu Jan 12, 2012 3:40 pm Post subject: |
|
|
I found this one very useful:
http://www.howtoforge.com/running-wordpress-on-nginx-lemp-on-debian-squeeze-ubuntu-11.04 |
|
| Back to top |
|
obs
Joined: 07 Mar 2010
Posts: 1403
Location: Earth
|
| Posted: Thu Jan 12, 2012 3:40 pm Post subject: |
|
|
| change the "root" parameter to the path of your wordpress installation. |
|
| Back to top |
|
ambuj
Joined: 12 Jan 2012
Posts: 6
|
| Posted: Thu Jan 12, 2012 4:05 pm Post subject: |
|
|
It's already pointing there:
location / {
root /srv/www/findmill.co.uk/public_html;
index index.html index.htm;
}
Do I need to delete the index.html file from where this welcome message is coming? |
|
| Back to top |
|
pannix
Joined: 01 Dec 2010
Posts: 39
Location: Belgium
|
| Posted: Thu Jan 12, 2012 4:10 pm Post subject: |
|
|
Have you reloaded nginx after every change to config file (nginx and vhosts)?
Read somewhere that you should put root outside of location block. Don't know if it is just best practice. |
|
| Back to top |
|
ambuj
Joined: 12 Jan 2012
Posts: 6
|
| Posted: Thu Jan 12, 2012 4:22 pm Post subject: |
|
|
| Yes, I've reloaded and restarted |
|
| Back to top |
|
pannix
Joined: 01 Dec 2010
Posts: 39
Location: Belgium
|
| Posted: Thu Jan 12, 2012 5:13 pm Post subject: |
|
|
Have a look at the access and error log for your vhost (wherever you put them) and the access and error log of nginx in /var/log/nginx/ and post any error messages here.
Newbie myself, site went live on my LEMP 2 weeks ago. |
|
| Back to top |
|
obs
Joined: 07 Mar 2010
Posts: 1403
Location: Earth
|
| Posted: Thu Jan 12, 2012 6:49 pm Post subject: |
|
|
| Post your nginx configuration. |
|
| Back to top |
|
ambuj
Joined: 12 Jan 2012
Posts: 6
|
| Posted: Fri Jan 13, 2012 2:12 am Post subject: |
|
|
Here's my findmill.co.uk:
server {
listen 80;
server_name www.findmill.co.uk findmill.co.uk;
access_log /srv/www/findmill.co.uk/logs/access.log;
error_log /srv/www/findmill.co.uk/logs/error.log;
location / {
root /srv/www/findmill.co.uk/public_html;
index index.html index.htm;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /srv/www/findmill.co.uk/public_html$fastcgi_script_name;
}
}
And here's my nginx.conf: The only change I've made to it is this added this line: include /etc/nginx/sites-enabled/*;
user www-data;
worker_processes 4;
pid /var/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/sites-enabled/*;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# 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/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#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;
# }
#} |
|
| Back to top |
|
obs
Joined: 07 Mar 2010
Posts: 1403
Location: Earth
|
| Posted: Fri Jan 13, 2012 3:59 am Post subject: |
|
|
| Move root outside the location block and into the server block just below error_log then restart nginx. |
|
| Back to top |
|
ambuj
Joined: 12 Jan 2012
Posts: 6
|
| Posted: Fri Jan 13, 2012 1:18 pm Post subject: |
|
|
| Thanks a lot! That seems to have done the trick! Thanks for your help! |
|
| Back to top |
|
| |