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.
Hi, not sure why but Apache is complaining about an error with SetEnvIfNoCase when I tried to start it. I've checked that the module /usr/local/apache2/modules/mod_rewrite.so exists. Also the 2nd code block below shows that I'm using the <IfModule rewrite_module></IfModule> tags so if the module isn't available, Apache shouldn't have read that part of the file. The fact that it's reading inside that tag pair means it's able to load the mod_rewrite.so DSO. Any ideas?
Code:
[root@test httpd-2.2.19]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: Syntax error on line 203 of /usr/local/apache2/conf/httpd.conf:
Invalid command 'SetEnvIfNoCase', perhaps misspelled or defined by a module not included in the server configuration
[FAILED]
Line 203 is the following highlighted in bold.
Quote:
<IfModule rewrite_module>
RewriteEngine On SetEnvIfNoCase Referer "^http://192.168.10.9/" good
<FilesMatch "\.(png|jpg|jpeg|gif|bmp|swf|flv)$">
Order Deny,Allow
Deny from all
Allow from env=good
#ErrorDocument 403 http://www.google.com/intl/en_ALL/images/logo.gif
#ErrorDocument 403 /images/you_bad_hotlinker.gif
ErrorDocument 403 "No hot link allowed"
</FilesMatch>
SetEnvIfNoCase User-Agent "^Wget" malicious_agent
<Limit GET POST>
Order Allow,Deny
Allow from all
Deny from env=malicious_agent
</Limit>
</IfModule>
Hi, thanks. You saved my day. Turns out there were a few more modules I needed to load and they call can be looked up from here based on the Directives being used.
Um... something is not adding up. For some reason, I'm now seeing a bunch of the following.
Code:
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in [path]/includes/functions.php on line 3461
I have the following setup
Server--------Modules Directory------Configure Command
A---------httpd.exp, libphp5.so------Can't remember
B---------All the modules available--configure --prefix=/usr/local/apache2 --enable-mods-shared=all
The interesting thing is the httpd.conf from Server A works just fine but as soon as I put it into Server B, it complains about all sorts of Directives having issues unless I load the respective modules as we've discovered above. However, once all the modules are loaded, Server B would give me the above timezone setting errors, and also wouldn't know that it should load up the index.php or index.html page on its own.
Is this due to the way Apache was configured? I can't remember what was the command I used to install Apache on Server A but am suspecting that it was without the "--enable-mods-shared=all" option as it doesn't have all the modules.
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in [path]/includes/functions.php on line 3461
This is a php warning. You can edit php.ini and use
Thanks. Just recompiled Apache using the following but this time the modules directory only has httpd.exp (ie libphp5.so is missing). Any idea what options would produce just these two files? I'm wondering the difference in behavior might have been due to the way it was configured?
Code:
./configure --prefix=/usr/local/apache2
Also looked at the Apache documentation here. I'm a bit puzzled by the following statement on the page. So what's the point of the "all" keyword?
Quote:
Caveat: --enable-mods-shared=all does not actually build all modules. To build all modules then, one might use:
Thanks for the link. Observed the following:
1) The libphp5.so comes from the PHP installation and requires running the PHP's make clean, configure, make, and make install command in order to get it installed into Apache's module directory.
2) After compiling Apache again without the "--enable-mods-shared=all" option, and doing the steps for PHP in step 1 above, the same two files (shown below) I observed before are back. This suggests that Server A initially was built without the "--enable-mods-shared=all" option.
Quote:
[root@test modules]# ls -l
total 22208
-rw-r--r-- 1 root root 9083 Jun 4 07:29 httpd.exp
-rwxr-xr-x 1 root root 22689103 Jun 4 08:10 libphp5.so
With this, executing "service httpd start" I got the following.
Apache was built without "--enable-mods-shared=all" option
Quote:
Starting httpd: httpd: Syntax error on line 87 of /usr/local/apache2/conf/httpd.conf: module setenvif_module is built-in and can't be loaded
[FAILED]
In contrast, the behavior is completely the opposite if I use the "--enable-mods-shared=all" option. This is interesting as initially I also didn't have the "setenvif_module" loaded, and then run into the issue with the Directive "SetEnvIfNoCase", thus starting this thread asking for help.
Apache was built with "--enable-mods-shared=all" option
Quote:
Starting httpd: Syntax error on line 203 of /usr/local/apache2/conf/httpd.conf:
Invalid command 'SetEnvIfNoCase', perhaps misspelled or defined by a module not included in the server configuration
[FAILED]
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.