Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
getting apache to work
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
after fallout
n00b
n00b


Joined: 14 Apr 2005
Posts: 8
Location: Pennsylvania

PostPosted: Tue Jan 24, 2006 6:16 pm    Post subject: getting apache to work Reply with quote

I have a fresh install of gentoo (everything has been emerged within the past day) and I am trying to get apache, phpmyadmin, and a couple of php pages to work (sugarcrm and mediawiki). It has been a long time since I set up a webserver in gentoo (and last time all I did was type "emerge apache" then "/etc/init.d/httpd start"). So today I did the following commands:

Code:

emerge apache
emerge mysql
/usr/bin/mysql_install_db
mysqladmin -u root password 'my password'
rc-update add apache2 default
rc-update add mysql default
/etc/init.d/apache2 start
/etc/init.d/mysql start
emerge phpmyadmin


And now I go to http://127.0.0.1/ and it gives me a 404 error instead of the page that says you have installed apache. It also gives me the 404 if I specify index.html.

The default vhost file says that my web directory is /var/www/localhost/htdocs, but all I seem to get is 404s. What did I do wrong?


Last edited by after fallout on Tue Jan 24, 2006 9:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
RlC
Guru
Guru


Joined: 30 Jul 2005
Posts: 358
Location: austria

PostPosted: Tue Jan 24, 2006 6:19 pm    Post subject: Reply with quote

what does
Code:
ls /var/www/localhost/htdocs
say?
Back to top
View user's profile Send private message
after fallout
n00b
n00b


Joined: 14 Apr 2005
Posts: 8
Location: Pennsylvania

PostPosted: Tue Jan 24, 2006 8:09 pm    Post subject: Reply with quote

Code:

bb2 www-client # ls /var/www/localhost/htdocs           
apache_pb.gif  apache_pb2.gif  index.html  phpmyadmin
Back to top
View user's profile Send private message
RlC
Guru
Guru


Joined: 30 Jul 2005
Posts: 358
Location: austria

PostPosted: Tue Jan 24, 2006 8:45 pm    Post subject: Reply with quote

Quote:
Code:
/etc/init.d/apache2 -k start

what is the "-k" for?
when i do this i get an error. are you sure the server is running?
Back to top
View user's profile Send private message
after fallout
n00b
n00b


Joined: 14 Apr 2005
Posts: 8
Location: Pennsylvania

PostPosted: Tue Jan 24, 2006 8:54 pm    Post subject: Reply with quote

sorry that was typing "apache2 -k start", not "/etc/init.d/apache2"

here is what I get when I type /etc/init.d/apache2 start
Code:

bb2 / # /etc/init.d/apache2 start
 * Starting apache2 ...
apache2: Could not 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
cyb0rg51
n00b
n00b


Joined: 29 Nov 2004
Posts: 27

PostPosted: Tue Jan 24, 2006 8:58 pm    Post subject: Reply with quote

after fallout wrote:
dorry that was typing "apache2 -k start", not "/etc/init.d/apache2"

here is what I get when I type /etc/init.d/apache2 start
Code:

bb2 / # /etc/init.d/apache2 start
 * Starting apache2 ...
apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName                                                     [ ok ]


I got the same thing about the servername, I went into the apache2.conf and httpd.conf and made "ServerName localhost"
after that i didn't get the error message again. Also when i got an error about virtual host, i went to the config file and disable it.
I wouldn't recommend doing this because i dont exactly know what I'm doing, but maybe this will help
Back to top
View user's profile Send private message
after fallout
n00b
n00b


Joined: 14 Apr 2005
Posts: 8
Location: Pennsylvania

PostPosted: Tue Jan 24, 2006 9:04 pm    Post subject: Reply with quote

Code:

bb2 / # cat /usr/lib/apache2/logs/error_log
...
[Tue Jan 24 06:01:57 2006] [error] [client 127.0.0.1] File does not exist: /usr/htdocs
[Tue Jan 24 06:04:23 2006] [error] [client 127.0.0.1] File does not exist: /usr/htdocs
[Tue Jan 24 06:20:12 2006] [error] [client 127.0.0.1] File does not exist: /usr/htdocs
...


Apparently I am having the same problem as cyb0rg51 in his post https://forums.gentoo.org/posting.php?mode=reply&t=426423

