sohotcall

Windows Subsystem for Linux Debian Apache-MySQL-PHP

Jun 1st, 2020
153
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sudo apt update
  2. sudo apt upgrade
  3.  
  4. # Install apache, php, mysql
  5. sudo apt install apache2
  6. sudo apt install libapache2-mod-php php php-curl php-gd php-mbstring
  7. sudo apt install php-mysql php-xml php-sqlite3 php-zip php-soap
  8. sudo apt install mariadb-server
  9. sudo service apache2 restart
  10. sudo service mysql restart
  11.  
  12. # Enabling apache rewrite module
  13. sudo a2enmod rewrite
  14.  
  15. # I want to change apache port
  16. sudo nano /etc/apache2/apache2.conf
  17. sudo nano /etc/apache2/ports.conf
  18. sudo service apache2 start
  19.  
  20. # Change php config
  21. sudo cp /etc/php/7.3/apache2/php.ini /etc/php/7.3/apache2/php.ini.bak
  22. sudo nano /etc/php/7.3/apache2/php.ini
  23. # max_execution_time = 180
  24. # max_input_nesting_level = 8
  25. # max_input_vars = 64
  26. # memory_limit = 512M
  27. # error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
  28. # log_errors = Off
  29. # display_errors = On
  30. # post_max_size = 512M
  31. # upload_max_filesize = 512M
  32. # max_file_uploads = 8
  33. # date.timezone = Asia/Singapore
  34. sudo service apache2 restart
  35.  
  36. # I want to change mysql port
  37. sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
  38. sudo service mysql restart
  39.  
  40. # Make /var/www/html mine, but apache (group www-data) able to read it
  41. sudo usermod -a -G www-data $USER
  42. sudo chown -R $USER:www-data /var/www/html
  43. sudo chmod 750 /var/www/html
  44.  
  45. # Future dirs and files inside it, too
  46. sudo apt install acl
  47. sudo chmod g+s /var/www/html
  48. sudo setfacl -R -d -m u::rwX -m g::rX -m o::000 /var/www/html
  49.  
  50. # MySQL
  51. sudo mysql -u root -p
  52. # CREATE USER 'gungsukma'@'localhost' IDENTIFIED BY 'piag311w';
  53. # GRANT ALL PRIVILEGES ON *.* TO 'gungsukma'@'localhost' WITH GRANT OPTION;
  54. # FLUSH PRIVILEGES;
  55.  
  56. # SSHD
  57. sudo apt install openssh-server
  58.  
  59. # Change sshd port
  60. sudo nano /etc/ssh/sshd_config
  61. sudo service ssh --full-restart
  62.  
  63. # Softlink to /var/www/html in my home dir
  64. ln -s /var/www/html ~/www
RAW Paste Data