symbolic link apache modules - apache

My default apache modules are currently within /usr/bin. The modules i have generated however are within /home/user/platform/lib. Within the httpd.conf file i have added the two modules as per example:
LoadModule rtb_module lib/mod_rtb.so
LoadModule win_module lib/mod_win.so
However when loading the modules i see errors because the two mentioned modules reside somewhere else (in this case /home/user/platform/lib). Is there a way to symlink these two modules within the httpd.conf file?
many thanks

using ln -s created a symbolic link to the necessary path, resolving the issue

Related

prefork.c is not shown in httpd -l

I have CentOS 7 and the version of my apache is 2.4.6.
I typed this command:
httpd -l
This is the answer:
Compiled in modules:
core.c
mod_so.c
http_core.c
Therefore, I cannot see the prefork.c among these modules. Also, I cannot see the prefork module in /etc/httpd/conf/httpd.conf
but the answer of the httpd -V | grep "Server MPM" is:
Server MPM: prefork
Moreover, the suggestion of these links is not helpful:
apache2-prefork-dev installation
Prefork MPM configuration not in httpd.conf
((It means that installing httpd-devel was not helpful, and adding following lines in /etc/httpd/conf.modules.d/00-mpm.conf did not fix my problem:
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
StartServers 5
ServerLimit 256
MaxRequestWorkers 256
MaxConnectionsPerChild 0
))
I want to see prefork.c in the answer of httpd -l and also I want to see prefork module in /etc/httpd/conf/httpd.conf
what should I do?
Thanks for sharing.
httpd -l only lists the modules that have been added at compile time in the server, as static modules.
Other modules can be loaded dynamically as DSO (Dynamic Shared Object) by calling them with the LoadModule directive in the conf file.
You can list them (along with static ones) using httpd -M instead of httpd -l. If prefork module appears in the list, it's because it is loaded and at work.
Both methods, static and DSO, work well and you can (and probably should) use DSO without any issue.
Regarding the prefork config, it can be inserted directly in httpd.conf, or (as it seems to be your case) in another file, which is then "merged" in the server config with the Include directive in httpd.conf.
You may find the prefork config you search by finding which included file it has been stored into (you should have a /etc/httpd/conf.modules.d/00-mpm.conf but at worst, opening them one by one should eventually give you some result). And if you really want to, you can cut it from there, and paste it directly into httpd.conf instead.
Finally, if you really want to see prefork module appear in static modules list, you will have to manually configure and compile apache sources, adding that specific module as static in the process.
You can read more about this on apache docs, and, should you decide to go that way, you'll probably find that this question is better suited for ServerFault website.

where is httpd.conf file in httpd-2.4.16 package?

I have downloaded httpd-2.4.16.tar.gz package from http://www.apache.org/dist/httpd/
and extracted on my ubuntu 14.04 LTS two times but i am unable to find conf directory so that i configure httpd.conf file present in this directory as mentioned in http://httpd.apache.org/docs/2.4/install.html#customize
One directory i found in this package at /docs/conf but in this package i found httpd.conf.in instead of httpd.conf is it correct directory for configuration?
Thanks
Use find /etc -name httpd
This will produce a list of all files within that directory that contain httpd
Or use:
find / -name httpd.conf
which will produce the full path of wherever httpd.conf is situated.
Actually conf file appear after installation of apache. I was finding it inside extracted directory of httpd-2.4.16.tar.gz.

Apache returning 404 for requests inside /javascript directory

I have a project with several sub-directories. Everything works just fine, except if I try to access files inside the /root/javascript directory, I get a 404. The files do in fact exist, and I am in fact typing the path correctly. If I simply rename the directory I can then access the files. Rename it back, and I get the 404 again. VHost file works fine. No .htaccess files involved.
Apache version: 2.4.9
OS: Ubuntu 13.10
After much searching and trying different things, here's what the problem came down to:
By default, Apache 2.4 on Ubuntu enables a config file called javascript-common, which redirects any requests to files inside /javascript (that is, a directory at the root of your project called 'javascript') to /usr/share/javascript.
Solution 1
Use the following command to disable the javascript-common configuration file:
a2disconfig javascript-common
Solution 2
Add your JavaScript files inside that /usr/share/javascript directory. That way Apache will actually find those files and no 404 will be returned. One benefit of doing things this way is that you won't need multiple copies of the same files (jquery.js, etc.js) that multiple projects use...
Solution 3
Delete the directory /usr/share/javascript, and create a symbolic link that points to your project's /javascript directory. Keep in mind that if you have more than one project (vhost file), they will all serve from the same JavaScript file from the original project. In other words, this is probably not the best solution...
The a2disconfig solution didn't work for me, but then through some searching, I realized that the javascript-common is something that can be uninstalled.
So I fixed the problem by removing javascript-common:
sudo apt-get remove javascript-common
I'm not sure the point of this package, or why it would be installed automatically, but I'm glad that my javascript files are loading again!
I am running Ubuntu 14.04.1 LTS with the lamp-server bundle
Encountering the same problem, I found a similar answer resolved it.
sudo a2disconf javascript-common
sudo service apache2 restart
After the a2disconf (and note it is apparently now a2disconf and not a2disconfig)
I did get a message to execute "sudo service apache2 reload"
the reload did not resolve the issue... thus the restart
as an aside -- I cannot imagine what the developers were thinking when they loaded this little gem -- some of my javascript files might be viable across domains... but certainly not all !
You could just override /javascript alias in your .conf to reflect what you want:
Alias /javascript /my_custom_dir

installing additional apache modules

I need to enable additional modules for apache eg, mod_proxy, mod_proxy-html, and mod_proxy_balancer.
Is there a way for me to do that without recompiling the whole apache?
Thanks
You can list the compiled in modules by executing:
$ apache2 -l
Note: this is NOT /etc/init.d/apache2. If the module you need is not already compiled in, you will need to include it inside the configuration file.
See here for a Debian/Ubuntu description.
You need just to copy those modules to some directory on Your system/server,
then add a command for appache in configure file.
ex:
LoadModule mod_proxy modules/mod_proxy.so / linux
LoadModule mod_proxy modules/mod_proxy.dll / windows
http://httpd.apache.org/docs/2.0/mod/mod_so.html#loadmodule
If your apache is built with shared library support, then you could copy these modules from another machine(same OS, same/lower version and preferably same compiler) and place it in modules folder. Then use LoadModule directive to dynamically load it.
If you dont have the modules, you can download the source and build/install apache in a different directory (using --prefix) with option --enable-mods-shared=most. Copy the required modules to the original apache modules folder, and use LoadModule to load it.

apache xampp gzip

I am trying to get the GZIP module working in XAMPP window vista 64 bit. I have added the .dll file for gzip into the module directory and added in httpconf. Once I add it say it cannot start apache since it cannot find the ApacheGZIP module in the directory that is mentioned in httpconf file...(which I can see exist in the directory)...
One more thing in the modules directory I found that it has the .so files(i thought it was for unix) so i tried adding the .so gzip and added that to httpconf and tried restarting. Again it complained saying it is not a valid window application...
NEED HELP
THnks
Coool
You can try uncommenting the following in /xampp/apache/conf/httpd.conf:
LoadModule deflate_module modules/mod_deflate.so
You should already have mod_deflate.so enabled if you are using XAMPP. XAMPPLite, however, has that disabled.