Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache configuration questions
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
oldefortran
l33t
l33t


Joined: 28 Feb 2004
Posts: 652

PostPosted: Tue Jan 30, 2007 11:54 am    Post subject: Apache configuration questions Reply with quote

Hello.
I've just installed apache 2.0.58 and php but I get
Unable to read configuration file: /etc/apache2/conf/apache2.conf
when trying to start apache.
Shouldn't this file be installed by default?
How can I fix this?

I would also like to ask: how can I make the apache server only be accessible from the computer that is running apache and I'm working on?
Back to top
View user's profile Send private message
tobr
Guru
Guru


Joined: 29 May 2006
Posts: 330

PostPosted: Tue Jan 30, 2007 11:58 am    Post subject: Re: Apache configuration questions Reply with quote

oldefortran wrote:
Hello.
I've just installed apache 2.0.58 and php but I get
Unable to read configuration file: /etc/apache2/conf/apache2.conf
when trying to start apache.
Shouldn't this file be installed by default?
How can I fix this?

Shouldn't the configuration file be /etc/apache2/httpd.conf? For me it's there and not in conf/apache2.conf.

Quote:
I would also like to ask: how can I make the apache server only be accessible from the computer that is running apache and I'm working on?

Have a look at the "Listen" directive. Remove "Listen *:80" or similar and add "Listen 127.0.0.1:80". All in /etc/apache2/httpd.conf, of course.
Back to top
View user's profile Send private message
oldefortran
l33t
l33t


Joined: 28 Feb 2004
Posts: 652

PostPosted: Tue Jan 30, 2007 12:03 pm    Post subject: Reply with quote

Where can I find the init script for apache 2.0.58?
The /etc/init.d/apache2 script was some shit from earlier apache so I removed it.
Back to top
View user's profile Send private message
oldefortran
l33t
l33t


Joined: 28 Feb 2004
Posts: 652

PostPosted: Tue Jan 30, 2007 12:08 pm    Post subject: Re: Apache configuration questions Reply with quote

Quote:

Have a look at the "Listen" directive. Remove "Listen *:80" or similar and add "Listen 127.0.0.1:80". All in /etc/apache2/httpd.conf, of course.


In httpd.conf it writes
Listen 80
and not like you write
Listen *:80
Are these two ways of writing equivalent?
Back to top
View user's profile Send private message
oldefortran
l33t
l33t


Joined: 28 Feb 2004
Posts: 652

PostPosted: Tue Jan 30, 2007 12:38 pm    Post subject: Reply with quote

Alright, now that works. but at start it says

[Tue Jan 30 13:35:28 2007] [warn] NameVirtualHost *:80 has no VirtualHosts

and when I visit localhost I get 404 error and in the log it says

[error] [client 127.0.0.1] File does not exist: /usr/htdocs

Somewhere there is something to configure... but where and what?
Back to top
View user's profile Send private message
oldefortran
l33t
l33t


Joined: 28 Feb 2004
Posts: 652

PostPosted: Tue Jan 30, 2007 1:06 pm    Post subject: Reply with quote

I might have solved the last problem now by removing the lines
<IfDefine>
and
</IfDefine>
from the file
vhosts.d/00_default_vhost.conf
Back to top
View user's profile Send private message
tobr
Guru
Guru


Joined: 29 May 2006
Posts: 330

PostPosted: Tue Jan 30, 2007 4:23 pm    Post subject: Re: Apache configuration questions Reply with quote

oldefortran wrote:
In httpd.conf it writes
Listen 80
and not like you write
Listen *:80
Are these two ways of writing equivalent?

Yes.
Quote:
Alright, now that works. but at start it says
[Tue Jan 30 13:35:28 2007] [warn] NameVirtualHost *:80 has no VirtualHosts
and when I visit localhost I get 404 error and in the log it says
[error] [client 127.0.0.1] File does not exist: /usr/htdocs
Somewhere there is something to configure... but where and what?


So obviously your DocumentRoot (or some other configured dir) is pointing to a non-existing file. Change your DocumentRoot or create /usr/htdocs. And of course, you have to modify your vhosts. They are no longer VirtualHost *:80 but of course 127.0.0.1:80, because you don't listen to *:80 any more.

Quote:
I might have solved the last problem now by removing the lines
<IfDefine>
and
</IfDefine>
from the file
vhosts.d/00_default_vhost.conf

There's a reason that there's an IfDefine directive. Read the comments in /etc/conf.d/apache2 and activate the vhosts or change your httpd.conf so that you don't need them. Read the fine apache manual for details about directions before removing/changing them. Really. http://httpd.apache.org/docs/2.0/. Read and understand the config files. They are commented. It's a bit hard the first time, but you will screw up if you don't understand the vhosts concept (I speak from experience :D ). And of course post remaining questions.

Oh and:
Quote:
Where can I find the init script for apache 2.0.58?
The /etc/init.d/apache2 script was some shit from earlier apache so I removed it.

Either re-emerge apache or just fetch the package with emerge --fetchonly and extract the file from /usr/portage/distfiles/apache... (don't know the exact name)
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