Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: a2ensite problem?
PostPosted: Sat Nov 09, 2013 9:16 pm 
Offline
Senior Newbie

Joined: Sat Nov 09, 2013 9:07 pm
Posts: 10
i hit a snag pretty early one while following this guide:

https://library.linode.com/lamp-guides/ ... e-pangolin

at this part:

Quote:
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:

Code:
<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?


Top
   
 Post subject: Re: a2ensite problem?
PostPosted: Sun Nov 10, 2013 12:10 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Is the virtual host configuration in a file named /etc/apache2/sites-available/squattheplanet.com? (Make sure you don't have any typos in the name.) That's what the a2ensite command is looking for.

If you think you have things correct, run the following command and post the output so we can see what might be going on.
Code:
ls -l /etc/apache2/sites-available


Top
   
 Post subject: Re: a2ensite problem?
PostPosted: Sun Nov 10, 2013 12:28 am 
Offline
Senior Newbie

Joined: Sat Nov 09, 2013 9:07 pm
Posts: 10
Image

i think i got it spelled right, i coulda sworn i triple checked it.


Top
   
 Post subject: Re: a2ensite problem?
PostPosted: Sun Nov 10, 2013 8:39 am 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
What happens when you cat the file name? Does it display the contents?

Is it possible that there's a trailing blank on the file name?


Top
   
 Post subject: Re: a2ensite problem?
PostPosted: Sun Nov 10, 2013 2:56 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
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:
Code:
ln -sv /etc/apache2/sites-{available,enabled}/squattheplanet.com
apache2ctl restart


Top
   
 Post subject: Re: a2ensite problem?
PostPosted: Sun Nov 10, 2013 3:19 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
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).

_________________
Either provide enough details for people to help, or sit back and listen to the crickets chirp.
Security thru obscurity is a myth - and really really annoying.


Top
   
 Post subject: Re: a2ensite problem?
PostPosted: Sun Nov 10, 2013 6:23 pm 
Offline
Senior Newbie

Joined: Sat Nov 09, 2013 9:07 pm
Posts: 10
Main Street James wrote:
What happens when you cat the file name? Does it display the contents?


Image


Top
   
 Post subject: Re: a2ensite problem?
PostPosted: Sun Nov 10, 2013 6:32 pm 
Offline
Senior Newbie

Joined: Sat Nov 09, 2013 9:07 pm
Posts: 10
Vance wrote:
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:
Code:
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:

Image

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:

Image

not sure if that's okay?


Top
   
 Post subject: Re: a2ensite problem?
PostPosted: Mon Nov 11, 2013 12:08 am 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
I think vonskippy is right.

- 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


Top
   
 Post subject: Re: a2ensite problem?
PostPosted: Mon Nov 11, 2013 5:20 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
This is what ls -lb would show for a file named "foo " with a space at the end of the name:
Code:
-rw-r--r-- 1 vance vance      0 Nov 11 16:10 foo\ 


That warning from Apache is nothing to worry about. Visiting www.squattheplanet.com seems to work so Apache is now using that configuration even though a2ensite doesn't like it.

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.


Top
   
 Post subject: Re: a2ensite problem?
PostPosted: Mon Nov 11, 2013 10:44 pm 
Offline
Senior Newbie

Joined: Sat Nov 09, 2013 9:07 pm
Posts: 10
hmm, well im not sure what the issue was, but i actually ended up using nginx instead, and got myself set up in about 2 hours. so far everything is working great, and i'm pretty stoked about using linode. thanks for your help!


Top
   
 Post subject: Re: a2ensite problem?
PostPosted: Tue Nov 12, 2013 12:30 am 
Offline
Senior Member
User avatar

Joined: Wed Jun 26, 2013 1:53 am
Posts: 118
vonskippy wrote:
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.

_________________
Homepage www.sturmkrieg.com
Social network Gamernet
Development website Sashaweb Development
Imageboard img.sturmkrieg.com
WikiHub free wiki host Community Wiki


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group