mqnoy

[LINUX] HOW TO CREATE AND CONFIG OWN

Dec 5th, 2017
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.90 KB | None | 0 0
  1. url : tuts.local
  2. folder site : /home/qnoy/tuts
  3.  
  4.  
  5. 1.enter directory site config apache2 on sites-available
  6. cd /etc/apache2/sites-available/
  7.  
  8. 2.copy default config to something like host.domain.conf ex: tuts.local.conf
  9. cp 000-default.conf tuts.local.conf
  10.  
  11. 3. edit this config file "tuts.local.conf"
  12. nano tuts.local.conf
  13.  
  14. 4. put the script below or u can change like this
  15.  
  16. #[script tuts.local.conf ]
  17. <VirtualHost tuts.local:80> #<- url site:port
  18.         ServerName tuts.local #<- url site
  19.         ServerAdmin webmaster@localhost #<- email info signature site
  20.         DocumentRoot /home/qnoy/tuts #<- location root site folder
  21.         ErrorLog ${APACHE_LOG_DIR}/error_tuts.local.log #<- error log file after edit with site name
  22.         CustomLog ${APACHE_LOG_DIR}/access_tuts.local.log combined #<- access log file after edit with site name
  23. </VirtualHost>
  24.  
  25. #[end script tuts.local.conf ]
  26.  
  27. 5. back [command : ..] or enter to dir apache2
  28. cd /etc/apache2/
  29.  
  30. 6.edit file apache2.conf
  31. nano apache2.conf
  32.  
  33. 7.search like "Directory /var/www"
  34.  
  35. #[looks like]
  36. <Directory /var/www/>
  37.         Options Indexes FollowSymLinks
  38.         AllowOverride None
  39.         Require all granted
  40. </Directory> #this is
  41. #[end]
  42.  
  43. 8.put the script below after "#this is (look above)"
  44.  
  45.  
  46. <Directory /home/qnoy/tuts>
  47.         Options Indexes FollowSymLinks
  48.         AllowOverride all
  49.         Require all granted
  50. </Directory>
  51.  
  52.  
  53. description :
  54. /home/qnoy/tuts  = location root site folder
  55.  
  56.  
  57. 9.edit file "hosts" on /etc/hosts
  58. nano /etc/hosts
  59.  
  60. 10. enter directory site config apache2 again
  61. cd /etc/apache2/sites-available/
  62.  
  63. 11. enable this site with command "a2ensite file_config.config"
  64. a2ensite tuts.local.conf
  65.  
  66. 12. restart or reload apache2
  67.  /etc/init.d/apache2 restart
  68.  
  69. 13 . optional
  70. chown -R qnoy:www-data /home/qnoy/tuts
  71. chmod -R 775 /home/qnoy/tuts
  72.  
  73.  
  74. 13. open internet browser type
  75. tuts.local/
Advertisement
Add Comment
Please, Sign In to add comment