Could a mod merge our threads (or at least delete one of them)?
Back to top
View user's profile Send private message
cyb0rg51
n00b
n00b


Joined: 29 Nov 2004
Posts: 27

PostPosted: Tue Jan 24, 2006 9:13 pm    Post subject: Reply with quote

Ill try and delete it myself and merge it onto yours. I found this helpful from one of the posts, but didn't solve the problem
http://www.gentoo.org/doc/en/apache-developer.xml

Here is my error log
Code:

[Tue Jan 24 11:54:14 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
[Tue Jan 24 11:54:14 2006] [notice] Digest: generating secret for digest authentication ...
[Tue Jan 24 11:54:14 2006] [notice] Digest: done
[Tue Jan 24 11:54:14 2006] [notice] Apache configured -- resuming normal operations
[Tue Jan 24 11:54:52 2006] [error] [client xx.xxx.xx.xx] File does not exist: /usr/htdocs
[Tue Jan 24 11:55:26 2006] [notice] caught SIGTERM, shutting down


Last edited by cyb0rg51 on Tue Jan 24, 2006 9:16 pm; edited 1 time in total
Back to top
View user's profile Send private message
after fallout
n00b
n00b


Joined: 14 Apr 2005
Posts: 8
Location: Pennsylvania

PostPosted: Tue Jan 24, 2006 9:15 pm    Post subject: Reply with quote

Creating a symbolic link in usr to /var/www/localhost/htdocs appears to work, but I don't know about how good of an idea that is.
Back to top
View user's profile Send private message
cyb0rg51
n00b
n00b


Joined: 29 Nov 2004
Posts: 27

PostPosted: Tue Jan 24, 2006 9:18 pm    Post subject: Reply with quote

did you run an etc-update (dont know if that will help), from what I hear all you need to do is make sure DocumentRoot points to /var/www/localhost/htdocs/

I have the exact same apache2 running on another remote location and i'm trying to compare and contrast the config files
Back to top
View user's profile Send private message
PaulBain
Apprentice
Apprentice


Joined: 14 Jun 2005
Posts: 159
Location: Coventry, UK

PostPosted: Tue Jan 24, 2006 10:24 pm    Post subject: Reply with quote

Have you checked out the gentoo wiki how to on installation of Apache?

http://gentoo-wiki.com/Apache2_Install

Some of that stuff may be useful!
Back to top
View user's profile Send private message
after fallout
n00b
n00b


Joined: 14 Apr 2005
Posts: 8
Location: Pennsylvania

PostPosted: Wed Jan 25, 2006 6:53 pm    Post subject: Reply with quote

This appears solved now for me, I remerged apache after enabling a couple use flags (I believe I enabled apache2, doc, and threads).

A temporary workaround I did was create a symlink:
Code:
cd /usr
ln -s /var/www/localhost/htdocs


I wonder if there is some problem in the ebuild when only certain flags are set. Here are my apache use flags taken from "emerge -vp apache":
Code:
net-www/apache-2.0.55-r1  +apache2 -debug +doc -ldap -mpm-leader -mpm-peruser -mpm-prefork -mpm-threadpool -mpm-worker -no-suexec (-selinux) +ssl -static-modules +threads
Back to top
View user's profile Send private message
cyb0rg51
n00b
n00b


Joined: 29 Nov 2004
Posts: 27

PostPosted: Wed Jan 25, 2006 10:09 pm    Post subject: Reply with quote

I found a Solution!!!!

turns out after i did a
Code:

emerge --sync


after which i ran an

Code:

emerge --update --deep world
emerge --update --deep system
etc-update
env-update


I'm still a pretty big newbie to gentoo and linux but i think what happen was I updated the portage and my system. Apache warned me that i had an old configuration file and updated a new one. After the reboot everything seemed to work fine.

I also need to read up on the USE flags
Back to top
View user's profile Send private message
xtlosx
Apprentice
Apprentice


Joined: 14 Jan 2006
Posts: 219
Location: Chicago

PostPosted: Wed Jan 25, 2006 11:00 pm    Post subject: Reply with quote

yea, i used the apache emerge guide here on the wiki and it was great, works like a charm :) with mod_php as well!! i LOVE gentoo.
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