Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

virtual host apache

# File: /etc/apache2/sites-available/domain1.com.conf

<VirtualHost *:80>

  # Server Name (domain name) and any aliases
  
  ServerName  domain1.com
  ServerAlias www.domain1.com
  
  #OPTIONAL Admin name
  ServerAdmin webmaster@domain1.com


  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html
  DocumentRoot /home/demo/public_html/domain1.com/public


  # Custom log file locations, OPTIONAL:
  LogLevel warn
  ErrorLog /var/log/apache2/error-mydomainname.com.log
  CustomLog /var/log/apache2/access-mydomainname.com.log combined

</VirtualHost>

# Enabling:
# sh ~ $
sudo a2ensite domain1.com # Refer to above ServerName!
# The utility may automatically suggest, but run:
sudo /etc/init.d/apache2 reload
# To restart apache!
Source by wiki.ubuntuusers.de #
 
PREVIOUS NEXT
Tagged: #virtual #host #apache
ADD COMMENT
Topic
Name
4+2 =