This might be a dumb question, but anyway here it goes.
From the below link I could see that default config link for apache httpd2 is at
"/usr/local/apache2/conf/httpd.conf"
https://wiki.apache.org/httpd/DistrosDefaultLayout
how ever when I install httpd using yum on centos 6 and 7 config files seems to be at "/etc/httpd/conf/httpd.conf
Why doesn't yum install it to the location defined on the default distribution layout.
Default location primary httpd config file for Fedora Core, CentOS, RHEL is /etc/httpd/conf/httpd.conf
In general the path /usr/local is meant for "locally" installed packages. For a single computer that probably just means packages installed outside of the normal distribution. So I would argue a package manager like yum shouldn't even touch anything under /usr/local.
On the other hand it makes sense for the apache project to specify their default paths there, since if you download Apache directly from their site and install it you do it outside of your standard system distribution.
Standard installation of Apache 2.4 on Ubuntu puts the apache2.conf file in /home/miro/etc/apache2. You can locate the main config file using:
/usr/sbin/apache2 -V | grep SERVER_CONFIG_FILE
Modify the path /usr/sbin/ to the location of the installation, if you have changed its default when installing.
Related
I am currently setting up a JBoss EAP 7 cluster in domain mode and the goal is for an apache webserver to be installed as a load balancer. However, I am unable to install the httpd service from yum repositories as this is a VM that was provisioned by a client. I need to install httpd from its source which I have downloaded. My problem is that I am not sure about the configuration options to enable for this purpose. Any help would be appreciated. From the official website, the instruction doesn't give details about what modules to be enabled and I'm not sure which of them are relevant for my own purpose.
Download Download the latest release from http://httpd.apache.org/download.cgi
Extract $ gzip -d httpd-NN.tar.gz
$ tar xvf httpd-NN.tar
$ cd httpd-NN
Configure $ ./configure --prefix=PREFIX
Compile $ make
Install $ make install
Customize $ vi PREFIX/conf/httpd.conf
Test $ PREFIX/bin/apachectl -k start
Above provided link will contain all module which provided with default Apache httpd. You can download the Apache httpd source folder and check module information in modules.In Apache source module/proxy folder contains module information regarding the proxy configuration. i.e mod_proxy module.
I was able to do my installation by following the guide here
After I updated to php7.0 now it's viewing the files, I firstly thought it was in apache itself, but i have reinstalled it, what could be the problem..?
ubuntu 15.04
Install PHP 7 and the Apache PHP module as follows:
apt-get -y install php7.0 libapache2-mod-php7.0
Then restart Apache:
service apache2 restart
Another possible reason could be short open tag. Configure php.ini files related line as: short_open_tag = On and restart php service.
I was trying to use mod_rewrite but without success.
I searched online and found some articled but didn't solve my problem.
I finally realised that this article must solve my problem http://www.ewhathow.com/2013/09/how-to-enable-mod_rewrite-on-apache/
but the file mod_rewrite.so is missing under my system.
I have to note that i am using Centos 6 64BIT
.Is there any way to solve this ?
I tried my self to install xampp on an other computer go to modules folder and copy the mod_rewrite.so file and copy it on my server .After that i added
this
LoadModule rewrite_module modules/mod_rewrite.so
on /etc/httpd/conf/httpd.conf
But after restarting apache…apache couldn't start…so i deleted again the line and apache restarted successfully.
I want to make mod_rewrite works on my server.Any help ?
Thanks in advance
I am using Apache on CentOS 6.5 installed from the installation CD and it does have /etc/httpd/modules/mod_rewrite.so file. If this file is missing, I think you would be compiling your own Apache. In this case, you need to modify the SPEC file for apache and add --enable-rewrite to the configure line in the %setup section:
SPEC file %setup section:
%setup
./configure --prefix=%apache_dir --enable-rewrite
Build apache again and install the RPM and the mod_rewrite.so should be in the modules folder after it finished installing.
Options and modules available to compile on Apache:
http://httpd.apache.org/docs/2.2/programs/configure.html
The other thing you could probably do would be to install Apache using yum install httpd on a test system and grab the mod_rewrite.so file from the installation, save and copy to the modules folder on the system you're trying to get working. This would be my last resort method..
Without more information on what you have installed:
rpm -qi httpd
it hard to tell what would work best for your situation.
All of the sudden I started getting 404s for files like http://example.localhost/javascript/jquery.min.js
Earlier everything was working just fine. I didn't change any configs, at least not manually.
But now if I'd try to access the /javascript directory itself I would get "Cannot serve directory /usr/share/javascript/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive in the Apache error log.
I was trying to find solution to this on Stack Overflow, but I couldn't. So I'm just leaving this here if anyone happens to encounter the same problem.
So why the hell would it look in the /usr/share/javascript instead of what I had configured in the VirtualHost. To figure that out I did something like the following:
$ cd /etc/apache2
$ grep -R Alias * | grep share
...
conf-enabled/javascript-common.conf:Alias /javascript /usr/share/javascript/
...
After googling for that configuration file name I found some explanation.
I don't know why, but I had the javascript-common package installed.
It doesn't seem harmful to get rid of it, so doing $ sudo apt-get purge javascript-common solved the problem for me.
You don't need to edit the conf file or purge the package just disable it.
a2disconf javascript-common
service apache2 reload
If for some reason you want to use that conf:
a2enconf javascript-common
service apache2 reload
The issue:
Web applications that use JavaScript need to distribute it through
HTTP. Using a common path for every script avoids the need to enable
this path in the HTTP server for every package.
This is the package that creates /usr/share/javascript alias and enables it in the Apache webserver.
Recommended fix
And that's it. You won't have any other problem with javascript directories. Another fix could be to rename /usr/share/javascript/ to /usr/share/javascript-common/, then adjust the Alias in javascript-common.conf to point to the renamed directory. I am still not sure if this will affect any future update.
Another Fix:
Go to /etc/apache2/conf-available/javascript-common.conf. You will find this:
Alias /javascript /usr/share/javascript/
<Directory "/usr/share/javascript/">
Options FollowSymLinks MultiViews
</Directory>
So you just have to comment these lines (with the # char) (it is not recommended to edit the file directly in conf-enabled) to avoid the forbidden error. After that, do this:
a2disconf javascript-common
a2enconf javascript-common
I'm on a Debian machine, and there is no a2disconf command. I found the /etc/apache2/conf.d directory is a link to /etc/javascript-common/javascript-common.conf.
I went and edited that file (as root) and changed it to alias /javascript-common instead of /javascript by changing the top line to
Alias /javascript-common /usr/share/javascript/
and saving it and restarting Apache.
I just had a similar problem on an Ubuntu system. Apparently the javascript-common package was hosed at some point in time and the configure script wouldn't run properly. Removing javascript-common and reinstalling with apt-get would not fix it. I had to:
dpkg --purge javascript-common
apt-get install javascript-common
And that seemed to fix the problem. This is an Ubuntu 16.04 LTS (Xenial Xerus) system that was upgraded from Ubuntu 14.04 LTS (Trusty Tahr).
Uninstall apache2 and delete these folders:
rm -R /var/www/html/
rm -R /etc/apache2
Then reinstall javascript-common and apache2.
How do I change the APXS environmental variable to use an apxs tool from a different location?
I am trying to install an Apache module to my MAMP installation. I can successfully install the module using $ apxs -cia mod_ftp_example.c. However, the global apxs command is using the apxs tool that comes configured for the MAC OS X pre-installed Apache server, instead of using the apxs tool located in my MAMP build.
This means that when I execute the apxs command in Terminal, the module's .so file is installed here:
/usr/libexec/apache2
This is installing the module to the Apache server that comes with the Mac, and not my MAMP build. The path to the library modules that I want to install my module's .so file into is actually here:
/Applications/MAMP/Library/modules
Now, when I execute the command $ whereis apxs, I see the apxs tool is located in /usr/sbin/apxs - again, this is inside the httpd build for the default OS X Apache server and not my MAMP server.
My theory is that if I can change the whereis location of the apxs, then I can install my modules into the correct location. So how can I change that location? I tried the following, but it doesn't seem to work :/
$ APXS=/applications/mamp/library/bin/apxs
Any ideas??? Thanks!
If your just running APXS directly you can just use the full path
i.e. instead of
apxs -cia mod_ftp_example.c
you can do
/applications/mamp/library/bin/apxs -cia mod_ftp_example.c
If your running the apache ./configure.apxs you can do
export APXS=/applications/mamp/library/bin/apxs
If your doing some other kind of script you could always change the precedence of your path:
export PATH=/applications/mamp/library/bin/:$PATH