Just setup an apache webserver with the following virtualhost:
Code:
<VirtualHost 123.45.67.89:80>
ServerAdmin admin@mysite.com
ServerName mysite.com
ServerAlias www.mysite.com
DocumentRoot /srv/www/mysite.com/public_html
ErrorLog /srv/www/mysite.com/logs/error.log
CustomLog /srv/www/mysite.com/logs/access.log combined
</VirtualHost>
And the I disabled the default virtualhost and enable mine:
> a2dissite default
> a2ensite mysite.com
Reload:
> /etc/init.d/apache2 reload
My /etc/hosts is as follow:
Code:
127.0.0.1 localhost.localdomain localhost
123.45.67.89 myhost.mysite.com myhost
And then I tested by accessing
http://mysite.com and
http://www.mysite.com, everything works fine.
The problem is, everytime I reboot my box, I can no longer access my site anymore.
Doesn't work with
http://mysite.com and
http://www.mysite.com.
The only way I can make it work again is by issuing
/etc/init.d/apache2 reload everytime after rebooting.
This happens all time time everytime I reboot (tried it multiple times in the past 2 days).
Any suggestions?
Thanks in advance.