View previous topic :: View next topic |
Author |
Message |
oldefortran l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 28 Feb 2004 Posts: 652
|
Posted: Tue Jan 30, 2007 11:54 am Post subject: Apache configuration questions |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
tobr Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/56332675465a04f422527.png)
Joined: 29 May 2006 Posts: 330
|
Posted: Tue Jan 30, 2007 11:58 am Post subject: Re: Apache configuration questions |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
oldefortran l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 28 Feb 2004 Posts: 652
|
Posted: Tue Jan 30, 2007 12:03 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
oldefortran l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 28 Feb 2004 Posts: 652
|
Posted: Tue Jan 30, 2007 12:08 pm Post subject: Re: Apache configuration questions |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
oldefortran l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 28 Feb 2004 Posts: 652
|
Posted: Tue Jan 30, 2007 12:38 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
oldefortran l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 28 Feb 2004 Posts: 652
|
Posted: Tue Jan 30, 2007 1:06 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
tobr Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/56332675465a04f422527.png)
Joined: 29 May 2006 Posts: 330
|
Posted: Tue Jan 30, 2007 4:23 pm Post subject: Re: Apache configuration questions |
|
|
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 ). 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 |
|
![](templates/gentoo/images/spacer.gif) |
|