Advertisement
moemyintshein

Web Server Virtual Host Configuration

Feb 20th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. WebServer Virtual Host
  2. ------------------------
  3.  
  4. #mkdir /var/www/domain1.com
  5. #mkdir /var/www/domain1.com/public_html
  6. #mkdir /var/www/domain1.com/logs
  7. #touch /var/www/domain1.com/logs/error.log access.log
  8. #mkdir /var/www/domain2.com
  9. #mkdir /var/www/domain2.com/public_html
  10. #mkdir /var/www/domain2.com/logs
  11. #touch /var/www/domain2.com/logs/error.log access.log
  12. #vi /etc/httpd/conf.d/vhost.conf
  13.  
  14. <VirtualHost *:80>
  15. ServerName domain1.com
  16. ServerAlias www.domain1.com
  17. DocumentRoot /var/www/domain1.com/public_html/
  18. ErrorLog /var/www/domain1.com/logs/error.log
  19. TransferLog /var/www/domain1.com/logs/access.log
  20. </VirtualHost>
  21.  
  22. <VirtualHost *:80>
  23. ServerName domain2.com
  24. ServerAlias www.domain2.com
  25. DocumentRoot /var/www/domain2.com/public_html/
  26. ErrorLog /var/www/domain2.com/logs/error.log
  27. TransferLog /var/www/domain2.com/logs/access.log
  28. </VirtualHost>
  29.  
  30. #chown -R apache:apache domain1.com domain2.com
  31.  
  32. #restorecon -rv domain1.com domain2.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement