Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Apache server hell - help!

  1. #1
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,364
    Blog Entries
    2

    Apache server hell - help!

    [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:

    Code:
    Servername localhost1
    AddHandler application/x-httpd-php .php
    AddHandler application/x-httpd-php-source .phps
    DocumentRoot /mysite
    Unfortunately, I get a 403 error "Forbidden - you don't have permission to access / on this server."

    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:

    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>
    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.

    Can anyone suggest a fix? Thanks in advance.
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    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

  2. #2
    Low Bitrate pulsarsimon's Avatar
    Join Date
    Nov 2009
    Location
    Melbourne Australia
    Posts
    63
    whan you created the /mysite dir, did you chmod/chown the folder to allow access to apache, etc?
    i.e.
    Code:
    chmod 755 /mysite
    etc..
    MacMini in an Alfa? - Why not!

  3. #3
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,364
    Blog Entries
    2
    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/
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    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

  4. #4
    Low Bitrate pulsarsimon's Avatar
    Join Date
    Nov 2009
    Location
    Melbourne Australia
    Posts
    63
    can you access it from 127.0.0.1?
    MacMini in an Alfa? - Why not!

  5. #5
    Low Bitrate pulsarsimon's Avatar
    Join Date
    Nov 2009
    Location
    Melbourne Australia
    Posts
    63
    this is from mine:
    Code:
    ...
    
    Listen 80
    
    ...
    Alias /alfa "/store/Car Disc"
    
    <Directory "/store/Car Disc">
        Options Indexes FollowSymLinks Multiviews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    and from ls

    drwxr-xr-x 13 nobody nobody 4096 Nov 5 23:29 Car Disc
    MacMini in an Alfa? - Why not!

  6. #6
    Low Bitrate pulsarsimon's Avatar
    Join Date
    Nov 2009
    Location
    Melbourne Australia
    Posts
    63
    just looked at your config up there, is the caps on "Allow from all" important?
    MacMini in an Alfa? - Why not!

  7. #7
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,364
    Blog Entries
    2
    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:

    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 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.

    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!
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    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

  8. #8
    FLAC
    Join Date
    May 2006
    Location
    Calgary, Alberta
    Posts
    1,718
    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

  9. #9
    Maximum Bitrate Crinos's Avatar
    Join Date
    Mar 2009
    Location
    Kristiansand, Norway
    Posts
    489
    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 /

  10. #10
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,364
    Blog Entries
    2
    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!
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    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

Page 1 of 3 123 LastLast

Similar Threads

  1. GPSTracker on home server
    By lambosprit in forum GPS
    Replies: 319
    Last Post: 07-12-2012, 05:35 PM
  2. Lilliput screen on Ubuntu
    By yam125 in forum Linux
    Replies: 13
    Last Post: 06-13-2011, 10:19 AM
  3. XBOX + Apache v2.6 + M1-ATX = problems?
    By arionl in forum Power Supplies
    Replies: 10
    Last Post: 07-18-2006, 11:46 AM
  4. Windows Server
    By Quattro in forum Off Topic
    Replies: 11
    Last Post: 04-17-2006, 11:22 PM
  5. File/web/print Server
    By Quattro in forum Off Topic
    Replies: 7
    Last Post: 04-15-2005, 09:26 PM

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
  •