Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache and localhost set up problems
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dominik_ba
n00b
n00b


Joined: 11 Jan 2008
Posts: 17
Location: rotterdam

PostPosted: Fri Jan 11, 2008 12:51 pm    Post subject: apache and localhost set up problems Reply with quote

hi

i did an emerge world some days ago and since then I cannot accede to my localhost server (public_html and cgi-bin files) in my home directory.

when i try to restart apache I have this error:

"""
* Stopping apache2 ...
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [ ok ]
* Starting apache2 ...
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
"""

Since I emerged the new version of apache things are different, for example my /etc/apache2/httpd.conf file looks differently. I don't know how to enable cgi-bin in my home folder.
Back to top
View user's profile Send private message
elgato319
Guru
Guru


Joined: 15 Sep 2005
Posts: 546

PostPosted: Fri Jan 11, 2008 2:18 pm    Post subject: Reply with quote

apache seems to start fine.

could you post some error messages from var/log/apache2/error_log after you connected to localhost via browser?
Back to top
View user's profile Send private message
dominik_ba
n00b
n00b


Joined: 11 Jan 2008
Posts: 17
Location: rotterdam

PostPosted: Fri Jan 11, 2008 3:27 pm    Post subject: Reply with quote

here are error messages from var/log/apache2/error_log:

[Fri Jan 11 16:18:32 2008] [error] [client 127.0.0.1] File does not exist: /var/www/localhost/htdocs/~dbartkowski
[Fri Jan 11 16:18:33 2008] [error] [client 127.0.0.1] File does not exist: /var/www/localhost/htdocs/~dbartkowski
[Fri Jan 11 16:24:33 2008] [error] [client 127.0.0.1] File does not exist: /var/www/localhost/htdocs/~dbartkowski
[Fri Jan 11 16:24:37 2008] [error] [client 127.0.0.1] File does not exist: /var/www/localhost/htdocs/~dbartkowski
[Fri Jan 11 16:24:40 2008] [error] [client 127.0.0.1] File does not exist: /var/www/localhost/htdocs/~dbartkowski
[Fri Jan 11 16:24:49 2008] [error] [client 127.0.0.1] File does not exist: /var/www/localhost/htdocs/~dbartkowski
[Fri Jan 11 16:24:52 2008] [error] [client 127.0.0.1] File does not exist: /var/www/localhost/htdocs/~dbartkowski

suggestion
the problem is that i want to run my cgi-bin files in the home directory.
Back to top
View user's profile Send private message
dominik_ba
n00b
n00b


Joined: 11 Jan 2008
Posts: 17
Location: rotterdam

PostPosted: Fri Jan 11, 2008 3:41 pm    Post subject: Reply with quote

i think that i have to ask apache to look for localhost in
/home/dbartkowski/public_html/cgi-bin etc......

and not in /var/www/localhost/htdocs/~dbartkowski

I just don't know how to set it up.
Back to top
View user's profile Send private message
upengan78
l33t
l33t


Joined: 27 Jun 2007
Posts: 711
Location: IL

PostPosted: Fri Jan 11, 2008 4:59 pm    Post subject: Reply with quote

what is there in /etc/hosts ?
Back to top
View user's profile Send private message
dominik_ba
n00b
n00b


Joined: 11 Jan 2008
Posts: 17
Location: rotterdam

PostPosted: Fri Jan 11, 2008 8:13 pm    Post subject: Reply with quote

in /etc/host I have this:



# /etc/hosts: Local Host Database
#
# This file describes a number of aliases-to-address mappings for the for
# local hosts that share this file.
#
# In the presence of the domain name service or NIS, this file may not be
# consulted at all; see /etc/host.conf for the resolution order.
#

# IPv4 and IPv6 localhost aliases
127.0.0.1 localhost dbartkowski
::1 localhost

#
# Imaginary network.
#10.0.0.2 myname
#10.0.0.3 myfriend
#
# According to RFC 1918, you can use the following IP networks for private
# nets which will never be connected to the Internet:
#
# 10.0.0.0 - 10.255.255.255
# 172.16.0.0 - 172.31.255.255
# 192.168.0.0 - 192.168.255.255
#
# In case you want to be able to connect directly to the Internet (i.e. not
# behind a NAT, ADSL router, etc...), you need real official assigned
# numbers. Do not try to invent your own network numbers but instead get one
# from your network provider (if any) or from your regional registry (ARIN,
# APNIC, LACNIC, RIPE NCC, or AfriNIC.)
#


thanks
Back to top
View user's profile Send private message
upengan78
l33t
l33t


Joined: 27 Jun 2007
Posts: 711
Location: IL

PostPosted: Fri Jan 11, 2008 8:14 pm    Post subject: Reply with quote

Quote:
::1 localhost


Why is above required ? :?

Can you comment that line and check if your problem persist or not ?
Back to top
View user's profile Send private message
dominik_ba
n00b
n00b


Joined: 11 Jan 2008
Posts: 17
Location: rotterdam

PostPosted: Fri Jan 11, 2008 8:21 pm    Post subject: Reply with quote

