Results 1 to 9 of 9

Thread: How do I test PHP with LAMP?

  1. #1
    Join Date
    Jun 2010
    Beans
    3

    Arrow How do I test PHP with LAMP?

    Hello,
    I just downloaded LAMP and I've been able to add and edit folders in my var/www folder with the "gksu nautilus" command. But, when I test the php files in localhost I get this message:

    Forbidden

    You don't have permission to access /Form_IP2/myTest.php on this server.
    Apache/2.2.14 (Ubuntu) Server at localhost Port 80


    How do I test my PHP?

  2. #2
    Join Date
    Sep 2005
    Beans
    463
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: How do I test PHP with LAMP?

    I think this looks like a nice guide:
    http://blogote.com/2010/ubuntu/how-t...ort-guide.html

    Good luck!

    Niko

  3. #3
    Join Date
    May 2010
    Location
    Here
    Beans
    1,297
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: How do I test PHP with LAMP?

    Quote Originally Posted by TheAdamJanes View Post
    Hello,
    I just downloaded LAMP and I've been able to add and edit folders in my var/www folder with the "gksu nautilus" command. But, when I test the php files in localhost I get this message:

    Forbidden

    You don't have permission to access /Form_IP2/myTest.php on this server.
    Apache/2.2.14 (Ubuntu) Server at localhost Port 80


    How do I test my PHP?
    First of all, just remember, instead of
    Code:
    gksu nautilus
    try
    Code:
    gksu nautilus --no-desktop --browser
    And on /var, go to www's properties.
    Be sure that everything is Read and Write.
    Hope that helps!

  4. #4
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: How do I test PHP with LAMP?

    Quote Originally Posted by lkjoel View Post
    First of all, just remember, instead of
    Code:
    gksu nautilus
    try
    Code:
    gksu nautilus --no-desktop --browser
    And on /var, go to www's properties.
    Be sure that everything is Read and Write.
    Hope that helps!
    On apache, I keep files owned by root, group www-data , and permissions of 440 (ro).

    I would advise against permissions of 666.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  5. #5
    Join Date
    May 2010
    Location
    Here
    Beans
    1,297
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: How do I test PHP with LAMP?

    Yes, you are right.
    But if someone has a computer only to his/her own self, does it matter?
    Sure a hacker can come in and do big damage, but can't the hacker change permissions?
    Thanks in advance!

  6. #6
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: How do I test PHP with LAMP?

    Quote Originally Posted by lkjoel View Post
    Yes, you are right.
    But if someone has a computer only to his/her own self, does it matter?
    Yes, it matters. If your computer is connected to the internet you are not the only user, more so with servers.

    Sure a hacker can come in and do big damage, but can't the hacker change permissions?
    Thanks in advance!
    Apache runs as a restricted user, www-data on Ubuntu. So if apache / php is compromised, and your files are world writable, permissions of 666 , game over -> Defaced wed site.

    Same if mysql is compromised and on ...

    If your files are owned by root:www-data , with permissions of 440, and apache, one needs to first compromise apache (or mysql) and then gain root privileges. This escalation of privileges will be much more difficult with apparmor running (you do run apparmor on your web server I hope ... )

    So yes, permissions of 666 or 777 on files served by a LAMP stack is considered to be inappropriate by most everyone with any interest in security.

    Unless you want your web site defaced, don't do it. Of course you are a small fish if you are simply running a simple web site at home, but still, I am sure someone somewhere would like to yank your chain.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  7. #7
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: How do I test PHP with LAMP?

    Another example, firefox runs as your user and thus can not change files in /etc or /usr or /bin , so , yes, Linux permissions are critical for security even though you may feel you are the "only user" on the system.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  8. #8
    Join Date
    May 2010
    Location
    Here
    Beans
    1,297
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: How do I test PHP with LAMP?

    Ok thanks a lot bodhi.zazen!
    I will change my /var/www settings.
    Is there any firewalls that work under linux and is free?

  9. #9
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: How do I test PHP with LAMP?

    Quote Originally Posted by lkjoel View Post
    Ok thanks a lot bodhi.zazen!
    I will change my /var/www settings.
    Is there any firewalls that work under linux and is free?
    UFW / GUFW

    http://blog.bodhizazen.net/linux/firewall-ubuntu-gufw/
    http://blog.bodhizazen.net/linux/fir...untu-desktops/
    http://blog.bodhizazen.net/linux/fir...buntu-servers/
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

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
  •