a2ensite problem?
at this part:
> After you've set up your virtual hosts, issue the following commands:
a2ensite example.com
a2ensite example.org
when i do this i get ERROR: site squattheplanet.com does not exist! my input is like so:
a2ensite squattheplanet.com
i'm trying to learn how to do this in virtualbox before signing up with linode.
my virtual hosts looks like:
<virtualhost *:80="">ServerAdmin webmaster@squattheplanet.com
ServerName squattheplanet.com
ServerAlias www.squattheplanet.com
DocumentRoot /srv/www/squattheplanet.com/public_html/
ErrorLog /srv/www/squattheplanet.com/logs/error.log
CustomLog /srv/www/squattheplanet.com/logs/access.log combined</virtualhost>
can anyone tell me what i'm doing wrong?
11 Replies
If you think you have things correct, run the following command and post the output so we can see what might be going on.
ls -l /etc/apache2/sites-available
i think i got it spelled right, i coulda sworn i triple checked it.~~
Is it possible that there's a trailing blank on the file name?
You could also try enabling it manually. The a2ensite command just creates a link from /etc/apache2/sites-enabled to /etc/apache2/sites-available. The following commands will create the link and reload Apache:
ln -sv /etc/apache2/sites-{available,enabled}/squattheplanet.com
apache2ctl restart
Doing a quick google seems to point to something like that (but I really didn't double check to see if that was old info or what).
@Main Street James:
What happens when you cat the file name? Does it display the contents?
![](
@Vance:
Hmm, that is odd. James has one possibility; adding the -b option to ls should indicate any unusual characters with backslashes (ls -lb /etc/apache2/sites-available).
You could also try enabling it manually. The a2ensite command just creates a link from /etc/apache2/sites-enabled to /etc/apache2/sites-available. The following commands will create the link and reload Apache:
ln -sv /etc/apache2/sites-{available,enabled}/squattheplanet.com apache2ctl restart
not sure how the unusual characters would be indicated? it looked pretty similar to a regular ls -al:
~~![](<URL url=)
although i do see a 'total 24' with ls -al and a 'total 16' with ls -lb.
using your command above to link the two here's what i got:
~~![](<URL url=)
not sure if that's okay?~~~~
remove the symbolic link from sites-available/squattheplanet.com to sites-enabled/squattheplanet.com
change the name of sites-available/squattheplanet.com to sites-available/squattheplanet.com.conf
run a2ensite squattheplanet.com
-rw-r--r-- 1 vance vance 0 Nov 11 16:10 foo\
That warning from Apache is nothing to worry about. Visiting
As noted earlier, it's possible that your version of a2ensite requires ".conf" at the end of the name, although an older Ubuntu version does not. Just running a2ensite with no arguments should list the sites it thinks are available.
@vonskippy:
Not a Debian/Ubuntu/Apache2 user, but wasn't there something about the sites-enable files MUST end in .conf
Doing a quick google seems to point to something like that (but I really didn't double check to see if that was old info or what).
None of our virtual host files end with .conf. They all match their respective domains.