I tried to create a virtual host for local xampp apache (windows7) with no luck.
What I tried:
hosts contains:
127.0.0.5 mycloud
httpd-vhosts.conf contains:
<VirtualHost 127.0.0.5:80>
DocumentRoot \\WDMYCLOUD\user
ServerName mycloud
DirectoryIndex index.html index.php
<Directory "\\WDMYCLOUD\user">
Options Indexes FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
apache runs as service as local user, not System.
'user' in directory has same password on local machine and NAS. It includes an index.html.
I tried a lot of different variations, but mostly apache won't start. With this configuration apache starts but eror log shows following:
[Fri May 15 08:51:49.224900 2015] [authz_core:error] [pid 12280:tid 1720] [client 127.0.0.1:53075] AH01630: client denied by server configuration: C:/WDMYCLOUD
The network drive must have the letter Z: and not C:.
Can anyone help? Thanks.
Related
I'm trying to put a website online from my webserver.
To do that, I've created a virtualHost with Wamp, which is correctly reached when I'm on the local app.
But, when i try to access the website from another computer (from another domain), I've got a 503 error :
You dont have permission to access this resource. Apache/2.4.46 Php/7.4.9 Server at XXX.XXX.XX.XX (mypublicip) Port 80
Here is my httpd-vhosts.conf :
<VirtualHost *:80>
ServerName espaceclient
ServerAlias espaceclient
DocumentRoot "C:/wamp64/www/espace_client/public"
<Directory "C:/wamp64/www/espace_client/public">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Here is my .htaccess, located in my public folder :
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
I've already tried to put a copy of the .htaccess in the root of my project and a lot of configurations, but i don't find...
The port 80 is opened and I've deactived the firewall and the antivirus to test.
If someone has an idea... :p
I followed your advice and configure a new VHost like that :
ServerName espaceclienttest.abiolab.fr
ServerAlias www.espaceclienttest.abiolab.fr
DocumentRoot "C:/wamp64/www/espace_client/public"
<Directory "C:/wamp64/www/espace_client/public/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
I've also configured the ssl like the second link you put.
In local, when I access to " espaceclienttest.abiolab.fr", it's ok it works, but from the outside, I already have the 403 forbidden error (you can try this link, you will see what I mean : http://espaceclient.abiolab.fr
In my Apache Log, I find this :
[Fri Oct 15 10:28:07.841191 2021] [authz_core:error] [pid 3004:tid
1300] [client 92.184.112.230:50363] AH01630: client denied by server
configuration: C:/wamp64/www/favicon.ico, referer:
http://XXXX.XXX.XX.XX/espaceclient
I've got the same message while trying with other url adress, like :
[Fri Oct 15 10:23:07.606404 2021] [authz_core:error] [pid 3004:tid
1300] [client 92.184.112.230:60946] AH01630: client denied by server
configuration: C:/wamp64/www/favicon.ico, referer:
http://XXXX.XXX.XX.XX/espaceclienttest.abiolab.fr
It looks like it can't access to the folder C:\wamp64\www\espaceclient ! And indeed, this folder does not exists ! I've just C:\wamp64\www\espace_client with a '_' !
But why is it renaming it like this ? My .htaccess does not change this...
EDIT : I finally found the problem ! It seems like my public IP was shared with another server in my domain... So, the site was reachable from all PCs not in my domain but for the others, I had a redirection to an other server who does not work anymore...
Thanks for help !!
I try to run very basic php app using apache and docker compose and have a problem with apache settings. When I try to access any static file in subdirectory I get lack of permissions. PHP calls seem to work fine.
So:
when I try to request localhost/LICENSE.txt I get the license.
when I try to access localhost/test.php or localhost/app/test.php it works fine
when I try to access localhost/app/test.html I get Forbiddenin
the browser andclient denied by server configuration:
/var/www/localhost/htdocs/src/app/test.html` in error log
Of course files I try to request are in the right locations.
Here's apache version I am trying to run:
/var/www/localhost/htdocs # httpd -v
Server version: Apache/2.4.33 (Unix)
Server built: Mar 27 2018 11:32:10
Here's my host config:
<VirtualHost *:80>
ServerAdmin test#example.com
DocumentRoot /var/www/localhost/htdocs/src
ServerName schmidt.local
<Directory "/var/www/localhost/htdocs/src">
#
# 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
RewriteEngine On
</Directory>
<LocationMatch "^/(.*\.php(/.*)?)$">
ProxyPass fcgi://php-fpm:7000/var/www/localhost/htdocs/src/$1
</LocationMatch>
</VirtualHost>
So as you can see I already have request instead of allow as suggested here.
i use xampp on mac os and i want to add virtual host on it
i use this code on apaceh config
<VirtualHost 127.0.0.1:80>
ServerName mvcproject.local
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/mvcproject/public"
</VirtualHost>
<Directory "/Applications/XAMPP/xamppfiles/htdocs/mvcproject/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
and change my host like this
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 Masouds-MacBook-Pro.local # added by Apache Friends XAMPP
127.0.0.1 mvcproject.local
but i have this error
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500
mvcproject.local
Apache/2.4.33 (Unix) OpenSSL/1.0.2o PHP/7.2.5 mod_perl/2.0.8-dev Perl/v5.16.3
How can i solve this problem?!
thanks.!
These are some point to help in create virtual host on mac
/Applications/XAMPP/xamppfiles/etc/httpd.conf in this file uncomment the
include line
Virtual hosts
Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf
Add your site into vhosts file
/Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf
My custom host
<VirtualHost *:80>
ServerName mysite.local
DocumentRoot "/Users/yourusername/path/to/your/site"
<Directory "/Users/yourusername/path/to/your/site">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "logs/mysite.local-error_log"
</VirtualHost>
Edit your host file
sudo nano /etc/hosts
#Add the following line
127.0.0.1 mysite.local
Restart your XAMPP
Setting up a new dev server to work on PHP7 and get some training in and run across an impasse.
I can access the server from localhost, 127.0.0.1 no problem. However when I go to another computer on the LAN. I get the dreaded:
Forbidden
You don't have permission to access /dev/lab.php on this server.
So just to be on the safe side I used the new interface to see how the new setup would create a vhost. The vhost works fine locally but not from another PC on the LAN. The apache_error.log shows:
[authz_core:error] [pid 3408:tid 928] [client 192.168.1.38:54761] AH01630: client denied by server configuration: C:/wamp64/www/dev/lab.php
From everything I was reading it should have been a simple change of this
<VirtualHost *:80>
ServerName dev
DocumentRoot c:/wamp64/www/dev
<Directory "c:/wamp64/www/dev/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Which you can see I changed the Require local to Require all granted.
No JOY!
Still getting Forbidden access on the other LAN PC.
Once I changed the localhost to all granted. The sub-directories started working. Then I could get to http://192.168.1.36/dev with no problem.
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Thanks for the tips. i was stuck with WampServer Version 3.0.6 64bit access (Apache Version 2.4.23) and this code worked.
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
in case if you have changed port no of apache server you have to give same port no in below configuration. for example if your apache port no is 8080 then it you need to replace existing code in httpd-conf file
<VirtualHost *:8080>
ServerName dev
DocumentRoot c:/wamp64/www/dev
<Directory "c:/wamp64/www/dev/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
currently i am trying to setup a hhvm server. PHP Applications works fine for me, hack lang php files not.
My local sandbox returns (every request in error.log):
[Fri Jun 20 15:31:43.725292 2014] [proxy:debug] [pid 26542] proxy_util.c(1694): AH00925: initializing worker fcgi://127.0.0.1:9000/var/www/hhvm.local/$1 shared
[Fri Jun 20 15:31:43.725314 2014] [proxy:debug] [pid 26542] proxy_util.c(1734): AH00927: initializing worker fcgi://127.0.0.1:9000/var/www/hhvm.local/$1 local
[Fri Jun 20 15:31:43.725325 2014] [proxy:debug] [pid 26542] proxy_util.c(1785): AH00931: initialized single connection worker in child 26542 for (127.0.0.1)
My Apache Config:
<virtualhost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin admin#domain.de
ServerName hhvm.local
ServerAlias www.hhvm.local
# Index file and Document Root (where the public files are located)
DirectoryIndex index.php index.html
DocumentRoot /var/www/hhvm.local
# Custom log file locations
LogLevel debug
#LogLevel warn
ErrorLog /var/www/hhvm.local/log/errors.log
CustomLog /var/www/hhvm.local/log/access.log combined
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/hhvm.local/$1
<Directory /var/www/hhvm.local>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo All
Order allow,deny
Allow from all
Require all granted
</Directory>
Apache (2.4) is running, HHVM Daemon (3.0) is running,
~$: hhvm index.hh
<!DOCTYPE html><html><head></head><body>Hello World!<br />Running on HHVM version 3.1.0</body></html>
If i call "hhvm.local" the server response a 500 Internal Server Error.
OS: Ubuntu 14.04
Could anybody help me? :)
What happens when you do hhvm index.php
- index.php with only a echo is enough
Does it ouput something?
Yes?
Try service hhvm start
At least at my setup hhvm did not always start on it's own ...
No?
Then you probably have an install issue. There are 2 ways to install HHVM on ubuntu
- self compiling
- pre built
I personly use the pre built. At least the is the way I got it working :)
Hope it helps
Your ProxyPassMatch isn't set up to sniff out hh file extensions. You should use the following instead...
ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/hhvm.local/$1