View previous topic :: View next topic |
Author |
Message |
jlanza Tux's lil' helper
Joined: 27 Aug 2003 Posts: 109
|
Posted: Thu Feb 24, 2005 6:56 am Post subject: apache run error |
|
|
I just installed apache but when i go to /etc/init.d/apache2 -k start i get
bash-2.05b# /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
(2)No such file or directory: apache2: could not open error log file /usr/lib/apache2/logs/error_log.
Unable to open logs
any ideas.... |
|
Back to top |
|
|
_never_ Apprentice
Joined: 10 Jun 2004 Posts: 285 Location: BW, Germany
|
Posted: Thu Feb 24, 2005 7:00 am Post subject: |
|
|
Don't assume you can just install and run a webserver and expect it to work the way you want. You need to have a look at /etc/apache2/conf/ first. But maybe you should read some good book about network security first. _________________ Knowledge is Power. |
|
Back to top |
|
|
TheRAt Veteran
Joined: 03 Jun 2002 Posts: 1580
|
Posted: Thu Feb 24, 2005 7:02 am Post subject: |
|
|
my /usr/lib/apache2/logs dir is a link to /var/log/apache2... Make sure that both the /var/log/apache2 dir and the link to it exist, then try to restart apache2... _________________ All reality is the construct of the observer.
Get Firefox and rediscover the web!
BOFH Excuse #295:
The Token fell out of the ring. Call us when you find it. |
|
Back to top |
|
|
jlanza Tux's lil' helper
Joined: 27 Aug 2003 Posts: 109
|
Posted: Thu Feb 24, 2005 7:16 am Post subject: |
|
|
* Starting apache2...
apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName |
|
Back to top |
|
|
_never_ Apprentice
Joined: 10 Jun 2004 Posts: 285 Location: BW, Germany
|
Posted: Thu Feb 24, 2005 7:20 am Post subject: |
|
|
jlanza wrote: | * Starting apache2...
apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName |
This is because you didn't configure your httpd yet. And this is also why I'm not going to help you. Have a look at /etc/apache2/conf/apache2.conf. _________________ Knowledge is Power. |
|
Back to top |
|
|
jlanza Tux's lil' helper
Joined: 27 Aug 2003 Posts: 109
|
Posted: Thu Feb 24, 2005 1:33 pm Post subject: |
|
|
never shut the fuck up man.
I uncommented ServerName localhost in my /etc/apache2/conf/apache2.conf, now when i start i get
bash-2.05b# /etc/init.d/apache2 start
* Starting apache2... [ !! ]
....
I try to look at the error log and get this
bash-2.05b# cd /var/log/apache2
bash: cd: /var/log/apache2: Too many levels of symbolic links
bash-2.05b# cat /var/log/apache2
cat: /var/log/apache2: Too many levels of symbolic links
any suggestions anyone? thanks for the help |
|
Back to top |
|
|
j-m Retired Dev
Joined: 31 Oct 2004 Posts: 975
|
Posted: Thu Feb 24, 2005 1:42 pm Post subject: |
|
|
Set the logs directives to point to /var/log/apache2 or another existing directory - not to symlink symlinked to point to a symlink which points to a symlink which .... |
|
Back to top |
|
|
jlanza Tux's lil' helper
Joined: 27 Aug 2003 Posts: 109
|
Posted: Thu Feb 24, 2005 7:10 pm Post subject: |
|
|
i deleted /var/log/apache2 and created a new directory and it still doesnt work... |
|
Back to top |
|
|
lookinin Guru
Joined: 21 Jan 2005 Posts: 486
|
Posted: Thu Feb 24, 2005 7:11 pm Post subject: |
|
|
You get the same errors? Post the output of:
Code: | # ls -l /var/log/apache2 /usr/lib/apache2/logs |
|
|
Back to top |
|
|
jlanza Tux's lil' helper
Joined: 27 Aug 2003 Posts: 109
|
Posted: Thu Feb 24, 2005 7:33 pm Post subject: |
|
|
bash-2.05b# ls -l /var/log/apache2 /usr/lib/apache2/logs
/usr/lib/apache2/logs:
total 8
-rw-r--r-- 1 root root 0 Feb 24 02:17 access_log
lrwxrwxrwx 1 root root 16 Feb 23 20:41 apache2 -> /var/log/apache2
-rw-r--r-- 1 root root 1470 Feb 24 14:19 error_log
-rw-r--r-- 1 root root 0 Feb 24 02:17 ssl_access_log
-rw-r--r-- 1 root root 246 Feb 24 14:13 ssl_error_log
-rw-r--r-- 1 root root 0 Feb 24 02:17 ssl_request_log
/var/log/apache2:
total 0 |
|
Back to top |
|
|
lookinin Guru
Joined: 21 Jan 2005 Posts: 486
|
Posted: Thu Feb 24, 2005 7:37 pm Post subject: |
|
|
jlanza wrote: | bash-2.05b# ls -l /var/log/apache2 /usr/lib/apache2/logs
/usr/lib/apache2/logs:
total 8
-rw-r--r-- 1 root root 0 Feb 24 02:17 access_log
lrwxrwxrwx 1 root root 16 Feb 23 20:41 apache2 -> /var/log/apache2
-rw-r--r-- 1 root root 1470 Feb 24 14:19 error_log
-rw-r--r-- 1 root root 0 Feb 24 02:17 ssl_access_log
-rw-r--r-- 1 root root 246 Feb 24 14:13 ssl_error_log
-rw-r--r-- 1 root root 0 Feb 24 02:17 ssl_request_log
/var/log/apache2:
total 0 |
Oops, my bad - I should have said:
Code: | # ls -ld /var/log/apache2 /usr/lib/apache2/logs |
But I think I see the problem anyway:
Code: | # rm /usr/lib/apache2/logs/apache2
# rmdir /var/log/apache2 (or rm /var/log/apache2 if it's a link)
# ln -sf /usr/lib/apache2/logs /var/log/apache2 |
|
|
Back to top |
|
|
jlanza Tux's lil' helper
Joined: 27 Aug 2003 Posts: 109
|
Posted: Thu Feb 24, 2005 7:57 pm Post subject: |
|
|
i try to do the first thing...
and
bash-2.05b# rm /usr/lib/apache2/logs/apache2/
rm: cannot remove `/usr/lib/apache2/logs/apache2/': Not a directory
then i try for fun rm -rf and it says the same thing |
|
Back to top |
|
|
lookinin Guru
Joined: 21 Jan 2005 Posts: 486
|
Posted: Thu Feb 24, 2005 8:09 pm Post subject: |
|
|
jlanza wrote: | rm: cannot remove `/usr/lib/apache2/logs/apache2/': Not a directory |
Leave off the trailing slash... it's not a directory cause it's a symlink |
|
Back to top |
|
|
jlanza Tux's lil' helper
Joined: 27 Aug 2003 Posts: 109
|
Posted: Fri Feb 25, 2005 12:47 am Post subject: |
|
|
It still won't start...
i get these errors after unmerging and remerging...
bash-2.05b# /etc/init.d/apache2 start
* Starting apache2... [ !! ]
* Apache2 has detected a syntax error in your configuration files:
Syntax error on line 6 of /usr/lib/apache2/conf/modules.d/70_mod_php.conf:
Cannot load /usr/lib/apache2/extramodules/libphp4.so into server: /usr/lib/apache2/extramodules/libphp4.so: cannot open shared object file: No such file or directory
bash-2.05b# /etc/init.d/apache2 start
* Apache2 has detected a syntax error in your configuration files:
Syntax error on line 57 of /etc/apache2/conf/apache2.conf:
Cannot load /usr/lib/apache2/modules/usr/lib/apache2-extramodules/libphp4.so into server: /usr/lib/apache2/modules/usr/lib/apache2-extramodules/libphp4.so: cannot open shared object file: No such file or directory
bash-2.05b# /etc/init.d/apache2 -k start
* ERROR: wrong args. ( -k / -k )
* Usage: apache2 { start|stop|restart|reload }
* apache2 without arguments for full help |
|
Back to top |
|
|
lookinin Guru
Joined: 21 Jan 2005 Posts: 486
|
Posted: Fri Feb 25, 2005 12:55 am Post subject: |
|
|
jlanza wrote: | It still won't start...
i get these errors after unmerging and remerging...
|
Did you also unmerge mod_php and forget to remerge it? if you have slocate installed (emerge slocate && updatedb), try:
Code: | # locate libphp4.so |
Looks like you got past the log problem, but now it simply can't find mod_php...
All else fails, just emerge mod_php again, even if it's installed:
|
|
Back to top |
|
|
_never_ Apprentice
Joined: 10 Jun 2004 Posts: 285 Location: BW, Germany
|
Posted: Fri Feb 25, 2005 1:17 am Post subject: |
|
|
jlanza wrote: | never shut the fuck up man. |
No problem. I will. But you will never get a well running Apache without configuring it. So have a look at the Apache documentation before asking such dumb questions here. _________________ Knowledge is Power. |
|
Back to top |
|
|
jlanza Tux's lil' helper
Joined: 27 Aug 2003 Posts: 109
|
Posted: Fri Feb 25, 2005 3:06 am Post subject: |
|
|
bash-2.05b# /etc/init.d/apache2 restart
* Starting apache2... [ !! ]
fixed another thing, but it still wont start.... |
|
Back to top |
|
|
jlanza Tux's lil' helper
Joined: 27 Aug 2003 Posts: 109
|
Posted: Fri Feb 25, 2005 3:07 am Post subject: |
|
|
these are the errors im geting
cat /var/log/apache2/error_log
[Thu Feb 24 22:05:47 2005] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "Guinness"
cat /var/log/apache2/ssl_error_log
[Thu Feb 24 08:43:58 2005] [error] Server should be SSL-aware but has no certificate configured [Hint: SSLCertificateFile]
[Thu Feb 24 14:13:39 2005] [error] Server should be SSL-aware but has no certificate configured [Hint: SSLCertificateFile] |
|
Back to top |
|
|
lookinin Guru
Joined: 21 Jan 2005 Posts: 486
|
Posted: Fri Feb 25, 2005 5:22 am Post subject: |
|
|
Regarding the second error, my knowledge of mod_ssl is limited to knowing of its existence, sorry... but a search of the forums should give you some ponters... As for the first error, this is some sort of hostname issue... probably related to one of your first problems:
Quote: | apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName |
Do you have an entry in your /etc/hosts file corresponding to localhost & guinness? maybe:
Code: | 127.0.0.1 localhost.localdomain localhost
192.168.0.1 guinness.yournetworkname guinness
|
Also check that your /etc/dnsdomainname & /etc/hostname are set:
hostname:
dnsdomainname:
|
|
Back to top |
|
|
_never_ Apprentice
Joined: 10 Jun 2004 Posts: 285 Location: BW, Germany
|
Posted: Fri Feb 25, 2005 8:56 am Post subject: |
|
|
Okay people, I can't watch this anymore. I'll help the kiddy so he stops crying. You need to set the ServerName in your apache.conf like this:
Code: | ServerName guinness.local |
If you have something like a DynDNS hostname, use this as your ServerName, like this:
Code: | ServerName some-host.dyndns.org |
In most cases, you will just use a combination of your /etc/hostname and /etc/dnsdomainname. Like I told you, go and read the docs and you'll save yourself lots of trouble. At least don't insult me for my opinion about you. _________________ Knowledge is Power. |
|
Back to top |
|
|
Cysec n00b
Joined: 21 Feb 2005 Posts: 2
|
Posted: Fri Feb 25, 2005 1:32 pm Post subject: |
|
|
_never_ lose the attitude man, the most powerful aspect of linux is it's community. No matter who asks the question, nor if the question is what you consider stupid, one should not flame others for asking. The attitude you take is very similar to that recently received from a tech support analyst by a friend of mine who was dealing with a certain company that would very much like to see the community behind linux crumble. |
|
Back to top |
|
|
_never_ Apprentice
Joined: 10 Jun 2004 Posts: 285 Location: BW, Germany
|
Posted: Fri Feb 25, 2005 1:44 pm Post subject: |
|
|
When you search through the forums for my posts, you'll notice that I'm an open and friendly person. But there is one thing I hate. People installing a network service (no matter what kind of) and expect it to work without configuration. This is where most security threats come from - bad maintainance. It is so easy to open up the whole system to the rest of the world with something like Apache. I advised him to read the docs and I did it friendly. I was told to shut up - so I did, until I realized that nobody is going to help him.
This has nothing to do with attitude. _________________ Knowledge is Power. |
|
Back to top |
|
|
lookinin Guru
Joined: 21 Jan 2005 Posts: 486
|
Posted: Fri Feb 25, 2005 1:45 pm Post subject: |
|
|
jlanza, just so you know, _never_ is correct, this directive should be set, but in most cases, apache can deduce the domain name via reverse lookup, so if it's in your /etc/hosts, it should figure itself out fine. See the quote from the apache 2.0 documentation below. I have an internal http server, and have never bothered to set this directive, but my server is not accessible to the outside world, has only an internal hostname, and, while it may not be technically correct, it works just fine for my needs (extremely light use, some php practice).
http://httpd.apache.org/docs-2.0/mod/core.html#servername wrote: | If no ServerName is specified, then the server attempts to deduce the hostname by performing a reverse lookup on the IP address. If no port is specified in the ServerName, then the server will use the port from the incoming request. For optimal reliability and predictability, you should specify an explicit hostname and port using the ServerName directive |
|
|
Back to top |
|
|
lookinin Guru
Joined: 21 Jan 2005 Posts: 486
|
Posted: Fri Feb 25, 2005 1:47 pm Post subject: |
|
|
Quote: | until I realized that nobody is going to help him. |
Oh? What have I been doing? Maybe I didn't have his answers right off the bat in each case, but it worked out as far as I can see.
Last edited by lookinin on Fri Feb 25, 2005 1:50 pm; edited 1 time in total |
|
Back to top |
|
|
_never_ Apprentice
Joined: 10 Jun 2004 Posts: 285 Location: BW, Germany
|
Posted: Fri Feb 25, 2005 1:49 pm Post subject: |
|
|
Sorry, used bad words.
-> Nobody could help him.
Don't take it personally, I'm sorry. =) _________________ Knowledge is Power. |
|
Back to top |
|
|
|