My /etc/hosts
:
107.170.137.119 www.usama-ahmed.tk usama-ahmed.tk
107.170.137.119 www.projects-usama-ahmed.tk projects-usama-ahmed.tk
When I comment the first line, it properly loads the projects-usama-ahmed.tk and vice versa.
I also edited /etc/apache2/apache2.conf
:
HostnameLookups On
usama.conf
:<VirtualHost www.usama-ahmed.tk:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/usama
ServerName www.usama-ahmed.tk
ServerAlias usama-ahmed.tk
ErrorLog /var/www/html/usama/logs/error.log
LogLevel warn
CustomLog /var/www/html/usama/logs/access.log combined
<Directory /var/www/html/usama>
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
projects.conf
:<VirtualHost www.projects-usama-ahmed.tk:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/projects
ServerName www.projects-usama-ahmed.tk
ServerAlias projects-usama-ahmed.tk
ErrorLog /var/www/html/projects/logs/error.log
LogLevel warn
CustomLog /var/www/html/projects/logs/access.log combined
<Directory /var/www/html/projects>
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
Can anyone give any solution please?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
i found a solution after so many days first you make sure the you direction the domain to the NS of digital ocean.
2- in etc/hosts <pre> 127.0.0.1 domain.com 127.0.0.1 domain2.com </pre>
3- in the apache2.conf <pre> NameVirtualHost *:80 </pre> 4- sites-available <pre> <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/yourdomain ServerName http://www.yourdomain.com ServerAlias yourdomain.com <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /var/www/yourdomain> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory>
</VirtualHost> </pre> 5- enable yourdomain <pre> a2ensite yourdomain.com </pre> 6- <pre> service apache2 restart </pre>