whan you created the /mysite dir, did you chmod/chown the folder to allow access to apache, etc?
i.e.
etc..Code:chmod 755 /mysite
[Sigh] I hate to ask for help here but I know somebody has the answer and I've invested hours in this problem.
I've set up my apache2 server and have had it working without issue but I wanted to change the location of the document root for it because its in the root user location and I'm having trouble ftp'ing data into that folder. I also know that it isn't appropriate to use the root user for the web location. The apache2 install is in /etc/apache2
So, I've changed my apache2 http.conf to read the following:
Unfortunately, I get a 403 error "Forbidden - you don't have permission to access / on this server."Code:Servername localhost1 AddHandler application/x-httpd-php .php AddHandler application/x-httpd-php-source .phps DocumentRoot /mysite
I've tried other locations for the folder and restarted the server using the apache2ctl restart command each time. I know it reads the file because if I put an invalid path in the DocumentRoot it will tell me so.
I've also added /mysite to my sites-enabled folder and included Order allow,deny and Allow from all in both the default file and the mysite file. The mysite file reads as follows:
At this point, I've tried to set everything back to the original working setup but at this point I am denied access for all options. I know I have a permission problem but I can't figure it out.Code:<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /mysite <Directory /> Options FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> <Directory /mysite> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/errormysite.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/accessmysite.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Allow from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost>
Can anyone suggest a fix? Thanks in advance.
Want to:
-Find out about the new iBug iPad install?
-Find out about carPC's in just 5 minutes? View the Car PC 101 video
whan you created the /mysite dir, did you chmod/chown the folder to allow access to apache, etc?
i.e.
etc..Code:chmod 755 /mysite
MacMini in an Alfa? - Why not!
I thought I did. Just tried it again and no luck.
Error log:
Code:[Sun Nov 15 01:05:28 2009] [error] [client 192.168.1.5] (13)Permission denied: access to / denied [Sun Nov 15 01:05:28 2009] [error] [client 192.168.1.5] (13)Permission denied: access to /favicon.ico denied, referer: http://192.168.1.4/
Want to:
-Find out about the new iBug iPad install?
-Find out about carPC's in just 5 minutes? View the Car PC 101 video
can you access it from 127.0.0.1?
MacMini in an Alfa? - Why not!
this is from mine:
and from lsCode:... Listen 80 ... Alias /alfa "/store/Car Disc" <Directory "/store/Car Disc"> Options Indexes FollowSymLinks Multiviews AllowOverride None Order allow,deny Allow from all </Directory>
drwxr-xr-x 13 nobody nobody 4096 Nov 5 23:29 Car Disc
MacMini in an Alfa? - Why not!
just looked at your config up there, is the caps on "Allow from all" important?
MacMini in an Alfa? - Why not!
Okay! Progress!! Looking inside my 000-default file and the mysite file in the sites-enabled folder, I decided to trim down the various entries in it to just focus on my single folder. I had been hesitant to do this because I thought I might break something. But then I figured it was broken already so...
Turns out it is using the 000-default file for access. I removed the mysite file and changed the 000-default file to the following:
Code:<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /mysite <Directory /mysite>> Options Indexes FollowSymLinks Multiviews AllowOverride None Order Allow,Deny Allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined </VirtualHost>
I can now view the default index.html file. However, when I ftp any other file (such as 'test.html') into the /mysite directory and try to view it, I get the 403 error. I ran a chown 755 /mysite on the folder but it didn't help.
Also, I tried editing the 000-default file so it pointed at a folder under user /home/bugbyte/var/www but got the 403 error.
I appear to be missing the .htaccess file. Here's the log output:
You can see where I tried to use /home/bugbyte/var and it failed to find a .htaccess file. After doing some reading, it isn't supposed to check for a .htaccess file if you have AllowOverride set to None.Code:[Mon Nov 16 15:29:13 2009] [crit] [client 192.168.1.11] (13)Permission denied: /home/bugbyte/var/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable [Mon Nov 16 15:29:13 2009] [crit] [client 192.168.1.11] (13)Permission denied: /home/bugbyte/var/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://192.168.1.4/ [Mon Nov 16 15:29:48 2009] [crit] [client 192.168.1.11] (13)Permission denied: /home/bugbyte/var/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable [Mon Nov 16 15:29:48 2009] [crit] [client 192.168.1.11] (13)Permission denied: /home/bugbyte/var/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://192.168.1.4/ [Mon Nov 16 15:31:57 2009] [notice] SIGHUP received. Attempting to restart [Mon Nov 16 15:31:58 2009] [notice] Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4 with Suhosin-Patch configured -- resuming normal operations [Mon Nov 16 15:32:01 2009] [error] [client 192.168.1.11] File does not exist: /mysite/favicon.ico, referer: http://192.168.1.4/ [Mon Nov 16 15:34:05 2009] [error] [client 192.168.1.11] (13)Permission denied: file permissions deny server access: /mysite/test.html
You can also see where I changed it back to /mysite and tried to access the test.html file and got file permissions denied.
So, summary is that I can now read the index.html file in /mysite by typing: http://192.168.1.4 but can't read any other files when I type: http://192.168.1.4/test.html. Getting closer, but any suggestions are again greatly appreciated!
Want to:
-Find out about the new iBug iPad install?
-Find out about carPC's in just 5 minutes? View the Car PC 101 video
Whenever I restart Apache I use "sudo etc/init.d/apache2 restart" and it restarts the service. You're running Ubuntu on that Sheeva plug right? And this is what you're configuring? You could always reinstall Apache, it takes 2 minutes.
Ampie Case
2.5" Hard Drive 80GB Samsung 5400RPM
256 MB DDR2 PC5400
Xenarc 700TSV - VGA Monitor
Intel D945GCLF Motherboard
M2-ATX-HV
2005 Honda Civic
Try this basic .htaccess file...
Code:RewriteEngine On RewriteCond %{HTTP_HOST} localhost$ [NC] RewriteRule ^.*$ http://localhost%{REQUEST_URI} [R=permanent,L] ErrorDocument 400 / ErrorDocument 401 / ErrorDocument 403 / ErrorDocument 404 / ErrorDocument 500 /
Okay, success again! I reinstalled Apache2 but had the same issue. However, a little more searching and I found that chmod rather than chown was the right entry. Here's the exact entry that fixed the permissions:
chmod -R 755 /mysite
Its working right now, so I'm a little hesitant to go change it to /home/bugbyte/var/www! This is just a temporary test anyhow, so I think I'll leave well enough alone and actually accomplish something for a change.
Thanks for your help pulsarsimon and Maheriano!
Want to:
-Find out about the new iBug iPad install?
-Find out about carPC's in just 5 minutes? View the Car PC 101 video
Bookmarks