You are on page 1of 7

#DISABLE SELINUX CENTOS7

1. vi /etc/selinux/config
SELINUX=disabled
2. reboot

#KONFIGURASI SSH CENTOS7

1. Pastikan SSH sudah terinstall


2. vi /etc/ssh/sshd_config
- Aktifkan Port 22
- Aktifkan MaxAuthTries dan MaxSessions ( Rubah sesuai dengan kebutuhan )
- Pastikan PermitRootLogin sudah Mati
- Tambahkan perintah AllowUsers ‘username’ dipaling bawah
3. systemctl restart sshd
4. firewall-cmd –permanent –add-port=22/tcp
firewall-cmd –reload

#KONFIGURASI VSFTD CENTOS7

1. Pastikan sudah terhubung ke Internet


2. Yum install vsftpd
3. vi /etc/vsftpd/vsftpd.conf
- Matikan anonymous_enable=YES
4. systemctl start vsftpd
systemctl enable vsftpd
5. firewall-cmd –permanent –add-port=21/tcp
firewall-cmd –reload
#PHP7.3 PHP-FPM CENTOS7

1. yum update
2. yum install epel-release
3. yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
4. vi /etc/yum.repos.d/remi-php73.repo
- [remi-php73]
- enabled=1
5. yum install php php-fpm
6. vi /etc/php.ini
- cgi.fix_pathinfo=1
- upload_max_filesize = 500M
- post_max_size = 500M
7. vi /etc/php-fpm.d/www.conf
- user = nginx
- group = nginx
- listen = 127.0.0.1:6000 ( Ubah Port sesuai keubutuhan )
8. systemctl start php-fpm ( akan terjadi error karena user/group nginx belum terinstall )
9. systemctl enable php-fpm
#NGINX CENTOS7

1. yum update
2. yum install epel-release
3. yum install nginx
4. systemctl start nginx
5. systemctl enable nginx
6. vi /etc/nginx/nginx.conf , hapus semua konfigurasi awalnya lalu copas conf dibawa taro di
nginx.conf

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

include /usr/share/nginx/modules/*.conf;

events {
worker_connections 1024;
}

http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;

include /etc/nginx/mime.types;
default_type application/octet-stream;

include /etc/nginx/conf.d/*.conf;
index index.php index.html index.htm;
client_max_body_size 100M;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
}

7. cd /home
8. mkdir web
9. chown -R usernamekalian:nginx /home/web
10. chmod +x -R /home/web
11. cd /etc/nginx/conf.d/
12. nano default.conf , copas conf dibawah

server {
listen 80;
server_name ipaddress;
root /home/web/;
location / {
index index.php index.html index.htm;
if (-f $request_filename) {
expires 30d;
break;
}
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:6000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

13. systemctl restart nginx


14. systemctl restart php-fpm
15. firewall-cmd –permanent –add-port=80/tcp
16. firewall-cmd –reload
17. cd /home/web
18. vi index.php , isi seperti ini
<?php
phpinfo();
?>
19. Buka alamat IP di browser, jika berhasil akan menampilkan phpinfo nya.
#POSTGRESQL-12 CENTOS7

1. yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/pgdg-


redhat-repo-latest.noarch.rpm
2. yum install postgresql12
3. yum install postgresql12-server
4. /usr/pgsql-12/bin/postgresql-12-setup initdb
5. systemctl start postgresql-12
systemctl enable postgresql-12
6. vi /var/lib/pgsql/12/data/pg_hba.conf , ikuti seperti dibawah
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all all md5
7. vi /var/lib/pgsql/12/data/postgresql.conf , ikuti seperti dibawah
listen_addresses = ‘*’
port = 5432
8. systemctl restart postgresql-12
9. firewall-cmd –permanent –add-port=5432/tcp
10. firewall-cmd –reload
11. su postgres
- createuser -P –interactive ( Isikan username dan password sesuai kebutuhan )
- Shall the new role be a superuser? (y/n) y
- exit

*Coba login menggunakan PgAdmin


#MARIADB 10.4 CENTOS7

1. yum install wget


2. cd /home
3. wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
4. chmod +x mariadb_repo_setup
5. ./mariadb_repo_setup
6. yum install MariaDB-server
7. systemctl start mariadb
8. systemctl enable mariadb
9. mysql_secure_installation
- Isi Password sesuai kebutuhan
- Switch to unix_socket authentication = n
- Change the root password = y
- Remove Anonymous users = y
- Disallow root login remotely = y
- Remove test database and access to it = n
- Reload privilege tables now = y
10. yum install phpmyadmin
11. cd /etc/nginx/conf.d
12. nano phpmyadmin.conf

server {
listen 8080;
root /usr/share/phpMyAdmin/;
include /etc/nginx/default.d/*.conf;
location / {
try_files $uri $uri/ /index.php?q=$request_uri; }
client_max_body_size 100M;
error_page 404 /404.html;
location = /40x.html {
root /usr/share/nginx/html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
root /usr/share/phpMyAdmin;
fastcgi_pass 127.0.0.1:6000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_read_timeout 500;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi_params;}
}
13. systemctl restart nginx
14. systemctl restart php-fpm
15. systemctl restart mariadb
16. firewall-cmd –permanent –add-port=8080/tcp
17. firewall-cmd –reload
18. chown -R nginx:nginx /var/lib/php/session/

*Coba login phpMyAdminnya, menggunakan alamat ipaddress:8080

You might also like