Advertisement
niammuddin

Add VirtualHost Nginx

Jan 13th, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. ######### Step One— Create a New Directory ##########
  2. sudo mkdir -p /usr/share/nginx/html/domain.com/public_html
  3.  
  4. ######## Step Two—Grant Permissions #########
  5. sudo chown -R www-data:www-data /usr/share/nginx/html/domain.com/public_html
  6.  
  7. ########### supaya bisa dibaca ###########
  8. sudo chmod 755 /usr/share/nginx/html
  9.  
  10. ############# tes ################
  11. sudo nano /usr/share/nginx/html/domain.com/public_html/index.html
  12.  
  13. <html>
  14. <head>
  15. <title>www.example.com</title>
  16. </head>
  17. <body>
  18. <h1>Success: You Have Set Up a Virtual Host</h1>
  19. </body>
  20. </html>
  21.  
  22. ######### Step Four—Create the New Virtual Host File ###########
  23. sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/domain.com
  24. sudo nano /etc/nginx/sites-available/domain.com
  25.  
  26. edit sesuai keinginan
  27.  
  28. ####### aktivasi virtualhost #########
  29. sudo ln -s /etc/nginx/sites-available/domain.com /etc/nginx/sites-enabled/domain.com
  30.  
  31. restart
  32. sudo service nginx restart
  33.  
  34. related: http://pastebin.com/bYGZ7q2y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement