Jump to content

Can't get Apache to server, permission denied on anything.


n5tkn

Recommended Posts

I posted this to linuxquestions.org, but haven't gotten any response.

---
I have apache 2.0.59 running on Trustix 2.0. I have in my httpd.conf file, the directives of document root /home/www/thewebserversdirectory/html (where thewebserversdirectory is the name of the directory holding the content, such as index.html, images, etc.)


The directory and everything in it is owned by httpd and belongs to group httpd, as apache runs as that user and group. Permissions, (though it doesn't matter, as I've 777'ed them and nothing works) are currently 644.

I get access denied on EVERYTHING, even on connectsion from localhost. It will not serve anything. Now I did have the document root set wrong, to /home/httpd/html ( I think ) and SOMEHOW it was bringing up index.html or any other html file I opened, but couldn't bring up the images which are in subdirectories of the document root I defined above. HOW that was happening I don't know. I've set apache up before and NEVER had this trouble. I can RTFM, but I just don't see what I'm missing. I don't have an .htaccess file defined, so that shouldn't be the proble either. I'm reading Pro Apache by Wainwright, but it doesn't really helpe here so far.

Whatever other info you need to help me with this, please, just ask and I will provide.

I need a list of things to check ,etc. or something, or maybe Trustix is doing something weird itself?

I don't know.

Someone on other site asked about SELinux and error messages:

No SELinux on this distro that I can find.

Error log just shows this: (date) [error] [client 127.0.01 (or whatever IP I connect from)] (13) Permission denied: access to / denied

Thats it, and the error is the same if I try to load any html file by name, ie access to /page.html denied.

Here is httpd.conf: (some comments removed for brevity)
----

ServerRoot "/etc/httpd"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
LockFile /var/run/httpd/accept.lock

<IfModule !perchild.c>
#ScoreBoardFile /var/run/httpd/apache_runtime_status
</IfModule>


PidFile /var/run/httpd.pid

Timeout 300

KeepAlive On
MaxKeepAliveRequests 100

KeepAliveTimeout 15

<IfModule prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>


<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>


<IfModule perchild.c>
NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0
</IfModule>


Listen 80


LoadModule auth_dbm_module modules/mod_auth_dbm.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule cache_module modules/mod_cache.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule unique_id_module modules/mod_unique_id.so
<IfDefine SSL>
LoadModule ssl_module modules/mod_ssl.so
</IfDefine>
LoadModule bucketeer_module modules/mod_bucketeer.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule rewrite_module modules/mod_rewrite.so


User httpd
Group httpd

ServerAdmin matt@nelsonprinting.com

ServerName 10.0.0.155:80
ServerName 192.168.1.54:80


UseCanonicalName off


DocumentRoot /home/www/nelsonprinting/html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/home/www/nelsonprinting/html">
Options -Indexes FollowSymLinks

AllowOverride None

Order allow,deny
Allow from all

</Directory>

UserDir "public_html"



DirectoryIndex index.html index.html.var index.php index.shtml

AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>

TypesConfig /etc/mime.types
DefaultType text/plain

<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
HostNameLookups off

ErrorLog /var/log/httpd/error_log

LogLevel debug

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

CustomLog /var/log/httpd/access_log common


ServerSignature Email
Alias /icons/ "/home/httpd/icons/"

<Directory "/home/httpd/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

#
# This should be changed to the ServerRoot/manual/. The alias provides
# the manual, even if you choose to move your DocumentRoot. You may comment
# this out if you do not care for the documentation.
#
Alias /manual "/home/httpd/html/manual"

<Directory "/home/httpd/html/manual">
Options Indexes FollowSymLinks MultiViews IncludesNoExec
AddOutputFilter Includes html
AllowOverride None
Order allow,deny
Allow from all
</Directory>

#
ScriptAlias /cgi-bin/ "/home/httpd/cgi-bin/"

<IfModule mod_cgid.c>
#
# Additional to mod_cgid.c settings, mod_cgid has Scriptsock <path>
# for setting UNIX socket for communicating with cgid.
#
#Scriptsock /var/run/cgisock
</IfModule>

#
# "/home/httpd/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/home/httpd/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

#
IndexOptions FancyIndexing VersionSort

#
# AddIcon* directives tell the server which icon to show for different
# files or filename extensions. These are only displayed for
# FancyIndexed directories.
#
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

#
# DefaultIcon is which icon to show for files which do not have an icon
# explicitly set.
#
DefaultIcon /icons/unknown.gif

ReadmeName README.html
HeaderName HEADER.html

#
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

#
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz

AddLanguage da .dk
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .et
AddLanguage fr .fr
AddLanguage de .de
AddLanguage he .he
AddLanguage el .el
AddLanguage it .it
AddLanguage ja .ja
AddLanguage pl .po
AddLanguage ko .ko
AddLanguage pt .pt
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pt-br .pt-br
AddLanguage ltz .ltz
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .se
AddLanguage cz .cz
AddLanguage ru .ru
AddLanguage tw .tw
AddLanguage zh-tw .tw
AddLanguage hr .hr

#
# LanguagePriority allows you to give precedence to some languages
# in case of a tie during content negotiation.
#
# Just list the languages in decreasing order of preference. We have
# more or less alphabetized them here. You probably want to change this.
#
LanguagePriority en da nl et fr de el it ja ko no pl pt pt-br ltz ca es sv tw

#
# ForceLanguagePriority allows you to serve a result page rather than
# MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)
# [in case no accepted languages matched the available variants]
#
ForceLanguagePriority Prefer Fallback

#
# Specify a default charset for all pages sent out. This is
# always a good idea and opens the door for future internationalisation
# of your web site, should you ever want it. Specifying it as
# a default does little harm; as the standard dictates that a page
# is in iso-8859-1 (latin1) unless specified otherwise i.e. you
# are merely stating the obvious. There are also some security
# reasons in browsers, related to javascript and URL parsing
# which encourage you to always set a default char set.
#
AddDefaultCharset ISO-8859-1

#
# Commonly used filename extensions to character sets. You probably
# want to avoid clashes with the language extensions, unless you
# are good at carefully testing your setup after each change.
# See ftp://ftp.isi.edu/in-notes/iana/assi...character-sets for
# the official list of charset names and their respective RFCs
#
AddCharset ISO-8859-1 .iso8859-1 .latin1
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
AddCharset ISO-8859-3 .iso8859-3 .latin3
AddCharset ISO-8859-4 .iso8859-4 .latin4
AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru
AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb
AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk
AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb
AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5 .Big5 .big5
# For russian, more than one charset is used (depends on client, mostly):
AddCharset WINDOWS-1251 .cp-1251 .win-1251
AddCharset CP866 .cp866
AddCharset KOI8-r .koi8-r .koi8-ru
AddCharset KOI8-ru .koi8-uk .ua
AddCharset ISO-10646-UCS-2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-8 .utf8

# The set below does not map to a specific (iso) standard
# but works on a fairly wide range of browsers. Note that
# capitalization actually matters (it should not, but it
# does for some browsers).
#
# See ftp://ftp.isi.edu/in-notes/iana/assi...character-sets
# for a list of sorts. But browsers support few.
#
AddCharset GB2312 .gb2312 .gb
AddCharset utf-7 .utf7
AddCharset utf-8 .utf8
AddCharset big5 .big5 .b5
AddCharset EUC-TW .euc-tw
AddCharset EUC-JP .euc-jp
AddCharset EUC-KR .euc-kr
AddCharset shift_jis .sjis

#
AddType application/x-tar .tgz

# MIME Types for WAP
AddType text/vnd.wap.wml .wml
AddType image/vnd.wap.wbmp .wbmp
AddType application/vnd.wap.wmlc .wmlc
AddType text/vnd.wap.wmlscript .wmls
AddType application/vnd.wap.wmlscriptc .wmlsc
AddHandler type-map var


#
# The following directives modify normal HTTP response behavior to
# handle known problems with browser implementations.
#
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
#
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully

#
<IfModule mod_ssl.c>
# Add your SSL settings here.
</IfModule>


---

END of httpd.conf
Link to comment
Share on other sites

You need to add a virtual host in order to have the web server serve anything?  I've only added virtual hosts in the past in order to server other site other than my primary site.  And why was the server serving the default content until I uploaded the wanted site's content and changed the document root?  Actually, I didn't even change the document root at first.  I put the content in place of where the default content was located first.  Didn't work either way.
Link to comment
Share on other sites

This is what the <directory> </directory> tags show up there:

DocumentRoot /home/www/nelsonprinting/html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/home/www/nelsonprinting/html">
Options -Indexes FollowSymLinks

AllowOverride None

Order allow,deny
Allow from all

</Directory>


Doesn't seem to be denying anyone...
Link to comment
Share on other sites

Thanks!  I'll try this straight away.  I sure didn't find it in the book or docs...must've missed it.  Still not sure why the original "hello world" page worked that way.....but maybe  I messed up the original vhost directive that was already there, thinking I didn't need it and thats why it worked at first.

I'll report back as soon as possible.  Thanks!!!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.