LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   apache test page, where are the files? (https://www.linuxquestions.org/questions/linux-newbie-8/apache-test-page-where-are-the-files-253288/)

deWin 11-10-2004 12:44 PM

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?

Khabi 11-10-2004 01:06 PM

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

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

IRIGHTI 11-10-2004 01:06 PM

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.

masand 11-10-2004 01:11 PM

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

deWin 11-10-2004 01:25 PM

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?

kevinatkins 11-10-2004 01:40 PM

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.

linux_terror 11-10-2004 02:00 PM

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

deWin 11-10-2004 02:17 PM

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.

linux_terror 11-10-2004 04:22 PM

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

deWin 11-10-2004 04:52 PM

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!

linux_terror 11-10-2004 04:57 PM

Yeehaw :D 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

deWin 11-10-2004 07:34 PM

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.


All times are GMT -5. The time now is 07:03 AM.