Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[ Solved ] You don't have permission to access server.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
CurtE
Guru
Guru


Joined: 17 Apr 2004
Posts: 364
Location: Minneapolis, MN

PostPosted: Sun Oct 03, 2010 4:25 pm    Post subject: [ Solved ] You don't have permission to access server. Reply with quote

Okay. It's been a long time and I know this is a common error in Apache.

After struggling with my 2nd server, I wiped out all of Apache2 and started from scratch. I have a fresh install and going to http://70.89.201.9/ produces the right answer.

Then I added to /etc/apache2/modules.d/00_default_settings.conf

Code:
<Directory "/var/www/curt">
   Options -All -Multiviews
   <IfModule mod_access.c>
      Order allow,deny
      Allow from all
   </IfModule>
</Directory>


After trying to access http://70.89.201.9/curt and, obviously, not getting the results I expected, I kept searching. Someone said that /etc/apache2/vhosts.d/00_default_vhost.conf is used to redirect even if you are not virtual hosting. I proceeded to add:

Code:
<VirtualHost *:80>
  ServerName curt
  ServerAlias curt

  <Directory "/var/www/curt/">
    Allow from all
  </Directory>

  ServerPath /var/www/curt
  DocumentRoot /var/www/curt
</VirtualHost>


I'm still not getting to my test site, so what have I missed?


ADDON: Would any of this be caused by my ZONE records?


Last edited by CurtE on Tue Mar 29, 2011 3:07 am; edited 2 times in total
Back to top
View user's profile Send private message
chiefbag
Guru
Guru


Joined: 01 Oct 2010
Posts: 542
Location: The Kingdom

PostPosted: Sun Oct 03, 2010 4:36 pm    Post subject: Reply with quote

Why don't you just use the default config since it looks like you only want to run one site on this instance.
Delete your /etc/apache2 directory and re emerge apache again.
Then place your website under /var/www/localhost/htdocs directory
Back to top
View user's profile Send private message
CurtE
Guru
Guru


Joined: 17 Apr 2004
Posts: 364
Location: Minneapolis, MN

PostPosted: Sun Oct 03, 2010 4:54 pm    Post subject: Reply with quote

I'm taking baby steps to get it working on the 2nd server. Eventually, I will be using the server for virtual hosting as I do with the first server.
Back to top
View user's profile Send private message
chiefbag
Guru
Guru


Joined: 01 Oct 2010
Posts: 542
Location: The Kingdom

PostPosted: Sun Oct 03, 2010 5:09 pm    Post subject: Reply with quote

You should not add the directory settings under the modules rather the default_vhost.include file.
You can use the Alias command above the <directory> statement to direct to separate locations if you do not wish to use full vhost config which will only be useful if you are resolving to the server using dns names
Back to top
View user's profile Send private message
CurtE
Guru
Guru


Joined: 17 Apr 2004
Posts: 364
Location: Minneapolis, MN

PostPosted: Sun Oct 03, 2010 7:43 pm    Post subject: Reply with quote

On the working server, I have in /var/www/localhost:

Code:
drwxrw-r--  2 root   root 4096 Aug 23  2009 cgi-bin
drwxrw-r--  3 root   root 4096 Oct 29  2008 error
drwxrw-r--  2 root   root 4096 Sep  4  2009 htdocs
drwxrw-r--  3 root   root 4096 Oct 29  2008 icons


But on the 2nd server, I just have htdocs. Is there something I haven't run the setup on or what?
Back to top
View user's profile Send private message
AllenJB
Veteran
Veteran


Joined: 02 Sep 2005
Posts: 1285

PostPosted: Sun Oct 03, 2010 8:48 pm    Post subject: Reply with quote

Your htdocs directory (the DocumentRoot) must be readable and executable by the "apache" user and/or "apache" group - usually the latter (configurable, but these are the defaults - some distros use "www-data" instead, for example).

This is usually achieved by modifying the "other" permissions on files (the last 3 characters in the first column (permissions / properties) in the output below)

The files inside also need to be readable by the apache user/group.

"ls -l /var/www/localhost" on my setup:
Code:

drwxr-xr-x 3 root   root 4096 Sep 12 09:16 cgi-bin
drwxr-xr-x 4 root   root 4096 Feb 27  2009 htdocs
Back to top
View user's profile Send private message
CurtE
Guru
Guru


Joined: 17 Apr 2004
Posts: 364
Location: Minneapolis, MN

PostPosted: Tue Mar 29, 2011 3:06 am    Post subject: Reply with quote

This turned out to be a DNS server problem. Once I had the DNS server setup properly, everything started to fall into place.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum