Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Jul 06, 2013 6:41 pm 
Offline
Senior Newbie

Joined: Sat Jul 06, 2013 6:27 pm
Posts: 9
Hi there,

I have the following situation:

1. My domain name is managed by a registrar in my country. The only thing I use them for is IP Forwarding. So I logged into their control panel and created a subdomain.domain.com and then entered the IP number of my Linode instance in the A-Record.

2. Then on my Linode instance, I created a new subdomain in /etc/apache2/subdomain.domain.com by creating a new VirtualHost. The document root is located at ~/public/subdomain.domain.com/public

Problem:

When I try to call up subdomain.domain.com in the browser I get a page that says:

Quote:
Forbidden

You don't have permission to access / on this server.


However, this page does not appear to be on my Linode instance! It appears to be a page on some server belonging to my registrar (I do not use their hosting, only IP Forwarding).

Any idea what I could be doing wrong?

Thanks.


Top
   
PostPosted: Sat Jul 06, 2013 7:09 pm 
Offline
Senior Member
User avatar

Joined: Thu Jun 16, 2011 8:24 am
Posts: 412
Location: Cyberspace
Chances are it is pointing to your Linode and apache is just telling you it doesn't have permission to access it. Can you show the output of:

Code:
$ ls -lh ~/public/subdomain.domain.com/public


That will show a listing of files, as well as permissions (represented by the letters r(ead), w(rite), and x(ecute), and user/group ownership.

Either the user or group (or both) should be set to the user that Apache uses, and that user or group needs (at a minimum) read and execute permission for all directories it needs access to, and read permissions for all files it needs.

_________________
Kris the Piki Geeker


Top
   
PostPosted: Sun Jul 07, 2013 3:53 pm 
Offline
Senior Newbie

Joined: Sat Jul 06, 2013 6:27 pm
Posts: 9
Here is the output:

mope@ubuntu:~/public$ ls -lh subdomain.domain.com
total 12K
drwxrwxr-x 2 mope mope 4.0K Jul 6 00:01 backup
drwxrwxr-x 2 mope mope 4.0K Jul 6 00:07 logs
drwxrwxr-x 12 mope mope 4.0K Jul 6 23:59 public


Top
   
PostPosted: Sun Jul 07, 2013 4:59 pm 
Offline
Junior Member

Joined: Sun Jun 24, 2012 4:27 pm
Posts: 29
What makes you sure that the page returned isn't on your server?

What are the permissions of all the parent directories?

Is DocumentRoot literally ~/public/subdomain.domain.com/public? ~ is short hand for the current user's home directory, and your webserver will be running as a user that is not "mope".

Also, please don't redact, it helps us cross-check a few things, including that your a record is set properly.


Top
   
PostPosted: Mon Jul 08, 2013 4:51 pm 
Offline
Senior Newbie

Joined: Sat Jul 06, 2013 6:27 pm
Posts: 9
bacon wrote:
What makes you sure that the page returned isn't on your server?


Because the page that is appearing contains an iFrame with an unknown (to me) source IP.

bacon wrote:
What are the permissions of all the parent directories?


mope@ubuntu:~$ ls -lh public
total 8.0K
drwxrwxr-x 5 mope mope 4.0K Jun 9 21:51 domain.com
drwxrwxr-x 5 mope mope 4.0K Jul 6 11:23 subdomain.domain.com

bacon wrote:
Is DocumentRoot literally ~/public/subdomain.domain.com/public? ~ is short hand for the current user's home directory, and your webserver will be running as a user that is not "mope".


I am not using the short hand in my VirtualHost file, instead I am using this: /home/mope/public/subdomain.domain.com/public

(But mind you I have this very same set up for domain.com and everything is working fine)


Top
   
PostPosted: Mon Jul 08, 2013 5:18 pm 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
I realize this is a stupid question, but since everything seems to be configured the same and both sites should be displaying: did you restart the apache service?

What do your logs say?


Top
   
PostPosted: Tue Jul 09, 2013 8:04 am 
Offline
Senior Newbie

Joined: Sat Jul 06, 2013 6:27 pm
Posts: 9
Main Street James wrote:
I realize this is a stupid question, but since everything seems to be configured the same and both sites should be displaying: did you restart the apache service?


Yup restarted several times since making the changes :)

Main Street James wrote:
What do your logs say?


I will have a look at the logs later today.

One strange thing I just noticed is that if I try to visit subdomain.domain.com from the office I still get the 403 page, but without the iframe page I see at home?? No idea what that means.


Top
   
PostPosted: Tue Jul 09, 2013 8:12 am 
Offline
Senior Newbie

Joined: Sat Jul 06, 2013 6:27 pm
Posts: 9
One other thing I just realized, in my VirtualHost file for my subdomain I have for both ServerName and ServerAlias: subdomain.domain.com

Because looking at some examples online, I see for example this setup: ServerName: subdomain.domain.com and ServerAlias www.domain.com

Could this be issue? (Can't check it right now).


Top
   
PostPosted: Tue Jul 09, 2013 12:30 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
When I click on your links (www.domain.com and subdomain.domain.com) both of them resolve to a web page.

So what exactly is the problem again???

_________________
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
   
PostPosted: Tue Jul 09, 2013 1:48 pm 
Offline
Senior Newbie

Joined: Sat Jul 06, 2013 6:27 pm
Posts: 9
vonskippy wrote:
When I click on your links (http://www.domain.com and subdomain.domain.com) both of them resolve to a web page.

So what exactly is the problem again???


These are obviously examples.


Top
   
PostPosted: Tue Jul 09, 2013 2:00 pm 
Offline
Senior Newbie

Joined: Sat Jul 06, 2013 6:27 pm
Posts: 9
When I view subdomain.domain.com from my iPhone it works and I can see the site hosted on the sub domain. But when I view it from my computer, I get a 403??


Top
   
PostPosted: Tue Jul 09, 2013 2:22 pm 
Offline
Senior Newbie

Joined: Sat Jul 06, 2013 6:27 pm
Posts: 9
I finally figured it out.

Under domain.com I have an .htaccess file forcing HTTPS.

Under subdomain.domain.com I have a Piwik installation and that doesn't seem to like this and was throwing a 403.

I disabled the .htaccess for now and I can access subdomain.domain.com


Top
   
PostPosted: Tue Jul 09, 2013 3:51 pm 
Offline
Senior Member

Joined: Wed Oct 20, 2010 12:11 pm
Posts: 142
In the future, please don't redact information - it impedes us helping you.


Top
   
PostPosted: Tue Jul 09, 2013 8:50 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Mope wrote:
These are obviously examples.

No, they're obvious TIME WASTERS.

Domain names by their nature are PUBLIC, so hiding them makes zero sense.

_________________
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
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


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