Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samsulmaarif/5d2ac689a8ecbeec5d645a0dc7e7ebdc to your computer and use it in GitHub Desktop.
Save samsulmaarif/5d2ac689a8ecbeec5d645a0dc7e7ebdc to your computer and use it in GitHub Desktop.
[root@VDCPLXAPMAP01 nginx]# cat /etc/*release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.8 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.8"
PRETTY_NAME="Red Hat Enterprise Linux"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.8:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.8
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.8"
Red Hat Enterprise Linux Server release 7.8 (Maipo)
Red Hat Enterprise Linux Server release 7.8 (Maipo)
[root@VDCPLXAPMAP01 nginx]# uname -a
Linux VDCPLXAPMAP01 3.10.0-1127.el7.x86_64 #1 SMP Tue Feb 18 16:39:12 EST 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@VDCPLXAPMAP01 nginx]#
wget https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-13.noarch.rpm
rpm -ivh epel-release-7-13.noarch.rpm
vi /etc/yum.repos.d/centos.repo
```
[centos]
name=CentOS $releasever - $basearch
baseurl=http://ftp.heanet.ie/pub/centos/7/os/$basearch/
enabled=1
gpgcheck=0
```
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum install php73-php-{devel,fpm,fpm,gd,json,mbstring,mcrypt,mysqlnd,odbc,pdo,process,soap,xml,xmlrpc,cli,pear}
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo
yum remove unixODBC-utf16 unixODBC-utf16-devel
ACCEPT_EULA=Y yum install -y msodbcsql17
ACCEPT_EULA=Y yum install -y mssql-tools
yum install -y unixODBC-devel
yum install re2c gcc-c++ gcc
. /opt/remi/php73/enable
vim /etc/profile.d/php.sh
```
. /opt/remi/php73/enable
```
vim /opt/remi/php73/enable
```
export PATH=/opt/remi/php73/root/usr/bin:/opt/remi/php73/root/usr/sbin${PATH:+:${PATH}}:/opt/mssql-tools/bin
export LD_LIBRARY_PATH=/opt/remi/php73/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export MANPATH=/opt/remi/php73/root/usr/share/man:${MANPATH}
```
pecl install sqlsrv
pecl install pdo_sqlsrv
vim /etc/opt/remi/php73/php.d/30-sqlsrv.ini
```
extension=sqlsrv.so
extension=pdo_sqlsrv.so
```
cd /etc/opt/remi/php73/
cp php-fpm.d/{www,userapps}.conf
vim php-fpm.d/userapps.conf
```
[userapps]
user = userapps
group = userapps
listen = /run/php73/php7.3-userapps.sock
listen.owner = userapps
listen.group = userapps
```
mkdir /run/php73/
systemctl enable php73-php-fpm.service
systemctl start php73-php-fpm.service
systemctl status php73-php-fpm.service
cd /etc/nginx/
vim nginx.conf
## hapus block server{}
## tambahkan
```
user nginx userapps;
```
vim conf.d/default.conf
```
server {
listen 80 default_server;
server_name _;
root /home/userapps/monitoring/public;
error_log /var/log/nginx/monitoring-error.log;
access_log /var/log/nginx/monitoring-access.log;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php73/php7.3-userapps.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
allow all;
expires max;
try_files $uri $uri/ /$args;
}
}
```
systemctl enable nginx
systemctl start nginx
systemctl status nginx
firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --permanent --zone=public --add-port=9000/tcp
firewall-cmd --reload
# browser -> http://192.168.29.66
## debugging
tail -f -n 50 /var/log/nginx/monitoring-*.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment