Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache 2.0.49 Issue(s)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Spaz17
n00b
n00b


Joined: 01 Jan 2004
Posts: 41
Location: /home/spaz

PostPosted: Tue Apr 06, 2004 8:48 pm    Post subject: Apache 2.0.49 Issue(s) Reply with quote

I recently formatted my web server (I'm still trying to figure out why), and when I reinstalled Gentoo, I emerged Apache 2.0.49. I had been running 2.0.48 on a similar Gentoo installation earlier.

I'm having two errors with Apache now:

1.) I can only restart the service once.

Code:

spaz@pyschopompus spaz $ su
Password:
root@pyschopompus spaz # /etc/init.d/apache2 restart
 * Stopping apache2...                                                    [ ok ] * Starting apache2...                                                    [ ok ]root@pyschopompus spaz # /etc/init.d/apache2 restart
 * Stopping apache2...                                                    [ ok ] * Starting apache2...
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs                                                       [ !! ]
root@pyschopompus spaz #


My vhosts section looks something like this:

Code:

NameVirtualHost *:80
                                                                               
<VirtualHost *:80>
DocumentRoot /var/www/html/spazticenterprises.com
ServerName spazticenterprises.com
ServerAlias www.spazticenterprises.com
</VirtualHost>


...which may or may not have someting to do with that.

After I restart it twice and it fails to load, I have to restart the system entirely. Apache loads at boot.

2.) I'm having permissions errors.
Code:

Forbidden

You don't have permission to access / on this server.
Apache/2.0.49 (Gentoo/Linux) Server at spazticenterprises.com Port 80


That's the output I get when I'm trying to access it from a web browser. I haven't changed the config files too much, and the indexes option is disabled by default. I do have my directory indexes set up correctly, though. The permissions of the directory with the documents are set 0775, which is pretty liberal, but I'm testing it right now.
Back to top
View user's profile Send private message
kcarlson
n00b
n00b


Joined: 10 Mar 2003
Posts: 44

PostPosted: Tue Apr 06, 2004 9:14 pm    Post subject: Re: Apache 2.0.49 Issue(s) Reply with quote

Quote:
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down


Something is listening on port 80. Find out what it is. After stopping apache, try as root:

Code:
ps -ef | grep apache
netstat -pan | grep apache
netstat -pan | grep :80


Quote:
Unable to open logs [ !! ]

This is disconcerting. Check the ServerRoot & ErrorLog parameters in your /etc/apache2/conf/apache2.conf file. The directory ServerRoot/ErrorLog must exist.
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Tue Apr 06, 2004 10:25 pm    Post subject: Reply with quote

I'm currently having the same problem as Spazs second problem
i'm trying to make apache show an index of / when i go to my server
but instead i get the
Code:
Forbidden
You don't have permission to access / on this server.


--------------------------------------------------------------------------------

Apache/2.0.49 (Gentoo/Linux) Server at The_Loserkid Port 8080


error, i've been trying for hours now to make it work
read practically the entire manual from apache etc
i've been trying hundreds (litterally) of combinations and it still wont frigging work, i'm near to giving up and kick the entire thing in the arse

this is what i've finally come up with, and i'm positive this HAS to work but for some reason it doesnt :x
Code:
<Directory />
  Options Indexes
  AllowOverride None
 <IfModule mod_access.c>
  Order allow,deny
  Allow from all
 </IfModule>
</Directory>


this should work isn't it????

please help both of us
Back to top
View user's profile Send private message
bone
Apprentice
Apprentice


Joined: 07 Jun 2002
Posts: 255
Location: Midwest, USA

PostPosted: Tue Apr 06, 2004 10:58 pm    Post subject: Reply with quote

Your problem is that for it to process the "Order" and "Allow" parts of your <Directory> section below, it has to have the module mod_access loaded. I would check to confirm that this is loading correctly and or not erroring out.

The_Loserkid wrote:
I'm currently having the same problem as Spazs second problem

Code:

<Directory />
  Options Indexes
  AllowOverride None
 <IfModule mod_access.c>
  Order allow,deny
  Allow from all
 </IfModule>
</Directory>


this should work isn't it????
please help both of us


Last edited by bone on Tue Apr 06, 2004 11:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Tue Apr 06, 2004 11:13 pm    Post subject: Reply with quote

bone wrote:
Your problem is that for it to process the "Order" and "Allow" parts of your <Directory> section below, it has to have the module mod_access loaded. I would check to confirm that this is loading correctly and or not erroring out.


i guess it's not cos when i place a .jpg in my htdocs folder and i type the entire url in my internet explorer i can access the file
_________________
Arma virumque cano, Troiae qui primus ab oris
Back to top
View user's profile Send private message
bone
Apprentice
Apprentice


Joined: 07 Jun 2002
Posts: 255
Location: Midwest, USA

PostPosted: Tue Apr 06, 2004 11:53 pm    Post subject: Reply with quote

What errors are in your access_log and error_log when attempting to view the DocumentRoot or VirtualHost directory?


The_Loserkid wrote:
bone wrote:
Your problem is that for it to process the "Order" and "Allow" parts of your <Directory> section below, it has to have the module mod_access loaded. I would check to confirm that this is loading correctly and or not erroring out.


i guess it's not cos when i place a .jpg in my htdocs folder and i type the entire url in my internet explorer i can access the file
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Tue Apr 06, 2004 11:55 pm    Post subject: Reply with quote

bone wrote:
What errors are in your access_log and error_log when attempting to view the DocumentRoot or VirtualHost directory?


how do i check ?
_________________
Arma virumque cano, Troiae qui primus ab oris
Back to top
View user's profile Send private message
bone
Apprentice
Apprentice


Joined: 07 Jun 2002
Posts: 255
Location: Midwest, USA

PostPosted: Wed Apr 07, 2004 12:16 am    Post subject: Reply with quote

If the URL that you are trying to access is your main DocumentRoot, then check your logs directory, if its a VirtualHost then you might have an alternative log file/directory specifed for that VirtualHost in which case you would have to check there.
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Wed Apr 07, 2004 9:15 am    Post subject: Reply with quote

bone wrote:
If the URL that you are trying to access is your main DocumentRoot, then check your logs directory, if its a VirtualHost then you might have an alternative log file/directory specifed for that VirtualHost in which case you would have to check there.


here's what the logs says when i tried to acces /
Code:
[Wed Apr 07 11:21:21 2004] [error] [client 192.168.0.2] Directory index forbidden by rule: /var/www/localhost/htdocs/


client 192.168.0.2 is my computer
_________________
Arma virumque cano, Troiae qui primus ab oris
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Wed Apr 07, 2004 9:22 am    Post subject: Reply with quote

The_Loserkid wrote:
Code:
<Directory />
  Options Indexes
  AllowOverride None
 <IfModule mod_access.c>
  Order allow,deny
  Allow from all
 </IfModule>
</Directory>


this should work isn't it????

please help both of us


Try using <Directory /var/www/localhost/htdocs>
Or, simply find that section in /etc/conf/commonapache2.conf and add Indexes to the Options
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
The_Loserkid
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 101
Location: Merksem, Belgium

PostPosted: Wed Apr 07, 2004 9:42 am    Post subject: Reply with quote

the <Directory ....> thing i pasted was from my commonapache2.conf file
_________________
Arma virumque cano, Troiae qui primus ab oris
Back to top
View user's profile Send private message
kcarlson
n00b
n00b


Joined: 10 Mar 2003
Posts: 44

PostPosted: Sun Apr 11, 2004 2:57 am    Post subject: apache problems Reply with quote

I found that I was better off leaving most options unchanged in commonapache2.conf and apache2.conf -> and then creating a virtual host for any sites on my domain.

The Important bits are:
Code:
/etc/apache2/conf/apache2.conf
###
### Virtual Hosts
###
# We include different templates for Virtual Hosting. Have a look in the
# vhosts directory and modify to suit your needs.
Include conf/vhosts/vhosts.conf
#Include conf/vhosts/dynamic-vhosts.conf
#Include conf/vhosts/virtual-homepages.conf


