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

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.

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

wamp3: directory listing is 404 in win 10

I installed wamp3 64 bit with php 5.6.16 and Apache 2.4.17 and MySql 5.7.9 in windows 10.
My problem:
When in a folder (in www folder) not exist index.php (OR index.html) error 404 Occurs and didn't show directories and files list.
My httpd.conf file: http://paste.ubuntu.com/14475697/
Error screenshot:
Try the following,
Create a .htaccess file and put the following directive
Options Indexes
Follow the link,
http://www.cyberciti.biz/faq/enabling-apache-file-directory-indexing/

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.

Loading ImageMagick from Apache (XAMPP)

I wrote an image manipulating program with PHP/imagick. The server is installed under XAMPP, which resides in a flash drive.
Now everything works fine except that ImageMagick needs to be installed on every machine I use.
To solve the problem and make it easier, I copied the ImageMagick folder to the flash drive, removed ImageMagick from Windows Environment Variables, and modified Apache config (tried both httpd.conf and extra/httpd-xampp.conf).
httpd.conf
SetEnv MAGICK_HOME "/xmapp/ImageMagick"
extra/httpd-xampp.conf
<IfModule env_module> <----- enabled
SetEnv MIBDIRs "xampp/php/extras/mibs"
SetEnv MAGICK_HOME "/xampp/ImageMagick" <-----
SetEnv MySQL_HOME "/xmapp/mysql/bin"
However, when I started Apache, I got a error message saying "Cannot find CORE_RL_wand_.dll". I'm pretty sure the path is correct and no files are missing. It seems that Apache just can't load ImageMagick.
Here are the versions I'm using:
XAMPP 1.8.2 (Apache 2.4.4 / PHP 5.4.19)
ImageMagick-6.8.7-1-Q16-x86-dll
php_imagick_ts.dll for PHP 5.4 (from Mikko)
Does anyone have any experience with portable ImageMagick/XAMPP?
Is this the correct way to load ImageMagick from Apache?
Try to add to the system path the Imagick's path. Maybe you also have to add as environment variable the MAGICK_HOME. That solved my problem.

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!