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

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.

Related

Apache 2.2/Redhat 2.6 with mod_wsgi

I'm having trouble configuring mod_wsgi with my current set up.
Redhat 2.6.32
Installations setup as non-root user:
Apache 2.2 (attempted to get 2.4, but without access to yum the
dependencies were too much)
Python 3.6
I seem to have successfully installed mod_wsgi into /apache/modules.
Problems:
The apache directory structure is not what most tutorials indicate, its
DocumentRoot is in /apache/htdocs, not /var/www/ or /sites-enabled/ or /sites/available/
I tried putting:LoadModule wsgi_module modules/mod_wsgi.so in httpd.conf but I am returned:
$HOME/apache/modules/mod_wsgi.so into server: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory
Can anyone explain how I can use mod_wsgi with my current setup?
The problem is likely because you self compiled mod_wsgi and the Python installation you used is in a non standard location. In this case you need to se LD_RUN_PATH environment variable when running make for mod_wsgi, with it set to the directory the Python library is in. This way knowledge of where the Python library is is embedded in mod_wsgi. This issue is described in the mod_wsgi documentation:
http://modwsgi.readthedocs.io/en/develop/user-guides/installation-issues.html#unable-to-find-python-shared-library
If you can't rebuild mod_wsgi for some reason, you can also force load the Python shared library into Apache by using:
LoadFile /some/path/lib/libpython3.6m.so.1.0
This should be place just before the LoadModule line for mod_wsgi.
Your libpython3.6m.so.1.0 is not in any of apache's library paths.
You can symlink it to one of the lib directories in apache's library path, or you can add the directory where your libpython3.6m.so.1.0 resides to apache's library path.
Check this question out for help with apache paths: https://serverfault.com/questions/151328/setting-apache2-path-environment-variable

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

Location of configuration files in apache 2.4.6

I built and install the latest version of apache, 2.4.6 on ubuntu 12.04.
I specified the prefix (installation location) as
/home/[user-name]/apache
After it was done, i was able to start apache by running
./home/[user-name]/apache/bin/apachectl
In previous version that i installed from repos, the configuration files such as
sites-available, sites_enabled etc were located in
/etc/apache
Where can i find the conf files for this version.
Or is there more i need to do after compiling and installing?
Thanks
By default the location for httpd.conf should be
/home/[user-name]/apache/conf/httpd.conf

Where is ".htaccess" apache file located in Linux Red Hat?

Does anyone know where is the .htaccess file located after I install in linux red hat 5?
There is no .htaccess file that's installed. You will have a global config file for Apache, which is in /etc/httpd/conf/httpd.conf on RedHat (see http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4/html/Reference_Guide/s1-apache-config.html). On the other hand, .htaccess files are something you create on a per-directory basis where the actual web files live.

How to check where Apache is looking for a php.ini file?

I have a feeling that Apache is using a different php.ini file that the one I am editing. I make a change in my php.ini file, restart Apache, and the change doesn't take affect. So I don't know what to do anymore.
Any ideas?
Update: Found out it's using the right php.ini file...but I still don't know what to do!
To find the file that's being run by PHP, create a phpinfo file (just <?php phpinfo();?>) and look for the 'Configuration File (php.ini) Path' directive.
from the command line, run
php -i |grep "php.ini"
This will describe the location php is loading its ini file from. You can reconfigure the php.ini location by recompiling php.
The output from phpinfo() will contain this. When using PHP as an Apache module, it can be configured using PHPIniDir in httpd.conf (or similar).
To get the php.ini file which is being used by Apache you will probably have to add phpinfo() into a .php file and open it in the browser. As php -r "phpinfo();" | grep php.ini will outout the same as php --ini would. Which php.ini is used for the CLI.
Question for you, what platform are you running on unix or windows?
If it is unix based, check if your php.ini is residing in the same directory as /etc/httpd. Again, installation of apache can vary so check...or issue the command "find / -name php.ini -print" (without quotes) to see which one is it you are using
Ok. Since you said you have found the correct php.ini, sounds like something is missing when you edited the php.ini and reloaded apache. Look in the log directory /var/log/httpd for error_log and check to see if there was errors...that would be a start!