amazon web services - trouble configuring nginx on ec2 instance for Magento -


i'm trying install magento 1.9 on amazon ec2 server running nginx & hhvm. i've got hhvm & nginx running , when put ec2 serers's ip in url nginx welcome screen displayed when put in url magento app (i.e. http://54.???.??.???/dev-magento) 404 error.

i've put magento in /var/www/dev-magento rather /usr/share/nginx/html/. intend have staging-magento site why i'm not dropping magento /usr/share/nginx/html/.

i've set /etc/www/ directory with

sudo chown www-data:www-data * -r sudo usermod -a -g www-data ubuntu 

i've put created nginx configuration file dev-magento site in /etc/nginx/sites-available.dev-magento

server {     # listen on port 80 post 443 ssl connections.     listen 80;     #listen 443 default ssl;      server_name 54.???.??.???/dev-magento;      # specify path ssl certificates.    #ssl_certificate /etc/nginx/certificates/yourcertificate.crt;     #ssl_certificate_key /etc/nginx/certificates/yourcertificate.key;      # path files in wish     # store access , error logs.     #access_log /path/to/your/logs/access_log;     #error_log /path/to/your/logs/error_log;      # if site accessed via mydomain.com     # automatically redirect www.magento.localhost.com.     #if ($host = 'dev-magento' ) {         #rewrite ^/(.*)$ http://www.dev-magento/$1permanent;    #}      root /var/www/dev-magento/;      location / {         index index.html index.php;         try_files $uri $uri/ @handler;     }      # deny access specific directories no 1     # in particular needs access anyways.     location /app/ { deny all; }     location /includes/ { deny all; }     location /lib/ { deny all; }     location /media/downloadable/ { deny all; }     location /pkginfo/ { deny all; }     location /report/config.xml { deny all; }     location /var/ { deny all; }      # allow have login name , password     # view export folder. refer /etc/nginx/htpassword.     #location /var/export/ {     #    auth_basic "restricted";     #    auth_basic_user_file htpasswd;     #    autoindex on;     #}      # deny attempts access hidden files     # such .htaccess, .htpasswd, etc...     location ~ /\. {          deny all;          access_log off;          log_not_found off;     }      # redirect added use magentos     # common front handler when handling incoming urls.     location @handler {         rewrite / /index.php;     }      # forward paths such /js/index.php/x.js     # relevant handler.     location ~ .php/ {         rewrite ^(.*.php)/ $1 last;     }      # handle exectution of .php files.     location ~ .php$ {         if (!-e $request_filename) {             rewrite / /index.php last;         }         expires off;         fastcgi_pass unix:/var/run/php5-fpm.sock;         #fastcgi_param https $fastcgi_https;         fastcgi_param script_filename $document_root$fastcgi_script_name;         fastcgi_param mage_run_code default;         fastcgi_param mage_run_type store;         include fastcgi_params;     } } 

after ran:

sudo ln -s /etc/nginx/sites-available/dev-magento /etc/nginx/sites-enabled/ sudo service nginx restart sudo service hhvm restart 

however i'm still getting 404 page when go 54.???.??.???/dev-magento.

i think must missing pretty obvhious i'm new aws & nginx configurations.

i able fix changing server name in nginx configuration file server_name dev-magento; , adding 54.???.??.??? dev-magento local machines /etc/hosts file.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -