Nginx and PHP-fastCGI installed, but can't see my site!
On my new Linode 512 I first installed Apache2, MySQL and PHP5. The site was nice and fast, but the PHP code that reads and updates RSS feeds, and rotates banner ads, simply didn't work – I could see the site ok, but the banners and RSS feeds just sat there. I figured I might as well just get bold and try Nginx and PHP-fastCGI.
I uninstalled Apache2 and MySql with apt-get purge, then carefully followed the steps in "Nginx and PHP-FastCGI on Ubuntu 10.04 LTS".
The last step they say is to upload test.php to the public_html folder and look at it in a browser.
Since webstrider.com is an active site, I don't want to change the DNS name server until I know it works on the new server. So in instead of going to webstrider.com/test.php. I entered the IP address in the browser, which worked fine when I was running Apache, but when I did that after installing nginx, etc, all I see is "welcome to nginx!" If I append /test.php, I get a 404 error.
I went back and reviewed everything and cannot find any mistakes. Of course I have rebooted the server, so everything is fresh. All files have been uploaded to public_html, but when I try to see them it's as though they simply aren't there.
I am stumped. Any suggestions would be greatly appreciated.
5 Replies
telnet your.host 80
GET /test.php HTTP/1.0
Host: webstrider.com
<blank line=""></blank>
The "Host:" line tells the webserver what virtual host to pick.
Add an entry to the hosts file
Create a DNS entry for dev.webstrider.com and use that to test. You will need to configure Nginx to recognize that name alongside webstrider.com and may also have to configure your web application.
Stephen - did you mean use telnet (I use PuTTy) to open a session and just type in those commands? I don't know enough yet about linux to understand what is going on in your suggestion however.
Vance - I edited the host file on my system, and it still goes to the "real" webstrider.com, even after a system restart. And for creating a DNS entry for dev.webstrider.com, did you mean doing so thru the linode DNS manager?
But I can't help but wonder, since I am getting a response from my linode (welcome to nginx) when I go to the IP address, and a 404 error when I enter, for instance, 'index.php', perhaps I could make more progress if I can figure out where it defaults to as a starting point, ie, the public_html folder or someplace else.
-Ed
..I probably need to review the steps again, more carefully.
In the olden days, there was a 1:1 relationship between web servers and IP addresses. So you typed foo.example.com into your web browser. It looked in DNS and got the address 12.34.56.78, then made a connection to that address to retrieve the page. The server might have been a machine with that IP address hosting a single web site. Or it could have several IP addresses and be hosting multiple sites, and knew which one was being requested by the destination IP address (IP-based virtual hosting
People soon realized that we'd quickly burn through the available IPv4 space if we gave each site its own address. Thus, name-based virtual hosting
Nowadays, all browsers have such support, so name-based virtual hosting is the standard setup for any machine running multiple sites. But if you type an IP address into your browser, it doesn't know which host you want, so you'll get whatever the web server considers to be the "default" site.
On to your questions…
sweh was describing a way that you can directly interact with a web server. It's possible with PuTTY, assuming your version supports the Telnet connection type.
The line that you add to your hosts file should read:
12.34.56.78 webstrider.com
using your Linode's real IP address, of course. I don't know if anything special is needed on Windows to get it to recognize the change; you might find some answers on a Windows-specific forum.
You would create a DNS entry for dev.webstrider.com on your current DNS provider, which looks to be Cloudflare.
But it sounds like you need to get the PHP issue sorted out first. I'm not familiar with Nginx so can't help you there.