- CentOS/RHEL 6.10
- PHP 7.1 (not compatible with PHP 7.2 or above)
- MySql 8.0
- Apache: 80, 433
- MySql: 3306
- Root folder: /var/www/html
- Database name: stech_smartads
- Database user: stech_smartads /
sudo yum install epel-release yum-utils -y
sudo yum –y update
sudo yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
sudo yum install -y --enablerepo=remi-php71 php php-cli
sudo yum install -y --enablerepo=remi-php71 php-mysqlnd php-dom php-simplexml php-ssh2 php-xml php-xmlreader php-curl php-date php-exif php-filter php-ftp php-gd php-hash php-iconv php-imagick php-json php-libxml php-mbstring php70w-opcache php-openssl php-pcre php-posix php-sockets php-spl php-tokenizer php-zlib
sudo yum install httpd -y
sudo systemctl status httpd
sudo systemctl start httpd.service
sudo systemctl enable httpd.service
sudo systemctl restart httpd.service
sudo vim /etc/httpd/conf/httpd.conf Find tag /var/www/html Set AllowOverride All
sudo yum install mariadb-server mariadb
sudo systemctl start mariadb
03. Setup password for root user. Default password is blank, just press . Select if you want to set password.
sudo mysql_secure_installation
cd /var/www/html/
sudo git clone https://gitlab.com/mozasolution/SmartAds-Stech-PHP.git
02. Install PhpMyadmin: https://www.phpmyadmin.net/
sudo yum -y install phpmyadmin
mysql -u root -p
mysql> CREATE DATABASE stech_smartads;
mysql> CREATE USER 'stech_smartads'@'localhost' IDENTIFIED BY 'newpass';
mysql> GRANT ALL PRIVILEGES ON stech_smartads.* TO 'stech_smartads'@'localhost' IDENTIFIED BY 'newpass';
mysql> USE stech_smartads;
mysql> SOURCE /var/www/html/backend/applications/smartads-stech-php/setup/all.sql
- Make sure the application folder is: smartads-stech-php (required) The admin url must be like this: http://ip:port/smartads-stech-php/backend/web/index.php
- Change config files: /config/main-local.php --> main.php, /config/global-local.php --> global.php
- in main.php, make sure 'db' => 'stech_smartads' db.
- cd smartads-stech-php
- setenforce 0
- chown -R apache backend/web/assets
- chown -R apache backend/runtime
- chmod -R 775 backend/runtime
- chmod -R 775 backend/web/assets
- chmod -R 775 applications/smartads/upload
sudo yum install redis
sudo systemctl start redis
sudo systemctl enable redis
sudo systemctl status redis
04. Config Redis to accept remote connections open the Redis configuration file with your text editor:
sudo nano /etc/redis.conf
05. Locate the line that begins with bind 127.0.0.1 and add your server private IP address after 127.0.0.1.
bind 127.0.0.1 [Your server private IP address]
sudo systemctl restart redis
ss -an | grep 6379
08. Assuming you are using FirewallD to manage your firewall and you want to allow access from the 192.168.121.0/24 subnet you would run the following commands:
sudo firewall-cmd --new-zone=redis --permanent
sudo firewall-cmd --zone=redis --add-port=6379/tcp --permanent
sudo firewall-cmd --zone=redis --add-source=192.168.121.0/24 --permanent
sudo firewall-cmd --reload
'session' => ['class' => 'yii\redis\Session' ],