I did it and the problem persists
Back to top
View user's profile Send private message
upengan78
l33t
l33t


Joined: 27 Jun 2007
Posts: 711
Location: IL

PostPosted: Fri Jan 11, 2008 8:24 pm    Post subject: Reply with quote

dominik_ba wrote:
I did it and the problem persists


Okay did you write above after trying to restart apache again and seeing the same error ?
Back to top
View user's profile Send private message
dominik_ba
n00b
n00b


Joined: 11 Jan 2008
Posts: 17
Location: rotterdam

PostPosted: Fri Jan 11, 2008 8:33 pm    Post subject: Reply with quote

yes

here is the var_log message from /var/log/apache2/var_log, the last line is when I try to view my sites in the browser, the other ones is when i restart apache on the command line

[Fri Jan 11 21:25:36 2008] [notice] Apache/2.2.6 (Unix) configured -- resuming normal operations
[Fri Jan 11 21:25:40 2008] [notice] caught SIGTERM, shutting down
[Fri Jan 11 21:25:42 2008] [notice] Apache/2.2.6 (Unix) configured -- resuming normal operations
[Fri Jan 11 21:26:40 2008] [notice] caught SIGTERM, shutting down
[Fri Jan 11 21:26:42 2008] [notice] Apache/2.2.6 (Unix) configured -- resuming normal operations
[Fri Jan 11 21:26:48 2008] [error] [client 127.0.0.1] File does not exist: /var/www/localhost/htdocs/~dbartkowski


and that's what returns the terminal when i restart apache2:

* Stopping apache2 ...
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [ ok ]
* Starting apache2 ...
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [ ok ]
Back to top
View user's profile Send private message
upengan78
l33t
l33t


Joined: 27 Jun 2007
Posts: 711
Location: IL

PostPosted: Fri Jan 11, 2008 8:43 pm    Post subject: Reply with quote

Code:
can you post contents of file /etc/apache2

vhosts.d/00_default_vhost.conf

Quote:
Also I would like you to restart network service on machine and try apache restart again


Quote:
and if this does not work then please restart machine
and check if that helps
Back to top
View user's profile Send private message
dominik_ba
n00b
n00b


Joined: 11 Jan 2008
Posts: 17
Location: rotterdam

PostPosted: Fri Jan 11, 2008 9:13 pm    Post subject: Reply with quote

I reboot my computer, still the same

here is the file /etc/apache2/vhosts.d/00_default_vhost.conf



# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

<IfDefine DEFAULT_VHOST>
# see bug #178966 why this is in here

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80

# Use name-based virtual hosting.
NameVirtualHost *:80

# When virtual hosts are enabled, the main host defined in the default
# httpd.conf configuration will go away. We redefine it here so that it is
# still available.
#
# If you disable this vhost by removing -D DEFAULT_VHOST from
# /etc/conf.d/apache2, the first defined virtual host elsewhere will be
# the default.
<VirtualHost *:80>
ServerName localhost
Include /etc/apache2/vhosts.d/default_vhost.include

<IfModule mpm_peruser_module>
ServerEnvironment apache apache
</IfModule>
</VirtualHost>
</IfDefine>

# vim: ts=4 filetype=apache






I found the wrong path "/var/www/localhost/cgi-bin" in:
/etc/apache2/vhosts.d/00_default_ssl_vhost.conf
and in
nano /etc/apache2/vhosts.d/default_vhost.include
Back to top
View user's profile Send private message
upengan78
l33t
l33t


Joined: 27 Jun 2007
Posts: 711
Location: IL

PostPosted: Fri Jan 11, 2008 9:38 pm    Post subject: Reply with quote

Can't figure out what is wrong

what is the value of
APACHE2_OPTS

in /etc/conf.d/apache2
Back to top
View user's profile Send private message
upengan78
l33t
l33t


Joined: 27 Jun 2007
Posts: 711
Location: IL

PostPosted: Fri Jan 11, 2008 9:43 pm    Post subject: Reply with quote

Also check this file for public_html which you wanted to set initially

modules.d/00_mod_userdir.conf in /etc/apache2
Back to top
View user's profile Send private message
dominik_ba
n00b
n00b


Joined: 11 Jan 2008
Posts: 17
Location: rotterdam

PostPosted: Fri Jan 11, 2008 9:47 pm    Post subject: Reply with quote

APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST"


do you think I can modify
00_default_ssl_vhost.conf , 00_default_vhost.conf, default_vhost.include

or those files are being generated...
Back to top
View user's profile Send private message
upengan78
l33t
l33t


Joined: 27 Jun 2007
Posts: 711
Location: IL

PostPosted: Fri Jan 11, 2008 9:54 pm    Post subject: Reply with quote

Quote:


do you think I can modify
00_default_ssl_vhost.conf , 00_default_vhost.conf, default_vhost.include

or those files are being generated..


Yes you can but do not modify them, check the file I mentioned in earlier post...
Back to top
View user's profile Send private message
dominik_ba
n00b
n00b