Code:
/etc/apache2/conf/vhosts/vhosts.conf
...
include conf/vhosts/your_site_name.conf


Code:
/etc/apache2/conf/vhosts/your_site_name.conf
<VirtualHost *:80>

        ServerName your_site_name
        ServerAlias www.your_site_name
        ServerAdmin webmaster@localhost

        # Directories
        DocumentRoot "/share/web/"
        <Directory />
                Options -All -Multiviews +Followsymlinks +Includes +Indexes
                Allow from all
        </Directory>
</VirtualHost>


- If you can access a single file directly from a URL ( http://my_site.com/my_jpeg.jpg ) successfully, then you are accessing the web site as intended.

- The "Directory index forbidden by rule" error is apache saying that you do not have a default web page in that location, and that apache is not configured to provide essentially a 'dir' or 'ls' listing of your htdocs directory. The +Indexes option above is what allows that, if that is actually what you intend.
-Make sure there is no .htaccess file in your htdocs directory that forbids this as well.

- You likely should just make a default web document in your htdocs directory. Default documents are parsed in the order found by the apache directive DirectoryIndex, found in the commonapache2.conf file.
( DirectoryIndex index.html index.html.var index.php index.php3 index.shtml index.cgi index.pl index.htm Default.htm default.htm
)

Hope some of this helped.
Back to top
View user's profile Send private message
infecticide
Apprentice
Apprentice


Joined: 10 Mar 2004
Posts: 262
Location: Regina, SK Canada

PostPosted: Tue Apr 20, 2004 9:58 am    Post subject: Reply with quote

I've done as shown above and tried the VirtualHosts.

Still no luck.

I have all my hosted files on a FAT32 partition that I dual boot WinXP from and it seems to me that this could be a problem with the permissions set in fstab or something?

I tried the chmod 777 /mnt/windows/htdocs

But it still gives me 403.

access_log
Code:

127.0.0.1 - - [20/Apr/2004:03:52:16 -0600] "GET / HTTP/1.1" 403 406 "-" "Mozilla/5.0 (compatible; Konqueror/3.2; Linux 2.4.25-gentoo) (KHTML, like Gecko)"


error_log
Code:

[Tue Apr 20 03:52:05 2004] [notice] Apache/2.0.49 (Gentoo/Linux) configured -- resuming normal operations
[Tue Apr 20 03:52:16 2004] [error] [client 127.0.0.1] (13)Permission denied: access to / denied



Any pointers? Thanks in advance.
Back to top
View user's profile Send private message
infecticide
Apprentice
Apprentice


Joined: 10 Mar 2004
Posts: 262
Location: Regina, SK Canada

PostPosted: Tue Apr 20, 2004 10:26 am    Post subject: Reply with quote

Igot curious about those fstab permissions and took a look around. Found a fstab tag gid=users, uid=0000, these did the trick. Apache and mySQL now have no problem accessing the files.
Back to top
View user's profile Send private message
kcarlson
n00b
n00b


Joined: 10 Mar 2003
Posts: 44

PostPosted: Sat Apr 24, 2004 1:00 am    Post subject: Reply with quote

infecticide wrote:
I have all my hosted files on a FAT32 partition that I dual boot WinXP from and it seems to me that this could be a problem with the permissions set in fstab or something?

I tried the chmod 777 /mnt/windows/htdocs

But it still gives me 403.

Any pointers? Thanks in advance.


Possibly a few pointers. Once you mount a partition, the permissions can change based on who mounts it, etc. I do not know if WinXP will try to muck with the files either.

1. First best advice: FAT32 sucks. Use NTFS for WinXP. Make a new partition for Linux and use ext3 or reiserfs.

2. Change your fstab to a line similar to:
/dev/hdxx /mnt/windows vfat rw,user,uid=___,gid=_____

- hdxx is of course your drive and partition. Ex. /dev/hdc3
- fill in the blanks for the uid and gid of your apache user and group. On my box apache runs as user:apache, group: apache. To find the uid/gid do this:

cat /etc/passwd | grep apache
apache:x:81:81:apache:/home/httpd:/bin/false

cat /etc/group | grep apache
apache::81:apache,jsmith

so I would use uid=81, and coincidentally gid=81.

This should help set permissions to be accessible to your web server. I don't know if this will solve your problem, but I've never attempted to deal with linux filesystem priviledges on a FAT32 partition either.

later.
Back to top
View user's profile Send private message
syscrash
Guru
Guru


Joined: 14 Apr 2003
Posts: 541

PostPosted: Sat Apr 24, 2004 2:05 am    Post subject: Reply with quote

I am also experiencing the same issue (#1).
Code:
sigma apache2 # /etc/init.d/apache2 restart
 * Starting apache2...                                                    [ ok ]
sigma apache2 # netstat -pan | grep :80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      11618/apache2       
tcp      427      0 192.168.0.6:80          192.168.0.4:33566       CLOSE_WAIT  -                   
sigma apache2 # /etc/init.d/apache2 stop
 * Stopping apache2...                                                    [ ok ]
sigma apache2 # netstat -pan | grep :80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      11618/apache2       
tcp      427      0 192.168.0.6:80          192.168.0.4:33566       CLOSE_WAIT  -                   
sigma apache2 # killall apache2
sigma apache2 # netstat -pan | grep :80
sigma apache2 # netstat -pan | grep :80
sigma apache2 # netstat -pan | grep apache2
sigma apache2 # /etc/init.d/apache2 start 
 * Starting apache2...                                                    [ ok ]
sigma apache2 # netstat -pan | grep apache2
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      11724/apache2       
sigma apache2 #


It seems to load the first time around though, but it is a bit of a hassle for me to reboot the server.

Any ideas? Is it an apache bug?
Back to top
View user's profile Send private message
compucoder
Apprentice
Apprentice


Joined: 16 Sep 2002
Posts: 246
Location: London, Canada

PostPosted: Sat Apr 24, 2004 2:36 am    Post subject: Reply with quote

I had some issues like this with apache 2 and it ended resolving the problem by adding apache to the users group and also making sure the docroot and virtual host root was owned by 'root'.

Might want to give this a try.
Back to top
View user's profile Send private message
Spaz17
n00b
n00b


Joined: 01 Jan 2004
Posts: 41
Location: /home/spaz

PostPosted: Sat Apr 24, 2004 2:34 pm    Post subject: Reply with quote

I'm back.

I was away for a while. Thanks for stealing me thread ;)

I resolved my first issue, but I don't remember how, since it was such a long time ago.

However, I'm still having issues trying to actually serve my files. I can only do so out of the default /var/www/localhost/htdocs directory. When I change the DocumentRoot in my apache2.conf file, I get that forbidden error. The permission of the folder I change it to are the same as that of htdocs.

Ideas?
Back to top
View user's profile Send private message
kcarlson
n00b
n00b


Joined: 10 Mar 2003
Posts: 44

PostPosted: Mon Apr 26, 2004 4:29 pm    Post subject: Reply with quote

Spaz17 wrote:

However, I'm still having issues trying to actually serve my files. I can only do so out of the default /var/www/localhost/htdocs directory. When I change the DocumentRoot in my apache2.conf file, I get that forbidden error. The permission of the folder I change it to are the same as that of htdocs.
Ideas?


Can you post the relevant lines from the access/error logs found in /var/log/apache2/ ?
Back to top
View user's profile Send private message
Chris W
l33t
l33t


Joined: 25 Jun 2002
Posts: 972
Location: Brisbane, Australia

PostPosted: Mon Apr 26, 2004 10:34 pm    Post subject: Reply with quote

Spaz17, you are most likely getting the 403 errors because Apache does not have permission to access the contents of the OS directory /var/www/html/spazticenterprises.com (The / in the 403 error refers to the document root not the real root). Unless you have specifically allowed it, the default entries in commonapache.conf disallow it. The disallowing entry looks like:
Code:
<Directory />
  Options -All -Multiviews
  AllowOverride None
  <IfModule mod_access.c>
    Order deny,allow
    Deny from all
  </IfModule>
</Directory>
where the <Directory> directive applies to the operating system root directory and all subordinates. You need to allow access to /var/www/html/spazticenterprises.com in same fashion that access is allowed to the /var/www/localhost/htdocs tree. For example:
Code:
<Directory /var/www/html/spazticenterprises.com>
    Options -Indexes FollowSymLinks MultiViews
    AllowOverride All
    <IfModule mod_access.c>
      Order allow,deny
      Allow from all
    </IfModule>
</Directory>


Hope this helps.
_________________
Cheers,
Chris W
"Common sense: The collection of prejudices acquired by age 18." -- Einstein
Back to top
View user's profile Send private message
Spaz17
n00b
n00b


Joined: 01 Jan 2004
Posts: 41
Location: /home/spaz

PostPosted: Wed Apr 28, 2004 9:24 pm    Post subject: Reply with quote

Wow, I swear I posted a response to this a long time ago.

Well, thanks Chris W, that's what it was. It's weird that I've never had to do that before, though.

But my first error seems to still be appearing, though.

After stopping Apache:

Code:

pyschopompus root # ps -ef | grep apache
root     29240     1  0 21:52 ?        00:00:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache   29360 29240  0 21:54 ?        00:00:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache   29361 29240  0 21:54 ?        00:00:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache   29362 29240  0 21:54 ?        00:00:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache   29363 29240  0 21:54 ?        00:00:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache   29364 29240  0 21:54 ?        00:00:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache   29365 29240  0 21:54 ?        00:00:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
root     29402 29141  0 21:57 pts/2    00:00:00 grep apache
pyschopompus root # netstat -pan | grep apache
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      29240/apache2
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      29240/apache2
unix  2      [ ACC ]     STREAM     LISTENING     22130  29360/apache2       /var/run/cgisock
pyschopompus root # netstat -pan | grep :80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      29240/apache2
pyschopompus root #


Eh?
Back to top
View user's profile Send private message
Chris W
l33t
l33t


Joined: 25 Jun 2002
Posts: 972
Location: Brisbane, Australia

PostPosted: Wed Apr 28, 2004 10:13 pm    Post subject: Reply with quote

Does Apache _really_ stop if you use:
Code:
# apache2ctl -k stop

Is your /etc/init.d/apache2 up to date? Have you been running etc-update and merging changes?
Code:
ptolemy root # md5sum /etc/init.d/apache2
ec04063f55e79fc73de02c4f4647b135  /etc/init.d/apache2

Perhaps there is a permission problem with the PID file:
Code:
ptolemy root # ls -l /var/run/apache2.pid
-rw-r--r--    1 root     root            6 Apr 27 13:35 /var/run/apache2.pid

_________________
Cheers,
Chris W
"Common sense: The collection of prejudices acquired by age 18." -- Einstein
Back to top
View user's profile Send private message
infecticide
Apprentice
Apprentice


Joined: 10 Mar 2004
Posts: 262
Location: Regina, SK Canada

PostPosted: Fri Apr 30, 2004 5:53 am    Post subject: Reply with quote

Just incase anyone is wondering how I solved my issue of serving Apache2 from FAT32. I had to add gid=users, umask=0000 to fstab.
Back to top
View user's profile Send private message
Larcen
Apprentice
Apprentice


Joined: 21 Mar 2004
Posts: 174

PostPosted: Fri May 07, 2004 4:02 am    Post subject: Reply with quote

Help!

..now that thats taken care of.

I was running on FreeBSD for months, and then decided to migrate to Gentoo. Very good move.. BUT I can't seem to get VirtualHosts working under Gentoo. FreeBSD was simple, installed apache2 and set it up, boom, done. Worked fine. But Gentoo.. I dunno whats goin on. in using the vhosts include, or putting my virtualhosts right in apache2.conf I either get.. Permissioned denied trying to access / on this server also there was an error in the error document handling etc etc.. OR I just keep getting the default htdocs directory for all addresses. www.* test.* whatever.domain.com Any suggestions?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum