rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
yum -y upgrade
yum install mariadb mariadb-server mysql vim-enhanced nginx php-fpm php-mysql php-pear php-bcmath php-common php-gd php-pdo php-pdo-mysql php-mcrypt
- edit /etc/my.cnf.d/server.cnf
- under [server] heading, add the following:
bind-address = 127.0.0.1
systemctl restart mariadb; systemctl enable mariadb; mysql_secure_installation
- It will ask you a set of questions. The default MySQL (MariaDB) root password is blank. Set it, and say “Y” to everything else
cat /proc/cpuinfo |grep processor -c
- if the number returns is anything other than “1”, edit “/etc/nginx/nginx.conf”
- change worker_processes to the number the last command outputted
- Run nginx -t
- If it doesn’t give an error, run the following:
systemctl restart nginx; systemctl enable nginx
- Edit /etc/php.ini
- uncomment “date.timezone = ” and set it to your Timezone. For example:
date.timezone = America/Chicago
- change expose_php to “Off”
- change user and group:
user = nginx
group = nginx
- Run this to set the logs properly:
chown nginx:root /var/log/php-fpm -R
systemctl restart php-fpm; systemctl enable php-fpm
- Create your document root
mkdir -p /srv/www/YOUR_DOMAIN_GOES_HERE
chown nginx:nginx -R /srv/www
- Download Magento (you will need to sign up for their site)
- SCP/SFTP it to your server (I just dropped it in /root/)
- Untar it, move the files around, and set ownership:
cd /srv/www/YOUR_DOMAIN_GOES_HERE
tar zxf ~/magento-1.9.1.0.tar.gz; mv magento* .
mv magento/.htaccess* .
cd /srv/
chown nginx:nginx * -R
- Next, we need to set up the hostfile for the site. Edit /etc/nginx/conf.d/default.conf, and put this in there (changing all instances of “YOURDOMAINGOES_HERE” with your domain/sub-domain):
server {
listen 80 default;
## SSL directives might go here
server_name YOUR_DOMAIN_GOES_HERE www.YOUR_DOMAIN_GOES_HERE; ## Domain is here twice so server_name_in_redirect will favour the www
root /srv/www/YOUR_DOMAIN_GOES_HERE;
location / {
index index.html index.php; ## Allow a static html file to be shown first
try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
expires 30d; ## Assume all files are cachable
}
## These locations would be hidden by .htaccess normally
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; }
location /var/export/ { ## Allow admins only to view export folder
auth_basic "Restricted"; ## Message shown in login window
auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
autoindex on;
}
location /. { ## Disable .htaccess and other hidden files
return 404;
}
location @handler { ## Magento uses a common front handler
rewrite / /index.php;
}
location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
rewrite ^(.*.php)/ $1 last;
}
location ~ .php$ { ## Execute PHP scripts
if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
expires off; ## Do not cache dynamic content
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param MAGE_RUN_CODE default; ## Store code is defined in administration > Configuration > Manage Stores
fastcgi_param MAGE_RUN_TYPE store;
include fastcgi_params; ## See /etc/nginx/fastcgi_params
}
}
nginx -t
- If there aren’t any errors, restart nginx:
systemctl restart nginx
- Next, we need to hop on MariaDB:
mysql -p
- Now, to add the database & user/pass (Change the database name, user, and pass to what you want):
CREATE DATABASE magento;
GRANT ALL PRIVILEGES ON magento.* TO 'magento_user'@'localhost' IDENTIFIED BY 'YOUR_PASS_GOES_HERE';
- Finally, go to the server IP or domain and go through the setup.
i needed step 4 please