Joined: 11 Jan 2008
Posts: 17
Location: rotterdam

PostPosted: Fri Jan 11, 2008 10:01 pm    Post subject: Reply with quote

everything seems to be ok here.


/etc/apache2/modules.d/00_mod_userdir.conf


# Settings for user home directories

<IfDefine USERDIR>
<IfModule userdir_module>

# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received. Note that you must also set
# the default access control for these directories, as in the example below.
UserDir public_html

# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

# Suexec isn't really required to run cgi-scripts, but it's a really good
# idea if you have multiple users serving websites...
<IfDefine SUEXEC>
<IfModule suexec_module>
<Directory /home/*/public_html/cgi-bin>
Options ExecCGI
SetHandler cgi-script
</Directory>
</IfModule>
</IfDefine>
</IfModule>
</IfDefine>

# vim: ts=4 filetype=apache
Back to top
View user's profile Send private message
dominik_ba
n00b
n00b


Joined: 11 Jan 2008
Posts: 17
Location: rotterdam

PostPosted: Sun Jan 13, 2008 5:07 pm    Post subject: Reply with quote

for a better documentation, if i emerge apache, the message is as follow;

>>> Original instance of package unmerged safely.
* The default webroot has not been installed into
* /var/www/localhost because the directory already exists
* and we do not want to overwrite any files you have put there.
*
* If you would like to install the latest webroot, please run
* emerge --config =apache-2.2.6-r7
*
>>> www-servers/apache-2.2.6-r7 merged.

>>> No packages selected for removal by clean
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

* Messages for package www-servers/apache-2.2.6-r7:

*
* Selected default MPM: prefork
*
* Please note that you need SysV IPC support in your kernel.
* Make sure CONFIG_SYSVIPC=y is set.
*
* The default webroot has not been installed into
* /var/www/localhost because the directory already exists
* and we do not want to overwrite any files you have put there.
*
* If you would like to install the latest webroot, please run
* emerge --config =apache-2.2.6-r7
*
* GNU info directory index is up-to-date.
* IMPORTANT: 1 config files in '/etc' need updating.
* See the CONFIGURATION FILES section of the emerge
* man page to learn how to update config files.
Back to top
View user's profile Send private message
dominik_ba
n00b
n00b


Joined: 11 Jan 2008
Posts: 17
Location: rotterdam

PostPosted: Sun Jan 13, 2008 5:13 pm    Post subject: Reply with quote

if i follow the instructions
emerge --config =apache-2.2.6-r7
returns this error message




emerge --config =apache-2.2.6-r7



Configuring pkg...

* Installing default webroot to /var/www/localhost
mkdir: cannot create directory `/var': File exists
mkdir: cannot create directory `/var/www': File exists
mkdir: cannot create directory `/var/www/localhost': File exists
Back to top
View user's profile Send private message
upengan78
l33t
l33t


Joined: 27 Jun 2007
Posts: 711
Location: IL

PostPosted: Mon Jan 14, 2008 5:48 pm    Post subject: Reply with quote

I don't understand, what is the issue, sorry

Try downgrading apache,

example:
emerge -av "=net-www/apache-2.x.x"

Thanks
Back to top
View user's profile Send private message
dominik_ba
n00b
n00b


Joined: 11 Jan 2008
Posts: 17
Location: rotterdam

PostPosted: Sun Jan 20, 2008 3:41 pm    Post subject: Reply with quote

downgrading didn't work out till now.
Back to top
View user's profile Send private message
elgato319
Guru
Guru


Joined: 15 Sep 2005
Posts: 546

PostPosted: Mon Jan 21, 2008 7:28 am    Post subject: Reply with quote

well..

to get userdirs working you need to add "-D USERDIR" to:

APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST"

Quote:
# USERDIR Enables /~username mapping to /home/username/public_html


than restart apache
Back to top
View user's profile Send private message
dominik_ba
n00b
n00b


Joined: 11 Jan 2008
Posts: 17
Location: rotterdam

PostPosted: Mon Jan 21, 2008 12:15 pm    Post subject: Reply with quote

thanks a lot
now it works, the only thing is that i don't know how to enable cgi scripts, on the previous version of apache it was easier.
Back to top
View user's profile Send private message
elgato319
Guru
Guru


Joined: 15 Sep 2005
Posts: 546

PostPosted: Tue Jan 22, 2008 8:13 am    Post subject: Reply with quote

did you enable suexec?

add "-D SUEXEC" to APACHE2_OPTS.

after that cgi-scripts should be working in /home/*/public_html/cgi-bin
Back to top
View user's profile Send private message
dominik_ba
n00b
n00b


Joined: 11 Jan 2008
Posts: 17
Location: rotterdam

PostPosted: Tue Jan 22, 2008 2:28 pm    Post subject: Reply with quote

it works,

i emerged apache with suexec in the USE flags. after that APACHE2_OPTS looks like that:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SUEXEC"
i finally add -D USERDIR
it's like that
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SUEXEC -D USERDIR"

and it works
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
Goto page 1, 2  Next
Page 1 of 2

 
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