Thursday 7 May 2015

Create Magento Site Nginx 2015

Make directory under var/vhosts/www  and add magento files
go to ect/php-fpm.d/  create config file
go to ect/nginx/conf  create config file
Putty, login.
Add the following commands:
mysql;
create database databasenamehere;
grant all privileges on databasenamehere.* to 'usernamehere'@'localhost' identified by "passwordhere";  
exit;
service php-fpm restart;
service nginx restart;

close putty if no errors.


When you did the php-fpm restart both answers which popup should say ok in green if not follow the error message given this will be in the root: ect/php-fpm.d/ folder and file uploaded earlier. If this has taken other sites on the server down, download (so you have a copy to ammend) then delete the new config file you made earlier from the server. Make sure you get the right config file other wise you will loose the other sites forever.
Visit the website you have just created.

Tuesday 5 May 2015

nginx putty commands

Putty -

su root (switches user to root)

have to put a semi-col after each command so that it recognizes it ;

service php-fpm restart;  (restarts any new php-fpm docs or edits)

service nginx restart;      (restarts nginx)

mysql;  (opens mysql)

create database typedatabasename;  (replace type databasename with your own database name - creates a new database)

grant all privileges on typedatabasename.* to 'typeusername'@'localhost' identified by "typepassword";   (creates a username and password for the named database)

flush privileges; (restarts mysql)

exit (quits mysql)

chown -R default.co.uk:default.co.uk /var/www/vhosts/default.co.uk (changes ownership of the route listed in the command)


If on the magneto installation wizard under the configuration tab you get: Database connection error. as a message use the following command:
grant all privileges on yourdatabasename.* to 'yourusername'@'localhost' identified by "yourpassword";
if the local host part hasnt been picked up it wont work.