Login as root visa SSH.
Code: Select all
sudo mkdir -p /var/www/downloadnee.com/public_html
Code: Select all
sudo mkdir -p /var/www/youtubetoany.com/public_html
Code: Select all
sudo chmod -R 755 /var/www
Code: Select all
sudo chown -R www-data:www-data /var/www
Code: Select all
nano /var/www/downloadnee.com/public_html/index.html
Code: Select all
<html>
<head>
<title>Welcome to Downloadnee.com!</title>
</head>
<body>
<h1>Success! The downloadnee.com virtual host 1 is working!</h1>
</body>
</html>
Let's create a new file in youtubetoany.com.
Code: Select all
nano /var/www/youtubetoany.com/public_html/index.html
Code: Select all
<html>
<head>
<title>Welcome to Youtubetoany.com!</title>
</head>
<body>
<h1>Success! The Youtubetoany.com virtual host 2 is working!</h1>
</body>
</html>
Create the 1st Virtual Host File
Code: Select all
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/downloadnee.com.conf
Code: Select all
sudo nano /etc/apache2/sites-available/downloadnee.com.conf
Code: Select all
<VirtualHost *:80>
ServerName downloadnee.com
ServerAlias www.downloadnee.com
ServerAdmin [email protected]
DocumentRoot /var/www/downloadnee.com/public_html
<Directory /var/www/downloadnee.com/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Create the 2nd Virtual Host File
Code: Select all
sudo cp /etc/apache2/sites-available/downloadnee.com.conf /etc/apache2/sites-available/youtubetoany.com.conf
Code: Select all
sudo nano /etc/apache2/sites-available/youtubetoany.com.conf
Code: Select all
<VirtualHost *:80>
ServerName youtubetoany.com
ServerAlias www.youtubetoany.com
ServerAdmin [email protected]
DocumentRoot /var/www/youtubetoany.com/public_html
<Directory /var/www/youtubetoany.com/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Disable the default site which is defined in 000-default.conf:
Code: Select all
sudo a2dissite 000-default.conf
Code: Select all
sudo a2ensite downloadnee.com.conf
Code: Select all
sudo a2ensite youtubetoany.com.conf
Code: Select all
service apache2 reload
http://downloadnee.com
and
http://youtubetoany.com