Forbidden (/var/www/directory access error)
I am trying to browse in /var/www/directory and it giving me a following error.
Forbidden You don't have permission to access /directory/ on this server. Apache/2.2.14 (Ubuntu) Server at localhost Port 80 I have just copied that directory to /var/www. What might be wrong. Thank you amritpalpathak.blogspot.com |
Check the permissions on that directory
Code:
ls -ls /var/www |
Quote:
|
I am download this directory by a script and then copying it to /var/www .So i have already changed the permisson of /var/www as:
sudo chmod 777 -R /var/www/ Is it the cause for error? Thanks amritpalpathak.blogspot.com |
Quote:
http://defindit.com/readme_files/apache_13_error.html Also, doing a chmod 777 on ANYTHING is a bad idea...doing it to anything related to a network-related resource is even WORSE. |
This is script which is doing above things
sudo wget [url]http://server.com/package-name sudo chmod 777 -R /var/www/ sudo mv GNDEC-SMS-Service.tar.gz /var/www/ cd /var/www/ sudo tar -zxvf GNDEC-SMS-Service.tar.gz sudo chmod 777 -R GNDEC-SMS-Service Then i tried to access "localhost/GNDEC-SMS-Service" and got above error.Thats all Thanks amritpalpathak.blogspot.com |
Quote:
|
Hi,
Since you still get a 403 error even with a 777 permissions, then I guess this is because you don't have an index page in that directory. You may enable "Options Indexes" for that specific directory, if you want to be able to browse it. As TB0ne has already pointed out, it's not good to use 777 for files/directories. The correct permissions for directories is 755 and for files 644 BTW, edit your post above and hide the URL, of the file you download Regards |
@bathory
I am sure index file is present there.My friends can use the same script without any error on there systems. Thanks amritpalpathak.blogspot.com |
What gives:
Code:
ls -ld /var/www/GNDEC-SMS-Service |
Quote:
|
Sorry i was unavailable for some time.check out output of following command.
ls -ls /var/www total 3936 4 drwxrwxrwx 10 amrit amrit 4096 2011-07-18 23:30 GNDEC-SMS-Service 3928 -rw-r--r-- 1 root root 4020082 2011-07-18 23:39 GNDEC-SMS-Service.tar.gz.1 4 -rw-r--r-- 1 root root 177 2011-07-28 12:42 index.html Thanks amritpalpathak.blogspot.com |
So what gives:
Code:
ls -la /var/www/GNDEC-SMS-Service |
Quote:
|
it gives
ls -la /var/www/GNDEC-SMS-Service total 852 drwxrwxrwx 10 amrit amrit 4096 2011-07-18 23:30 . drwxrwxrwx 3 root root 4096 2011-08-01 22:12 .. -rwxrwxrwx 1 amrit amrit 4578 2011-07-18 23:25 \ -rwxrwxrwx 1 amrit amrit 6433 2011-07-18 23:25 additionalinfo.php -rwxrwxrwx 1 amrit amrit 13080 2011-07-18 23:28 address.php -rwxrwxrwx 1 amrit amrit 4763 2011-07-18 23:24 birthday.php -rwxrwxrwx 1 amrit amrit 3121 2011-07-18 23:26 cell.php -rwxrwxrwx 1 amrit amrit 2404 2011-07-18 23:28 changeLog.txt -rwxrwxrwx 1 amrit amrit 9142 2011-07-18 23:24 class-contactlist.php -rwxrwxrwx 1 amrit amrit 4596 2011-07-18 23:24 classes.php -rwxrwxrwx 1 amrit amrit 2458 2011-07-18 23:25 config.php -rwxrwxrwx 1 amrit amrit 4210 2011-07-18 23:25 constants.inc -rwxrwxrwx 1 amrit amrit 1473 2011-07-18 23:25 credits.html drwxrwxrwx 3 amrit amrit 4096 2011-08-01 22:12 css -rwxrwxrwx 1 amrit amrit 33989 2011-07-18 23:24 datetime.js -rwxrwxrwx 1 amrit amrit 352 2011-07-18 23:18 DEADJOE -rwxrwxrwx 1 amrit amrit 24204 2011-07-18 23:24 edit.php -rwxrwxrwx 1 amrit amrit 36864 2011-07-18 23:24 .edit.php.swp -rwxrwxrwx 1 amrit amrit 26780 2011-07-18 23:24 export.php -rwxrwxrwx 1 amrit amrit 6230 2011-07-18 23:24 fileupload.php -rwxrwxrwx 1 amrit amrit 11180 2011-07-18 23:25 functions.php -rwxrwxrwx 1 amrit amrit 2627 2011-07-18 23:25 get_report.php -rwxrwxrwx 1 amrit amrit 53 2011-07-18 23:24 google8864db9c6fc17639.html -rwxrwxrwx 1 amrit amrit 18009 2011-07-18 23:25 gpl.txt -rwxrwxrwx 1 amrit amrit 12673 2011-07-18 23:26 groups.php -rwxrwxrwx 1 amrit amrit 1732 2011-07-18 23:24 harbhag.css -rwxrwxrwx 1 amrit amrit 6054 2011-07-18 23:24 harbhag_predictive.js -rwxrwxrwx 1 amrit amrit 341 2011-07-18 23:25 image_create.php drwxrwxrwx 2 amrit amrit 4096 2011-08-01 22:12 images -rwxrwxrwx 1 amrit amrit 10032 2011-07-18 23:25 index.php -rwxrwxrwx 1 amrit amrit 10032 2011-07-18 23:25 index.php_20110706 -rwxrwxrwx 1 amrit amrit 5395 2011-07-18 23:25 insert.php -rwxrwxrwx 1 amrit amrit 11685 2011-07-18 23:24 install.php -rwxrwxrwx 1 amrit amrit 84362 2011-07-18 23:25 jquery-1.5.min.js -rwxrwxrwx 1 amrit amrit 208229 2011-07-18 23:24 jquery_ui.js drwxrwxrwx 2 amrit amrit 4096 2011-08-01 22:12 languages drwxrwxrwx 3 amrit amrit 4096 2011-08-01 22:12 lib -rwxrwxrwx 1 amrit amrit 16945 2011-07-18 23:28 list.php -rwxrwxrwx 1 amrit amrit 17754 2011-07-18 23:28 list.php~ -rwxrwxrwx 1 amrit amrit 525 2011-07-18 23:24 lookup.php -rwxrwxrwx 1 amrit amrit 3953 2011-07-18 23:25 mailsend.php -rwxrwxrwx 1 amrit amrit 11558 2011-07-18 23:25 mailto.php drwxrwxrwx 2 amrit amrit 4096 2011-08-01 22:12 mugshots -rwxrwxrwx 1 amrit amrit 16005 2011-07-18 23:18 options.php drwxrwxrwx 2 amrit amrit 4096 2011-08-01 22:12 raiBackup -rwxrwxrwx 1 amrit amrit 7209 2011-07-18 23:24 register.php -rwxrwxrwx 1 amrit amrit 2852 2011-07-18 23:25 reset_password.php -rwxrwxrwx 1 amrit amrit 14968 2011-07-18 23:24 save.php -rwxrwxrwx 1 amrit amrit 4652 2011-07-18 23:24 scratchpad.php -rwxrwxrwx 1 amrit amrit 6072 2011-07-18 23:25 search.php -rwxrwxrwx 1 amrit amrit 6351 2011-07-18 23:24 sendsms.php -rwxrwxrwx 1 amrit amrit 6274 2011-07-18 23:18 sendsms.php~ -rwxrwxrwx 1 amrit amrit 3227 2011-07-18 23:24 show_sent.php drwxrwxrwx 8 amrit amrit 4096 2011-08-01 22:12 sms drwxrwxrwx 2 amrit amrit 4096 2011-08-01 22:12 sms_backup -rwxrwxrwx 1 amrit amrit 422 2011-07-18 23:18 student_search.php -rwxrwxrwx 1 amrit amrit 4589 2011-07-18 23:24 styles.css -rwxrwxrwx 1 amrit amrit 10716 2011-07-18 23:25 upgrade.php -rwxrwxrwx 1 amrit amrit 21680 2011-07-18 23:26 users.php I changed the permission to 775 and now i can access it. But here i got another error.I have imported a file in db and i can see tables in mysql database.When i try to access /var/www it is accessible but it gives the error as: The following error occurred: An error occurred while trying to connect to the MySQL server. MySQL returned the following error information: Access denied for user 'root'@'localhost' (using password: YES) (error #1045) If necessary, please press the BACK button on your browser to return to the previous screen and correct any possible mistakes. If you still need help, or you believe this to be a bug, please consult the Author. 1.04e | | Thanks amritpalpathak.blogspot.com |
All times are GMT -5. The time now is 05:28 AM. |