im trying to open my wamp server with my android device but i get "android you don't have permission to access / on this server" apache version is 2.4.18.i tryed to modify httpd.conf but it doesnt work.Now its like this:
DocumentRoot "c:/wamp64/www"
<Directory "c:/wamp64/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
Order Deny,Allow
Allow from all
</Directory>
I hope you can help me
For newer versions of WampServer (3.0+) you do not need to two things :
1) Modify the file httpd.conf
Go to directory where wamp is installed eg
C:\wamp64\bin\apache\apache2.4.23\conf and edit the following :
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/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 +Multiviews
#
# 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
Edit Require none to Require all granted
2) Now go to C:\wamp64\bin\apache\apache2.4.23\conf\extra\httpd-vhost.conf and do the same change to the Virtual Host defined for localhost
AllowOverride All
Require all granted
Restart the server it should work
Related
I'm trying to get my site deployed using Laravel on an AWS EC2 instance running CentOS7. I've checked to make sure the ports and traffic settings are correct and they are as I was able to hit the apache landing page prior to editing the conf and I am also able to ssh in and ping the IP, but I believe I am possibly having some issue with the config files. This is what I hit when I hit the endpoint:
My httpd is running and I was able to access the apache landing page prior to editing my config files.
Here is the main part of my httpd.conf (please note: I didn't include the whole thing because it is massive and consists of mostly commented out code):
# 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 "/var/www/[project_path]/public"
#
# Relax access to content within /var/www.
#
<Directory "/var/www/[project_path]/public">
AllowOverride All
# Allow open access:
Require all granted
</Directory>
# Further relax access to the default document root:
<Directory "/var/www/[project_path]/public">
#
# 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>
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ".ht*">
Require all denied
</Files>
and here is my added project.conf file inside of conf.d:
<Directory "/var/www/[project_path]/public">
AllowOverride All
# Allow open access:
Require all granted
</Directory>
# Further relax access to the default document root:
<Directory "/var/www/[project_path]/public">
#
# 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>
<Directory "/var/www/[project_path]/public">
Options -Indexes
</Directory>
<VirtualHost hostIP:80>
ServerName hostIP
DocumentRoot /var/www/[project_path]/public
TraceEnable Off
</VirtualHost>
ServerTokens Prod
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>
<IfModule mpm_prefork_module>
StartServers 50
MinSpareServers 10
MaxSpareServers 30
ServerLimit 50
MaxClients 50
MaxRequestsPerChild 100
</IfModule>
Any help would be greatly appreciated!
Your RewriteEngine is redirecting port 80 to HTTPS which goes to port 443 which is not defined.
If you want to run the server under port 80 (HTTP connection), remove the
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>
Resolved this by adding an ssl.conf file along with a project.conf.bak in conjunction with the project.conf file
Checked almost stackoverflow answers but getting same error, using windows server 2012 installed XAMPP( Apache/2.4.33 (Win32) OpenSSL/1.0.2o PHP/5.6.36 ).
xampp does not access any project from htdocs other than xampp dashboard.
Error :
httpd-vhost.conf :
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/mysite"
ServerName local.yourdomain.com
<Directory "C:/xampp/htdocs/mysite">
Require all granted
</Directory>
</VirtualHost>
hosts :
127.0.0.1 localhost
127.0.0.1 local.yourdomain.com
httpd.conf :
DocumentRoot "C:/xampp/htdocs/mysite"
<Directory "C:/xampp/htdocs/mysite">
#
# 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 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
</Directory>
I have found that these 403 errors are (almost) always Apache configuration errors. Unfortunately there is not a lot of diagnostics in the logs for this.
Try this in your httpd-vhosts.conf file:
<VirtualHost *:80>
ServerName example.local
DocumentRoot "C:\Users\shipl\htdocs\example"
<Directory "C:\Users\shipl\htdocs\example">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Your hosts then would have:
127.0.0.1 localhost
127.0.0.1 example.local
Note that 'example.local' and '\htdocs\example' must be consistent in all the references.
Hope this helps.
I have a zend project. It was working before, nothing changed in the source. When it was working it was on manually instaled apache 2.2 , php 5.3 . After that I installed xampp but apache was showing error on every post i made (sometimes it makes double post). I decided to install apache 2.2 and php 5.4 but now its showing me "The page isn't redirecting properly".
My apache configuration (lines that I changed):
httpd.conf:
LoadModule php5_module "c:/Apache2.2/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
PHPIniDir "c:/Apache2.2/PHP"
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
LoadModule rewrite_module modules/mod_rewrite.so
<Directory "C:/Apache2.2/htdocs">
#
# 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.2/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.
#
Order allow,deny
Allow from all
</Directory>
httpd-vhosts:
<VirtualHost *:80>
ServerAdmin webmaster#rma.com
DocumentRoot "C:\Apache2.2\htdocs\rma\public"
ServerName rma.com
ErrorLog "logs/rma-error.log"
CustomLog "logs/rma-access.log" common
SetEnv APPLICATION_ENV "development"
<Directory C:\Apache2.2\htdocs\rma\public>
Options Indexes MultiViews FollowSymLinks
DirectoryIndex index.php index.html
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
php.ini
[APC]
extension=php_apc.dll
apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 64M
apc.max_file_size = 10M
apc.stat=1
extension_dir = "C:\Apache2.2\PHP\ext"
What I am doing wrong? There is nothing changed in the source and its kind of working in xampp and wamp ? Thanks !
It turned out that php 5.4 have some problems with apc. Now i am using xcache. Hope this helps someone.
I know that there are a billion questions about that, but I cannot make it work.
What have I done so far :
Change my httd.conf file so that the DirectoryRoot is /home/ec2-user/folder.
Restarted my apache server.
chmod -R 775 /home/ec2-user/folder
Changed my httd.conf (only the changed lines are in here)
...
#
# 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 "/var/www/html"
DocumentRoot "/home/ec2-user/folder"
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
# Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
# Allow from all
Require all granted
</Directory>
and then this :
# This should be changed to whatever you set DocumentRoot to.
#
#<Directory "/var/www/html">
<Directory "/home/ec2-user/folder">
#
# 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.2/mod/core.html#options
# for more information.
#
# Options Indexes FollowSymLinks
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:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Order allow,deny
# Allow from all
Require all granted
</Directory>
and then this :
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
#Listen 80
Listen 0.0.0.0:80
But I still have permission denied on /file.php.
What am I missing?
EDIT : I have also changed the DocumentRoot. Before that, I had a wrong url error, now I do not have the permissions. So, right now, the url is correct, I just haven't set the correct permissions for it.
I didn't do something different from the above - but after restarting my Apache and exiting my AWS a number of times - then it magically worked. By following the above steps and checking the logs for errors, you should have it fixed.
I have been trying to rewrite the url.
Here is the content from my httpd.conf
<Directory "C:\wamp\www\base">
Options None
AllowOverride all
Order deny,allow
Allow from all
Satisfy all
</Directory>
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory C:\wamp\www\base>
#
# 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.2/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.
#
# onlineoffline tag - don't remove
Options None
AllowOverride all
Order Deny,Allow
Allow from all
Allow from 127.0.0.1
</Directory>
Error log from apache:-
error] [client 127.0.0.1] client denied by server configuration: C:/wamp/www/base/category
.htaccess file under base directory
Options +Indexes
Options +FollowSymLinks
RewriteEngine On
RewriteBase /base/
RewriteRule ^category /category.php
Before i was not doing url rewriting. If i remove .htaccess from base directory then it works fine.
so can anyone help me to enable url rewriting?