n5tkn Posted January 5, 2007 Share Posted January 5, 2007 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 / deniedThats 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.pidTimeout 300KeepAlive OnMaxKeepAliveRequests 100KeepAliveTimeout 15<IfModule prefork.c>StartServers 5MinSpareServers 5MaxSpareServers 10MaxClients 150MaxRequestsPerChild 0</IfModule><IfModule worker.c>StartServers 2MaxClients 150MinSpareThreads 25MaxSpareThreads 75ThreadsPerChild 25MaxRequestsPerChild 0</IfModule><IfModule perchild.c>NumServers 5StartThreads 5MinSpareThreads 5MaxSpareThreads 10MaxThreadsPerChild 20MaxRequestsPerChild 0</IfModule>Listen 80LoadModule auth_dbm_module modules/mod_auth_dbm.soLoadModule file_cache_module modules/mod_file_cache.soLoadModule cache_module modules/mod_cache.soLoadModule disk_cache_module modules/mod_disk_cache.soLoadModule mem_cache_module modules/mod_mem_cache.soLoadModule ext_filter_module modules/mod_ext_filter.soLoadModule deflate_module modules/mod_deflate.soLoadModule headers_module modules/mod_headers.soLoadModule usertrack_module modules/mod_usertrack.soLoadModule unique_id_module modules/mod_unique_id.so<IfDefine SSL>LoadModule ssl_module modules/mod_ssl.so</IfDefine>LoadModule bucketeer_module modules/mod_bucketeer.soLoadModule cgi_module modules/mod_cgi.soLoadModule rewrite_module modules/mod_rewrite.soUser httpdGroup httpdServerAdmin matt@nelsonprinting.comServerName 10.0.0.155:80ServerName 192.168.1.54:80UseCanonicalName offDocumentRoot /home/www/nelsonprinting/html<Directory />Options FollowSymLinksAllowOverride None</Directory><Directory "/home/www/nelsonprinting/html">Options -Indexes FollowSymLinksAllowOverride NoneOrder allow,denyAllow from all</Directory>UserDir "public_html"DirectoryIndex index.html index.html.var index.php index.shtmlAccessFileName .htaccess<Files ~ "^\.ht">Order allow,denyDeny from all</Files>TypesConfig /etc/mime.typesDefaultType text/plain<IfModule mod_mime_magic.c>MIMEMagicFile conf/magic</IfModule>HostNameLookups offErrorLog /var/log/httpd/error_logLogLevel debugLogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedLogFormat "%h %l %u %t \"%r\" %>s %b" commonLogFormat "%{Referer}i -> %U" refererLogFormat "%{User-agent}i" agentCustomLog /var/log/httpd/access_log commonServerSignature EmailAlias /icons/ "/home/httpd/icons/"<Directory "/home/httpd/icons">Options Indexes MultiViewsAllowOverride NoneOrder allow,denyAllow 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 IncludesNoExecAddOutputFilter Includes htmlAllowOverride NoneOrder allow,denyAllow 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 NoneOptions NoneOrder allow,denyAllow 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-gzipAddIconByType (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 .exeAddIcon /icons/binhex.gif .hqxAddIcon /icons/tar.gif .tarAddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .ivAddIcon /icons/compressed.gif .Z .z .tgz .gz .zipAddIcon /icons/a.gif .ps .ai .epsAddIcon /icons/layout.gif .html .shtml .htm .pdfAddIcon /icons/text.gif .txtAddIcon /icons/c.gif .cAddIcon /icons/p.gif .pl .pyAddIcon /icons/f.gif .forAddIcon /icons/dvi.gif .dviAddIcon /icons/uuencoded.gif .uuAddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tclAddIcon /icons/tex.gif .texAddIcon /icons/bomb.gif coreAddIcon /icons/back.gif ..AddIcon /icons/hand.right.gif READMEAddIcon /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.gifReadmeName README.htmlHeaderName HEADER.html#IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t#AddEncoding x-compress ZAddEncoding x-gzip gz tgzAddLanguage da .dkAddLanguage nl .nlAddLanguage en .enAddLanguage et .etAddLanguage fr .frAddLanguage de .deAddLanguage he .heAddLanguage el .elAddLanguage it .itAddLanguage ja .jaAddLanguage pl .poAddLanguage ko .koAddLanguage pt .ptAddLanguage nn .nnAddLanguage no .noAddLanguage pt-br .pt-brAddLanguage ltz .ltzAddLanguage ca .caAddLanguage es .esAddLanguage sv .seAddLanguage cz .czAddLanguage ru .ruAddLanguage tw .twAddLanguage zh-tw .twAddLanguage 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 .latin1AddCharset ISO-8859-2 .iso8859-2 .latin2 .cenAddCharset ISO-8859-3 .iso8859-3 .latin3AddCharset ISO-8859-4 .iso8859-4 .latin4AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ruAddCharset ISO-8859-6 .iso8859-6 .latin6 .arbAddCharset ISO-8859-7 .iso8859-7 .latin7 .grkAddCharset ISO-8859-8 .iso8859-8 .latin8 .hebAddCharset ISO-8859-9 .iso8859-9 .latin9 .trkAddCharset ISO-2022-JP .iso2022-jp .jisAddCharset ISO-2022-KR .iso2022-kr .kisAddCharset ISO-2022-CN .iso2022-cn .cisAddCharset Big5 .Big5 .big5# For russian, more than one charset is used (depends on client, mostly):AddCharset WINDOWS-1251 .cp-1251 .win-1251AddCharset CP866 .cp866AddCharset KOI8-r .koi8-r .koi8-ruAddCharset KOI8-ru .koi8-uk .uaAddCharset ISO-10646-UCS-2 .ucs2AddCharset ISO-10646-UCS-4 .ucs4AddCharset 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 .gbAddCharset utf-7 .utf7AddCharset utf-8 .utf8AddCharset big5 .big5 .b5AddCharset EUC-TW .euc-twAddCharset EUC-JP .euc-jpAddCharset EUC-KR .euc-krAddCharset shift_jis .sjis#AddType application/x-tar .tgz# MIME Types for WAPAddType text/vnd.wap.wml .wmlAddType image/vnd.wap.wbmp .wbmpAddType application/vnd.wap.wmlc .wmlcAddType text/vnd.wap.wmlscript .wmlsAddType application/vnd.wap.wmlscriptc .wmlscAddHandler type-map var## The following directives modify normal HTTP response behavior to# handle known problems with browser implementations.#BrowserMatch "Mozilla/2" nokeepaliveBrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0BrowserMatch "RealPlayer 4\.0" force-response-1.0BrowserMatch "Java/1\.0" force-response-1.0BrowserMatch "JDK/1\.0" force-response-1.0#BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefullyBrowserMatch "^WebDrive" redirect-carefully#<IfModule mod_ssl.c># Add your SSL settings here.</IfModule>---END of httpd.conf Quote Link to comment Share on other sites More sharing options...
fert Posted January 6, 2007 Share Posted January 6, 2007 do you have mod rewrite on? Quote Link to comment Share on other sites More sharing options...
the_oliver Posted January 6, 2007 Share Posted January 6, 2007 Is that all of you httpd.conf file? Where is section three?I would suggest checking everything inside <directory></directory> tags to see if its denying access there. Quote Link to comment Share on other sites More sharing options...
steviewdr Posted January 6, 2007 Share Posted January 6, 2007 You need to add a VirtualHost.-steve Quote Link to comment Share on other sites More sharing options...
n5tkn Posted January 6, 2007 Author Share Posted January 6, 2007 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. Quote Link to comment Share on other sites More sharing options...
n5tkn Posted January 6, 2007 Author Share Posted January 6, 2007 This is what the <directory> </directory> tags show up there:DocumentRoot /home/www/nelsonprinting/html<Directory />Options FollowSymLinksAllowOverride None</Directory><Directory "/home/www/nelsonprinting/html">Options -Indexes FollowSymLinksAllowOverride NoneOrder allow,denyAllow from all</Directory>Doesn't seem to be denying anyone... Quote Link to comment Share on other sites More sharing options...
the_oliver Posted January 6, 2007 Share Posted January 6, 2007 If you do add a virtual host does it make any diffrence?Like you say the <directory> bit looks right. Quote Link to comment Share on other sites More sharing options...
steviewdr Posted January 8, 2007 Share Posted January 8, 2007 Yes - Apache2 requires a VirtualHost (in my opinion). mod_userdir would work straight away however. I.e. www.site.com/~user (with a path of /home/user/public_html/-steve Quote Link to comment Share on other sites More sharing options...
n5tkn Posted January 8, 2007 Author Share Posted January 8, 2007 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!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.