Results 1 to 7 of 7

Thread: Help setting Apache on Linux

  1. #1

    Question Help setting Apache on Linux

    Hi there,

    I am new to Linux, I am trying to set up Apache, I am using Red Hat - 9. On my laptop, for my personal development use:

    Apache is running, when I copied a index.html file in the /var/www/html folder, it is giving the error 403 - Forbidden, you are not authorised to view this file ...

    While I am logged as root, what is causing this problem please help!

    Thanks,
    Zeeshan Alam
    Retina-X Studios, LLC
    retinax.com

  2. #2
    Trumpet-Eared Gentoo Freak
    Join Date
    Jan 2003
    Posts
    992
    Sometimes apache can be configured if it doesn't found an index-page it refuses to show a dir tree.
    You need to tell it which index-files to look for, so check in your conf if you have sumtin like this :

    <IfModule mod_dir.c>
    DirectoryIndex index.html index.html.var index.php index.php3 index.shtml index.cgi index.pl index.htm Default.htm default.htm
    </IfModule>
    Else try hashing out this one under here to test if it lifts the restrictions.

    <Directory />
    Options -All -Multiviews
    AllowOverride None
    <IfModule mod_access.c>
    Order deny,allow
    Deny from all
    </IfModule>
    </Directory>
    Come and check out our wargame-site @ http://www.rootcontest.org
    We chat @ irc.smdc-network.org #lobby

  3. #3
    Hey there,

    Ok going to try it. gotta reboot in red-hat.

    On Windows XP, I installed AMP successfully, while I am able to run normal php programs, but any php code that make use of mysql_* commands gives the error:

    Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\index.php on line 4

    What is wrong with that?

    I have to do a project fast and I am stuck setting up the servers, why web programming gets difficult for an application programmer? ;-)

    Thanks,
    Zeeshan Alam

  4. #4
    Senior Member
    Join Date
    Oct 2002
    Posts
    1,130
    hrm... some more information would be useful... but my first guess is that php was not compiled on your version of Apache with mysql support, considering that all the other php commands work. It is also possible that apache cannot find the mysql libraries.

    Make a phpinfo.php page with only the following code:

    Code:
    &lt;? php
    
    phpinfo();
    
    ?&gt;
    And have a look at that page. If there is no reference to mysql in there, then php was compiled without the necessary support. You will need to recompile and reinstall it, or find a suitable RPM package that will support it. If it tells you that mysql is compiled in, you will need to find the mysql libraries and put them in the right place. First, find the php executable on your system that is being used by apache. Then "ldd php", and you should see libmysqlclient.so.* as one of the libraries, and on the right it should tell you where it is looking for that library. Make sure the mysql libraries are actually there.

    [EDIT]
    Oops. My bad. Missed the part about you now trying it on XP. The phpinfo() page bit will still be effective, but just ignore everything else...
    [/EDIT]

    Hope that helps.
    Government is like fire - a handy servant, but a dangerous master - George Washington
    Government is not reason, it is not eloquence - it is force. - George Washington.

    Join the UnError community!

  5. #5
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    Hey Hey,

    In response to your first problem, if Shrekkie's help didn't fix it. You may want to look at the permissions, since you copied them over as root, if your webserver is running as wwwrun, www, http, nobody (some of the common ones I've seen) or anything else that's not root then it may not be able to read the file and that could be why you are seeing that error message. Find out which user your server is running under and then chown -R &lt;web server user&gt; on that directory.

    As for the second one, don't try the ldd command that Striek gave you... you're using XP at that point and that command is only going to work for you on the Linux install... If you're in XP and you want a fast setup, I've always relied on phpdev from firepages - http://www.firepages.com.au/. It gives you php, apache, and mysql all working together and ready to go on Windows... It's quite nice and fully functional. It'll save you the headaches of getting everything working yourself.

    Peace,
    HT

  6. #6
    Hey there,

    I am downloading now the utility you suggested.

    For linux, can you throw some more light on how to find how my web server is running as. I am new to linux

    Thanks,
    Zeeshan

  7. #7
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    Originally posted here by AceSpy
    Hey there,

    I am downloading now the utility you suggested.

    For linux, can you throw some more light on how to find how my web server is running as. I am new to linux

    Thanks,
    Zeeshan
    Hey hey,


    ps aux will give you a process listing with the usernames

    you can scroll through this or you can pipe to grep.... ps aux | grep httpd &lt;-- this will only show lines that contain the text httpd

    Peace,
    HT

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •