What is apache's default directory

Discussion in 'Apache' started by darshanrn, Jun 23, 2010.

  1. #1
    What is the default directory where apache creates files?
    I am trying to create a simple text file, but i get an error: Permission denied.
    I wanted to know which directory is apache trying to create that file in?
     
    darshanrn, Jun 23, 2010 IP
  2. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #2
    well is it cpanel ?? then its normally in /home/username/public_html
     
    Bohra, Jun 24, 2010 IP
  3. darshanrn

    darshanrn Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well, I am trying to create a text file through my python script which is executed by apache. I get an error "Permission denied" and i am not sure where apache is trying to create this file. Any help on this would be useful.
     
    darshanrn, Jun 24, 2010 IP
  4. madaboutlinux

    madaboutlinux Member

    Messages:
    250
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    43
    #4
    The script won't be allowed to create a .htaccess file via Apache. Access is restricted. The .htaccess should already be there under /home/username/public_html, if not, you can create it from cPanel >> 'File Manager' section.
     
    madaboutlinux, Jun 24, 2010 IP
  5. bvsonline

    bvsonline Peon

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Instead of creating the file directly under home directory, try to create the file under a folder inside the home directory. Give 777 permissions to that folder.
     
    bvsonline, Jun 24, 2010 IP
  6. bvsonline

    bvsonline Peon

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Just an update. Apache's default directory is "/usr/local/apache/htdocs".
     
    bvsonline, Jun 24, 2010 IP