Advertisement
sohotcall

New Linux User, Apache Subdomain, MySQL User/DB

Aug 2nd, 2020 (edited)
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. #Saya buat linux user roland password ewv0w96v
  2. # adduser roland
  3.  
  4. #Saya buat folder www yang nanti akan diakses dari test.ejomplo.com
  5. # mkdir /home/roland/www
  6. # sudo usermod -a -G www-data roland
  7. # usermod -a -G www-data roland
  8. # chown -R roland:www-data /home/roland/www
  9. # chmod 750 /home/roland/www
  10. # chmod g+s /home/roland/www
  11. # setfacl -R -d -m u::rwX -m g::rX -m o::000 /home/roland/www
  12.  
  13. #Saya buat database test dengan user roland password ewv0w96v
  14. # mysql -u root -p
  15. > CREATE USER 'roland'@'localhost' IDENTIFIED BY 'ewv0w96v';
  16. > CREATE DATABASE test;
  17. > GRANT ALL PRIVILEGES ON test.* TO 'roland'@'localhost';
  18. > FLUSH PRIVILEGES;
  19.  
  20. #Saya buat host test.ejomplo.com mengakses folder www
  21. # nano /etc/apache2/sites-enabled/000-default.conf
  22. <VirtualHost *:80>
  23. DocumentRoot /home/roland/www
  24. ServerName test.ejomplo.com
  25. </VirtualHost>
  26.  
  27. # nano /etc/apache2/apache2.conf
  28. <Directory /home/roland/www/>
  29. Options Indexes FollowSymLinks
  30. AllowOverride None
  31. Require all granted
  32. </Directory>
  33.  
  34. #Saya mengintip php.ini
  35. # nano /etc/php/7.3/apache2/php.ini
  36. max_input_nesting_level = 4
  37. max_input_vars = 256
  38. memory_limit = 128M
  39. error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
  40. display_errors = On
  41. post_max_size = 128M
  42. upload_max_filesize = 128M
  43. max_file_uploads = 8
  44. date.timezone = Asia/Singapore
  45.  
  46. #Ready
  47. # service apache2 restart
  48.  
  49. #SSL
  50. # apt-get install certbot python-certbot-apache
  51. # certbot --apache
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement