Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
wh33t@Wh33tBox:/var/log/apache2$ sudo service apache2 restart
* Restarting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.1.2. Set the 'ServerName' directive globally to suppress this message
[fail]
* The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
Any ideas. I checked the logs in /var/logs/apache2/ and there doesn't appear to be Apache start up errors in those scripts.
Code:
wh33t@Wh33tBox:/var/log/apache2$ ls -l
total 1200
-rw-r----- 1 root adm 374948 Dec 18 19:23 access.log
-rw-r----- 1 root adm 632427 Dec 14 06:40 access.log.1
-rw-r----- 1 root adm 0 Dec 18 23:28 error.log
-rw-r----- 1 root adm 196644 Dec 14 06:40 error.log.1
-rw-r----- 1 root adm 0 Dec 14 06:40 other_vhosts_access.log
-rw-r----- 1 root adm 3554 Dec 6 19:37 other_vhosts_access.log.1
wh33t@Wh33tBox:/var/log/apache2$
I know the issue is because I'm trying to install some extensions and I'm sure I did something wrong but I want to know how to troubleshoot this on my own.
I know the issue is because I'm trying to install some extensions and I'm sure I did something wrong but I want to know how to troubleshoot this on my own.
You can try to start apache using the -e switch, so it logs the startup messages, e.g:
Code:
httpd -e debug
In this case the startup messages are also logged in apache error.log
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.1.2. Set the 'ServerName' directive globally to suppress this message
First of all errors warn you of a less than favorable condition. This one also shows you how to correct the error. Please do not ignore it, correct it before doing anything else.
Quote:
Originally Posted by wh33t
I checked the logs in /var/logs/apache2/ and there doesn't appear to be Apache start up errors in those scripts.
Code:
wh33t@Wh33tBox:/var/log/apache2$ ls -l
Do understand that telling us and listing log file directory contents are different from actually showing log file entries. Also note Apache has a pre-flight check switch (-t) that could help diagnose common problems (but be aware it doesn't cover everything). Next to that (generally speaking) log file contents may also be influenced by (absence of) debug (-X) or verbosity settings (-e) or any filtering that's done between the actual error and writing log file contents. To elaborate on what bathory wrote: your letters du Jour are: -{S,t,X,e}, the order and usage of which you can find in 'man httpd' or your Linux distribution equivalent.
You can try to start apache using the -e switch, so it logs the startup messages, e.g:
Code:
httpd -e debug
In this case the startup messages are also logged in apache error.log
Regards
I tried the debug,
Code:
wh33t@Wh33tBox:/var/log$ httpd -e debug
No command 'httpd' found, did you mean:
Command 'xttpd' from package 'xtide' (universe)
Command 'http' from package 'httpie' (universe)
Command 'https' from package 'httpie' (universe)
httpd: command not found
wh33t@Wh33tBox:/var/log$
Here is my default server.conf
Code:
<VirtualHost *:81>
# The ServerName directive sets the request scheme, hostname and port t$
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName someserver.dyndns.net
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Here is my one subdomain.conf
Code:
<VirtualHost *:81>
# The ServerName directive sets the request scheme, hostname and port t$
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName sub.someserver.dyndns.net
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/sub
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
And here is me trying to start the server
Code:
wh33t@Wh33tBox:/var/log/apache2$ sudo service apache2 restart
* Restarting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.1.2. Set the 'ServerName' directive globally to suppress this message
[fail]
* The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
And here is where the error log is being written. Note, before making this forum post I deleted access.log and error.log to simply trying to find the error messages.
Code:
wh33t@Wh33tBox:/var/log/apache2$ ls -l
total 828
-rw-r--r-- 1 root root 0 Dec 21 12:09 access.log
-rw-r----- 1 root adm 632427 Dec 14 06:40 access.log.1
-rw-r--r-- 1 root root 0 Dec 21 12:09 error.log
-rw-r----- 1 root adm 196644 Dec 14 06:40 error.log.1
-rw-r----- 1 root adm 0 Dec 14 06:40 other_vhosts_access.log
-rw-r----- 1 root adm 3554 Dec 6 19:37 other_vhosts_access.log.1
And the contents of error.log is empty.
I know I need to make apache2 output the errors, but not sure how. I need really straight forward instructions unfortunately. I'm using Ubuntu 14.04LTS if that's good to know.
And here is where the error log is being written. Note, before making this forum post I deleted access.log and error.log to simply trying to find the error messages.
Rotating logs out of the way using 'logrotate' or Apache's own tools OK, but deleting logs? No, that's not a good practice.
Just to add to the unSpawn's post above:
httpd is indeed replaced by apache2 in ubuntu, so try:
Code:
/usr/sbin/apache2 -e debug
Quote:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.1.2. Set the 'ServerName' directive globally to suppress this message
since you're still get this warning (not an error though) while you have a ServerName directive in both your vhosts config, chances are that apache does not read the respective config files.
You need to run a2ensite to enable vhost(s), so have a look at step 5 in this howto
I guess for the same reason you don't get any logs written in error.log
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.