This question already has an answer here:
- Apache not starting 2 answers
My Task :
www.mynewsite.lk is configured and hosted in a hosting server with the IP address
192.168.1.100. Another domain called
www.mysite.lk should also be configured with the same content without any duplication. Here I want to configure the Apache server with name-based virtual hosting.
First of all I Created directory which contains the file of my site and add 'home.html' file.
sudo mkdir /var/www/website sudo vim /var/www/website/home.html
After I created new virtual host file as
/etc/apache2/sites-available folder and it is look like
<VirtualHost 192.168.1.100> ServerAdmin email@example.com DocumentRoot /var/www/website DirectoryIndex home.html ServerName www.mynewsite.lk Serveralias www.mysite.lk ErrorLog /var/log/error/website/error.log CustomLog combined </VirtualHost>
Next I created directories to hold 'Error.log'
sudo mkdir /var/log/error sudo mkdir /var/log/error/website
Then I set the DNS using
sudo vim /etc/hosts and I added following line that file
192.168.1.100 www.mysite.lk www.mynewsite.lk
After I enabled the
default.conf file that I created using
sudo a2ensite default.conf command
Then I run the this command
sudo ifconfig vmnet0: 192.168.1.100 netmask 255.255.255.0 up
And last I reloaded the apache server using
sudo /etc/init.d/apache2 reload command
I had an error as Job for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -xn' for details.
what do I do to make this error...? Please help me to complete my task.
Is there an any error I created .conf