3

Im running Ubuntu 12.04 LTS on a system with 2 GB RAM and a 500 GB HDD.

My hard drive has 4 partitions:

  • Partition 1 = 40 gb Windows (NTFS, lable = win32)
  • Partition 2 = 320 gb Windows (FAT label = common)
  • Partition 3 = 40 gb Ubuntu (EXT4)

I installed apached2. Then, to change its default www directory, I ran gksu gedit /etc/apache2/sites-enabled/000-default and, in the editor, changed the location to /media/common/www.

After that I ran these commands in a terminal:

chmod 777 /media/common/www 
chmod 777 /media/common/www/*.*

After that I ran: firefox 127.0.0.1/index.php

It said:

Forbidden
You don't have permission to access / on this server.
Apache/2.2.22 (Ubuntu) Server at 127.0.0.1 Port 80

Before my changes it was working fine.

How can I run my websites?

ish
  • 141,990
nishan
  • 39

2 Answers2

3

I guess that, Your common partition may be an ntfs or fat partition and You just mounted that partition by clicking on the nautilus side bar icon. Doing so, does not mount the partition with executable permission, which is required for firefox to be able to execute the file.

The solution:

The easiest solution without using /etc/fstab file is this:

  • Open a terminal and type sudo blkid, give password.

  • From the output of the command, see the type of the partition by looking at the corresponding label, i.e common.

  • If common partition happen to be /dev/sda2 , mount that partition with the command:

      udisks --mount /dev/sda2 --mount-options umask=022  
    

    replace, /dev/sda2 with the actual partition number.

You should now be able to execute/run the files using "Firefox".

Note: You should unmount the partition before using the command. You can unmount it by right-clicking on the partition icon, and select "unmount" from the options

Anwar
  • 77,855
1

Well, from what i can tell, chmod won't work on directories the way you use it- you really should try chmod -R 777 /path/to/main/directory/ to make it recursive. Then again, You don't want 777 for most things - but the exact permissions level would depend on your setup - I just hand over ownership to www-data and run things with 755 - which dosen't let non owners write, but gives full read/execute powers.

Amusingly the error messages should have given most of this away. For a better writeup on how to set permissions, see this question on webmasters.se