I followed the instruction(I mean, fully) and it turned out like this
what the problem it might be?
I followed the instruction(I mean, fully) and it turned out like this
what the problem it might be?
I do not own the book so I do not know what the final goal here is but Iād say that if the exercise was to install the nginx web server than you were successful.
If the above text is what you see in your web browser pointed to localhost or whatever domain that this install lives on than it seems like youāve succeeded.
Why do you think thereās an issue here?
Steve
No,the final goal is to deploy an application on Digitalocean,and Iāve done what need to be done,it still looks like that,my application wasnāt there.
Okay, I understand now. (I think)
You deployed an app but when you surf to the domain on DO, you still see the test page placed in the document root by the nginx install correct?
My suggestion would be to check to see where you application is installed to. Ensure you didnāt inadvertently have the app installed into your /home/ directory.
Next check to ensure that you app is in fact in the document root for that particular install of nginx. Generally something like /var/www or /var/www/html
If you app is inside a folder on DO you may need to change the uri in your browser. For example if your app is named āawesomeā it could very well live inside a folder named āawesomeā so in your URI you might have something like http://yourdomain.com/awesome/
Another suggestion is to open up a terminal window to your DO domain and look at the files in the document root for the web server. Either use SSH or do so through the DO management page over on the right side, across from your droplet name in the drop down menu that says āMoreā then access console.
Steve
Sorry,but none of your suggestions work,and you did point out where the problem might be,and I found several mistakes in the serverās configuration file but then it still the way it was
this is the contents of the configuration file:
server {
listen 80;
listen 443 ssl;
server_name 188.166.211.224;
root "/var/www/guestbook/public";
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/guestbook.app-error.log error;
sendfile off;
client_max_body_size 100m;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
}
location ~ /\.ht {
deny all;
}
}
donāt know whether thereās some other problems I didnāt notice.
Hi Akido,
At this point I am unsure as to what might be causing the issue you are seeing. Iām guessing your not having a permission issue correct?
I do not have a copy of the book but Iām making a guess that your app is some sort of guestbook and that the app lives under /var/www/ right, with the index.php file located at /var/www/guestbook/public/? (Iām taking this from your nginx config file you posted).
Iām not very familiar with nginx, I doubt Iād be able to trouble shoot an issue with the web server.
If you created a new php file in this directory using perhaps vim can you point your browser at this file and see it?
(try something like: <?php phpinfo(); ?>
This will also verify that you have PHP installed too.
The author of the book frequents these forums, maybe he could offer some advice???
Steve
Your guesses about my application is right.
it looks like this
just a stupid little demo,you can leave a comment and it will displayed above.
And I realized that the thing is that I canāt access my applicationās root file at all,because I deleted the default setting of the web server(which located the same directory as the guestbook.app
āthe serverās configuration file of my application I copied from the development environment-- at /etc/nginx/sites-available/
),and the 188.166.211.224 is now not reachable.
Youāve helped me a lot,I really appreciate it,wish you a good dayš¬.
Oh,you mentioned permission,the bookās guide like this
d /var/www/guestbook
sudo chown -R :www-data .
sudo chmod -R 775 storage
I thought it must be cd,and donāt know why thereās a dot the second line.I ran it for two times.Is the instruction right?
/storage
is a directory I put database files in it.
My first thought was default files. This line in the nginx config:
index index.html index.htm index.php;
Has the index.html listed before index.php. It could be that if you forgot to delete the default html index file, itās simply ignoring your own index php file.
You should be deleting any default files and replacing them with your own appās index file.
I already did that,but thanks.
Iāll take a more detailed look asap, sorry about that - but Iām currently at conferences and moving apartments so a bit strapped for time. Iāll do it as soon as I can, I promise!
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.