View previous topic :: View next topic |
Author |
Message |
CurtE Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 17 Apr 2004 Posts: 364 Location: Minneapolis, MN
|
Posted: Sun Oct 03, 2010 4:25 pm Post subject: [ Solved ] You don't have permission to access server. |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
chiefbag Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Simpsons/Simpsons_-_Wiggum.jpg)
Joined: 01 Oct 2010 Posts: 542 Location: The Kingdom
|
Posted: Sun Oct 03, 2010 4:36 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
CurtE Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 17 Apr 2004 Posts: 364 Location: Minneapolis, MN
|
Posted: Sun Oct 03, 2010 4:54 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
chiefbag Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Simpsons/Simpsons_-_Wiggum.jpg)
Joined: 01 Oct 2010 Posts: 542 Location: The Kingdom
|
Posted: Sun Oct 03, 2010 5:09 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
CurtE Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 17 Apr 2004 Posts: 364 Location: Minneapolis, MN
|
Posted: Sun Oct 03, 2010 7:43 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
AllenJB Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/147867172543a1dddabe67c.gif)
Joined: 02 Sep 2005 Posts: 1285
|
Posted: Sun Oct 03, 2010 8:48 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
CurtE Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 17 Apr 2004 Posts: 364 Location: Minneapolis, MN
|
Posted: Tue Mar 29, 2011 3:06 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|