LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-10-2004, 01:44 PM   #1
deWin
Member
 
Registered: Feb 2004
Distribution: Red Hat 9
Posts: 113

Rep: Reputation: 15
apache test page, where are the files?


I've setup Red Hat 9 that came with apache server. The server is running and I'm getting the test page in the browser. I've looked everwhere, I can't find what my default document folder is.

according to the config it should be /var/www/html - I've put in a index.htm file but still shows the test page, I've also created a folder in /var/www/html named "test" and when I go to http://192.168.5.6/test it says page cannot be found.

What should I do to get the server functioning properly?
 
Old 11-10-2004, 02:06 PM   #2
Khabi
Member
 
Registered: Aug 2003
Location: Arizona
Distribution: Gentoo
Posts: 142

Rep: Reputation: 15
cat out /var/log/httpd/error_log and look for a "File does not exist:" line. It should have the directory listed.

Example from my logs:
[Wed Nov 10 11:08:32 2004] [error] [client xx.xx.xx.xx] File does not exist: /var/www/html/favicon.ico
 
Old 11-10-2004, 02:06 PM   #3
IRIGHTI
Member
 
Registered: Oct 2003
Distribution: Slackware64 13.1 x86_64, Ubuntu 10.04 x86_64
Posts: 121

Rep: Reputation: 15
by default apache looks for "index.html"

You can't forget the "l"

Rename your index.htm to index.html and put it in /var/www/htdocs.

That should do it. To change your default directory you need to find the line:

<Directory "/var/www/htdocs">

Then change the directory to what you want. Make sure the directory you change it to has the right permissions.
 
Old 11-10-2004, 02:11 PM   #4
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
hi there

edit etc/httpd/conf/httpd.conf fior apache server
----------------

# Virtual host Default Virtual Host
<VirtualHost 192.168.0.20>
DocumentRoot /plugins/php

ServerSignature email

DirectoryIndex index.html index.php index.htm index.shtml form.php

LogLevel debug
HostNameLookups off

</VirtualHost>

----------

the first line telle that the diretory whichwill be called is /plugins /php
and the directory index tells the order in which it will look for default pages
so see he the page u want is in the directory index or vice versa

regards
 
Old 11-10-2004, 02:25 PM   #5
deWin
Member
 
Registered: Feb 2004
Distribution: Red Hat 9
Posts: 113

Original Poster
Rep: Reputation: 15
Thanks once again, I found out that the config was at one point pointing to somewhere else, I fixed that.

Now another issue, I'm trying to run a .cgi file and it just doesn't want to execute, it simply shows me the file as text file in my browser. I'm running some version of perl, can I simply rename the file to .pl and run it?
 
Old 11-10-2004, 02:40 PM   #6
kevinatkins
Member
 
Registered: Jan 2004
Location: cheshire, uk
Distribution: Ubuntu Hoary
Posts: 605

Rep: Reputation: 32
hi,

cgi's need to go in their own directory - eg. cgi-bin, and apache needs to be set up so that content in that directory is treated as executable - have a look in httpd.conf for examples.

you'll also need the apache perl module if you're hoping to run perl scripts.
 
Old 11-10-2004, 03:00 PM   #7
linux_terror
Member
 
Registered: Aug 2004
Location: Northbrook, Illinois
Distribution: CentOS-5
Posts: 311

Rep: Reputation: 30
In redhat 9 your default cgi-bin is /var/www/cgi-bin populate that directory with your .cgi scripts and it should be accessible at http://yourdomain/cgi-bin/filename.cgi

linux_terror
 
Old 11-10-2004, 03:17 PM   #8
deWin
Member
 
Registered: Feb 2004
Distribution: Red Hat 9
Posts: 113

Original Poster
Rep: Reputation: 15
doing http://mysite/cgi-bin/file.cgi doesn't find the file, infact the browser gets a 404 when I try to hit the cgi-bin as it is. I've looked in the config and removed the Alias (commented it) but that doesn't want to make any difference.

@kevinatkins: Where do i tell my apache to execute these files, some pointers please.
 
Old 11-10-2004, 05:22 PM   #9
linux_terror
Member
 
Registered: Aug 2004
Location: Northbrook, Illinois
Distribution: CentOS-5
Posts: 311

Rep: Reputation: 30
you can add this to yout httpd.conf to make it work...

ScriptAlias /cgi-bin/ "/path/to/cgi-bin/"

<Directory /path/to/cgi-bin>
Options ExecCGI
SetHandler cgi-script
</Directory>

NOTE: http://yourdomain/cgi-bin/ will never resolve as it is set to not allow a directory index,
http://yourdomain/cgi-bin/filename.cgi should work. and make sure the permissions on the cgi bin are set to chmod +x or 755

linux terror
 
Old 11-10-2004, 05:52 PM   #10
deWin
Member
 
Registered: Feb 2004
Distribution: Red Hat 9
Posts: 113

Original Poster
Rep: Reputation: 15
Perfect, absolutely perfect my good sir. You are a lifesaver and you have no idea how much frustration was behind this little thing. THank you!
 
Old 11-10-2004, 05:57 PM   #11
linux_terror
Member
 
Registered: Aug 2004
Location: Northbrook, Illinois
Distribution: CentOS-5
Posts: 311

Rep: Reputation: 30
Yeehaw Always nice to hear when things work out, glad to be of help and thanks for posting your results. Have fun servin' it up.

linux_terror
 
Old 11-10-2004, 08:34 PM   #12
deWin
Member
 
Registered: Feb 2004
Distribution: Red Hat 9
Posts: 113

Original Poster
Rep: Reputation: 15
lol yeah i hate it when people get help and not post the results.

And this thing is gonna be my web proxy server, my employers are cheap enough to recently put a surfing control device on the network and very recently they were going vigilant on it. Well, some people don't learn and I hate it when I'm making my bosses over 100,000 bucks a year and I can't browse.

Thanks for all the support guys, you rock.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Apache Test Page ApachePadowan Linux - Software 4 04-20-2005 10:28 PM
Apache test page mpalazzini Linux - General 2 10-03-2004 11:12 AM
Apache test page mpalazzini Linux - Newbie 4 10-03-2004 01:21 AM
I cant change the default test page in apache server to add my page.y nhemapriya Linux - Newbie 3 05-13-2004 01:35 PM
Sorry, that Apache test page is at it again. Hal Linux - Newbie 4 10-26-2003 06:53 PM


All times are GMT -5. The time now is 10:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration