Hi,
Steps below works fine if I have only one folder(site) in /var/www/http/ but when I add another (folder)site into /var/www/http/ and repeat same steps just by changing the name of the (folder)site, it retrieves the previous site even if I enter the second one.
e.g. myhost1.com and myhost2.com display the content of myhost1.com
How can I enable second one?
Thanks in advance
mycomputer@ubuntu:~$ sudo mkdir /var/www/http/myhost1.com
mycomputer@ubuntu:~$ sudo gedit /var/www/http/myhost1.com/index.php
(Add this line to the file:)
<?php
echo "This is myhost1.com";
?>
mycomputer@ubuntu:~$ sudo gedit /etc/apache2/apache2.conf
(Add this line to the file:)
Include sites-enabled/
mycomputer@ubuntu:~$ sudo gedit /etc/apache2/sites-available/myhost1.com.conf
(Add these lines to the file:)
<VirtualHost myhost1.com>
ServerAdmin webmaster@localhost
#We want to be able to access the web site using myhost1.com or www.myhost1.com
ServerAlias www.myhost1.com
DocumentRoot /var/www/http/myhost1.com
#If using awstats
ScriptAlias /awstats/ /usr/lib/cgi-bin/
#We want specific log file for this server
CustomLog /var/log/apache2/myhost1.com-access.log combined
</VirtualHost>
mycomputer@ubuntu:~$ sudo ln -s /etc/apache2/sites-available/myhost1.com.conf /etc/apache2/sites-enabled/myhost1.com.conf
mycomputer@ubuntu:~$ sudo gedit /etc/hosts
(Add these lines to the file:)
127.0.0.1 localhost.localdomain localhost myhost1.com www.myhost1.com
mycomputer@ubuntu:~$ sudo /etc/init.d/apache2 reload
mycomputer@ubuntu:~$ sudo a2ensite myhost1.com.conf