Can't access .htaccess file - apache

I've installed a application on my RHEL 7.x server. During a installation wizard which I reach over a common browser, the application will test some components of the installation. During this "system-checks" I get the error message test on .htaccess file failed.
In the httpd.conf are the permission set :
<Directory "/var/www/html/>
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
What confuses me a bit is that the .htaccess file is lost after a restart of httpd. service it always disappears, so it is no longer visible.
Server version: Apache/2.4.6 (Red Hat Enterprise Linux)
Also the Selinux permissions and the permissions inside /var/www/html are correct. I don't know more, please let me know if you need more information.
Best regards,
Nico

Related

Apache HTTP server configuration for CGI directory

Assuming the default options for the directories are defined by
<Directory "/path">
Options Indexes FollowSymLinks Includes
</Directory>
When using the directive
ScriptAlias /cgi-bin/ "/path/cgi-bin/"
... is it required (or advisable or unsecure, etc) to also specify the option ExecCGI? e.g.
<Directory "/path/cgi-bin">
Options ExecCGI
</Directory>
I think it is necessary, because your allowing the Execution of CGI (hence ExecCGI). Its not unsecure, but default way of enabling CGI script execution in the said directory.

Cannot access my Wampserver thru global ip

I need to access my wamp for a moment thru my global IP address. But I can't. I'm using the latest WAMP 2.5 for 32-bit.
It has worked before when I've had earlier versions of wamp. Just go to tray icon > Put Online and voila. Seems like they changed something.
Even if I put it online I cant access it. It says wamp is online.
I don't get any "access denied" which you used in earlier versions of wamp, it just keeps loading until timeout and then I get browser can't reach website error message. "This website is not available" google chrome.
I have DMZ set up on the comp so the ports are not a problem.
In httpd.conf I found this (this is default):
<Directory "c:/wamp/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Require all granted
</Directory>
Any ideas?

Localhost Error (403 Forbidden) with Yosemite

First, I looked on this page [Apache localhost 403 error with Yosemite because the person seems to have the same problem as me. I tried differents things but its doesn't work for me. When I write localhost in my url I receive a 403 Forbidden "You don't have permission to access / on this server". Sorry, I'm an beginner. I don't really know what kind of informations that you need to know to help me to fix that.
My directory /Users/schan/Sites/
My user.conf (schan.conf) is
<Directory "/Users/schan/Sites/">
Options Indexes MultiViews
AllowOverride All
Require all granted
</Directory>
My httpd.conf (some informations tell me if you need more)
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/Users/schan/Sites"
<Directory "/Users/schan/Sites">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options FollowSymLinks Multiviews
MultiviewsMatch Any
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
If you write 'localhost' in your url, the following directory is called on yosemite: /Library/WebServer/Documents/
which is not the same as /Users/schan/Sites
you would call /Users/schan/Sites using:
http://localhost/~schan
Getting a 403 on 'localhost' on my Yosemite happens, if i drop the read-permission from the Documents Folder, it should be 644 or, in Finder Info it would say
System read and write
wheel read only
everyone read only
For setting up the local user, i found this link the most helpful and complete: http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-10-yosemite/

I cannot access XAMP on an HP SERVER with 4 IP Addresses

I have a problem accessing my XAMP server on an HP SERVER DL360G7 that has 4 IP address. Here are the networks.
172.22.46.x
and
172.22.7.x
I managed to access my site using the 172.22.7.x network. However, when I try to browse using any computer under the 172.22.46.x network, the server doesn't reply anything.
Here is my APACHE config
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
Require ip 172.22.46
Check if apache is bound against any address instead of just 1 server IP. When you execute the function netstat -tupl in the console and search for httpd, does it bind to * or to a specific IP?
Else check your httpd.conf for the Listen command. There shouldn't be any specific IP if you want it to listen to all interfaces.
More info here

how to access phpmyadmin remotely

Is it possible to access phpmyadmin from outside the network?
Where do I set it? I tried editing httpd.conf, and restarted all services from wampserver but it doesn't work
<Directory />
Options FollowSymLinks
AllowOverride None
Order Allow,Deny
Allow from all
</Directory>
Go to C:\wamp\alias and edit the file phpmyadmin
# to give access to phpmyadmin from outside
# replace the lines
#
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#
# by
#
# Order Allow,Deny
# Allow from all
# Edit C:\wamp\alias\phpmyadmin.conf
# Below is v3.5.1 - the current version is 4.0.4.1
Alias /phpmyadmin "c:/wamp/apps/phpmyadmin3.5.1/"
# to give access to phpMyAdmin from outside
# replace the lines
#
# Require local
#
# by
#
# Require all granted
#
<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require all granted
</Directory>
Are you on Unix or Windows? If on Unix, check the owner/permissions for the directory that phpMyAdmin is installed under - that might have something to do with it.
It looks to me as if you're trying to access a private address from a remote network. You can't. You will have to configure a webserver on your machine and use a ddns (in case you don't have a fixed public ip) service on your server. You will probablly have to redirect port 80 incoming traffic on your router pointing to the webserver machine also.
just for reference of other users who will encounter this kind of issue I would like to remind everyone that aside from changing directories, you must also have to check your firewall settings.
It happened to me, I've changed everything (all config in xampp) but still cannot connect. I almost gave up and then I remembered firewall. After I changed my settings it all works fine.
just sharing
Did you try like this ? Maybe you shuld add directory name in your network ?
<Directory "/Documents and Settings/All Users/Documents/xampp/phpMyAdmin">
...
...
...
...
</Directory>
Put below code in file
D:\wamp\alias\phpmyadmin.conf
< Directory "D:/wamp/apps/phpmyadmin3.2.0.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
Allow from 127.0.0.1
< /Directory>