Run the following command to disable SELinux immediately
setenforce 0
getenforce
Run the following command to disable SELinux immediately
setenforce 0
getenforce
The mod_rewrite module is enabled by default on CentOS 7. If you find it is not enabled on your server, you can enable it by editing 00-base.conf file located in /etc/httpd/conf.modules.d/ directory.
vi
/etc/httpd/conf.modules.d/00-base.conf
LoadModule rewrite_module modules/mod_rewrite.so Service httpd restart
Run the following command
sudo yum install -y yum-utils --enablerepo="base"
Run the following commands
git checkout -b NEW_BRANCH_NAME git push -u origin NEW_BRANCH_NAME
Run the following commands
git config --global user.email "info@phpcodez.com" git config --global user.name "PHPCodez"
Update the repository
yum update -y
Install the EPEL repository
yum install epel-release -y
Install dependencies from yum
yum install -y zlib zlib-devel pcre prce-devel openssl openssl-devel
Get the Nginx packages to install
cd /usr/src wget https://nginx.org/download/nginx-1.14.0.tar.gz tar xvf nginx-1.14.0.tar.gz cd nginx-1.14.0
Create user nginx
useradd -d /etc/nginx/ -s /sbin/nologin nginx
Configure
./configure --user=nginx --group=nginx --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module --with-pcre --with-file-aio --with-http_realip_module --without-http_scgi_module --without-http_uwsgi_module --with-http_realip_module
Compile and Install
make make install
Verify NginX is installed
nginx -v
Add systemd service file
vi /etc/systemd/system/nginx.service [Unit] Description=The NGINX HTTP and reverse proxy server After=syslog.target network.target remote-fs.target nss-lookup.target [Service] Type=forking PIDFile=/var/run/nginx.pid ExecStartPre=/usr/sbin/nginx -t ExecStart=/usr/sbin/nginx ExecReload=/usr/sbin/nginx -s reload ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target
Enable and start service
systemctl enable nginx systemctl start nginx
Check nginx is processing your request
On commandline
curl localhost
Browser
Make sure port 80 is enabled.
firewall-cmd --zone=public --add-port=80/tcp --permanent && firewall-cmd --reload
Findout the ip
ip addr
Load the site using the URL and it should display ‘Welcome to nginx!’ message.
http://127.0.0.1/
OpenSSL – Supports the HTTPS protocol. Required by the NGINX SSL module and others.
Run the following commands to install openssl
cd /tmp/ wget http://www.openssl.org/source/openssl-1.0.2o.tar.gz tar -zxf openssl-1.0.2o.tar.gz cd openssl-1.0.2o ./Configure linux-x86_64 --prefix=/usr make make install
You can verify the installation by issuing the following command.
openssl -version
You can setup them in /etc/my.cnf (CentOS 7)
vi /etc/my.cnf
Append config directives as follows:
query_cache_size = 268435456 query_cache_type=1 query_cache_limit=1048576
In above example the maximum size of individual query results that can be cached set to 1048576 using query_cache_limit system variable. Memory size in Kb.
Restart the mysql service.
service mysqld restart
Follow the below steps to install Magento 2 with sample-data.
Make sure that httpd / Nginx,PHP,MySQL and Composer are installed in the server by issuing the following commands
httpd -v / nginx -v php -v composer -v mysql
Change the directory to documet root
cd /var/www/html/
Download Magento and issue the following commands
sudo git clone https://github.com/magento/magento2.git cd magento2 sudo git checkout tags/2.2.1 -b 2.2.1 chown -R httpd:www /var/www/html/magento2/ sudo chmod -R 775 /var/www/html/magento2/ chmod 777 var/ generated/ app/etc/ pub/ composer install composer update composer config repositories.0 composer https://repo.magento.com php bin/magento setup:install --base-url=http://127.0.0.1/magento2/ --backend-frontname=admin \ --db-host=127.0.0.1 --db-name=mage2 --db-user=root --db-password=Root@123 \ --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com \ --admin-user=admin --admin-password=admin17 --language=en_US \ --currency=USD --timezone=America/Chicago --use-rewrites=1 php bin/magento sampledata:deploy php bin/magento setup:upgrade php bin/magento setup:static-content:deploy
Now check the site http://127.0.0.1/magento2/ .
Download Package
yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm -y
Install MySQL
yum install mysql-community-server -y
Start MySQL
service mysqld start service mysqld status
Generate Temporary password
grep 'temporary password' /var/log/mysqld.log
Login To MySQL
mysql -uroot -p
Reset Password and set Privilages
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Root@123'; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Root@123' WITH GRANT OPTION; FLUSH PRIVILEGES;
Open MySQL Port 3306
firewall-cmd --zone=public --add-port=3306/tcp --permanent firewall-cmd --reload firewall-cmd --list-all