Results 1 to 9 of 9

Thread: [SOLVED] Cannot configure apache

  1. #1
    Join Date
    Oct 2007
    Location
    Perth
    Beans
    30
    Distro
    Ubuntu 10.04 Lucid Lynx

    Red face [SOLVED] Cannot configure apache

    I am having problems configuring Apache. I installed LAMP to work on PHP.

    I get the error "You don't have permission to access / on this server." when I try and access "http://localhost/" in my Web browser.

    I was initially trying to set myself permissions to copy, paste and edit files in /var/www and I seemed to have completely messed the permissions up. In addition, this is what I added to the /etc/apache2/httpd.conf file that was initially blank.

    <Directory "/var/www">
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>

    I have attached the following screenshots:
    A. Permissions of /var/www
    B. Error message when accessing localhost

    This is what I want to do:
    1. Give my user account full rights to paste and edit files in /var/www
    2. Is the httpd.conf file content correct?
    3. I am confused about the default directory. Is it /var/www or /var/www/html ?

    Please help!

    ---
    Ubuntu 8.04
    Attached Images Attached Images

  2. #2
    Join Date
    Nov 2007
    Beans
    75

    Re: Cannot configure apache

    Give Webmin at try.


    Using webmin has made the apache experience so much better for me.

  3. #3
    Join Date
    May 2007
    Location
    Phoenix, Arizona USA
    Beans
    2,909
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Cannot configure apache

    Code:
    sudo chmod -R 775 /var/www
    I think your ownership is messed up however. Do you have an Apache user? When you start Apache and run top, what user does Apache run as?

    If the user is www (as on most systems) you will also need to do an:

    Code:
    sudo chown -R www /var/www
    -Tim
    www.pcchopshop.net

    Hard to find and obsolete PC and server parts. "If we can't find it, it probably doesn't exist"

  4. #4
    Join Date
    Oct 2007
    Location
    Perth
    Beans
    30
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Cannot configure apache

    Quote Originally Posted by johnswb View Post
    Give Webmin at try.


    Using webmin has made the apache experience so much better for me.
    Thanks for the link. I would try it, but at a later stage. As a new user, I would like to get my hands dirty the hard way and understand how the stuff works.
    AMD 64x2 dual core // 4GB DDR2 // NVIDIA GeForce 7000M // Lucid Lynx x64 // 2.6.32-22-generic

  5. #5
    Join Date
    Oct 2007
    Location
    Perth
    Beans
    30
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Cannot configure apache

    Quote Originally Posted by windependence View Post
    Code:
    sudo chmod -R 775 /var/www
    I think your ownership is messed up however. Do you have an Apache user? When you start Apache and run top, what user does Apache run as?

    If the user is www (as on most systems) you will also need to do an:

    Code:
    sudo chown -R www /var/www
    -Tim
    Hi Tim,

    Thanks it kinda worked. I chowned to my user account and it works fine now. I have a few questions:

    1. I don't have an apache or www account set up. Is this ok? What is the significance of this account?
    2. What is the difference between the /var/www and /var/www/html folders?

    Thanks for solving my problem.
    AMD 64x2 dual core // 4GB DDR2 // NVIDIA GeForce 7000M // Lucid Lynx x64 // 2.6.32-22-generic

  6. #6
    Join Date
    May 2007
    Location
    Phoenix, Arizona USA
    Beans
    2,909
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Cannot configure apache

    Well, I like to run my Apache stuff under it's own user for security. I run mostly FreeBSD hosts in VMs on top of Ubuntu server, and FBSD does this when Apache is installed. It's not necessary, but may be considered good practice.

    As for the folders, you theoretically could set any folder on your system to be the root Apache file if you specify it in your httpd.conf file. I am not sure if yours is set to /var/www or /var/www/html. You will need to look in the file to see what the Document Root is set to. That is the directory where you want to put you web files.

    -Tim
    www.pcchopshop.net

    Hard to find and obsolete PC and server parts. "If we can't find it, it probably doesn't exist"

  7. #7
    Join Date
    May 2008
    Location
    Puerto Rico
    Beans
    65
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Cannot configure apache

    Quote Originally Posted by windependence View Post
    Well, I like to run my Apache stuff under it's own user for security. I run mostly FreeBSD hosts in VMs on top of Ubuntu server...
    Geeze Tim, I would give an ear just to know how you did this. Sounds mighty interesting and looks like the type of setup that my mind has been wanting to "chew" to implement my Apache stuff too. Well... hopefully I'll get there some day... *thumbs up*
    - "We are not because of our skills, but because of our choices" -- Dumbledore, in "The Prisoner of Azkaban"
    - "Say it like if I was 8 years old" -- Denzel Washington, in "Philadelphia"

  8. #8
    Join Date
    Oct 2007
    Location
    Perth
    Beans
    30
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Cannot configure apache

    Just curious: What is 775 supposed to do?
    AMD 64x2 dual core // 4GB DDR2 // NVIDIA GeForce 7000M // Lucid Lynx x64 // 2.6.32-22-generic

  9. #9
    Join Date
    Nov 2007
    Beans
    75

    Re: Cannot configure apache

    Quote Originally Posted by Alnico View Post
    Thanks for the link. I would try it, but at a later stage. As a new user, I would like to get my hands dirty the hard way and understand how the stuff works.
    For me I had a BIG learning curve, so using Webmin helped me to learn the command line option as well. After making a setting change in Webmin you can view the config file, and make other setting changes to the config file see what happens. I agree with you in getting your hands dirty, but it nice to get results from the mud pies.

Tags for this Thread

Bookmarks

Posting Permissions

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