When I try to install simpleSAMLPH I have this message:
Forbidden
You don't have permission to access /simplesaml/module.php/core/frontpage_welcome.php on this server.
Apache/2.4.9 (Win64) PHP/5.5.12 Server at simplesaml.dev Port 80
And I don't understand why their is my file httpd-vhosts.conf :
NameVirtualHost simplesaml.dev
<VirtualHost simplesaml.dev>
ServerName simplesaml.dev
DocumentRoot C:/wamp/www/var/simplesamlphp/www
Alias /simplesaml /var/simplesamlphp/www
</VirtualHost>
I also do all the change in the file config.php of the library simpleSAMLphp.
Try to add the following configuration to your VirtualHost configuration:
<VirtualHost simplesaml.dev>
ServerName simplesaml.dev
DocumentRoot C:/wamp/www/var/simplesamlphp/www
Alias /simplesaml /var/simplesamlphp/www
<Directory />
Require all granted
</Directory>
</VirtualHost>
Related
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
I know I'm probably missing something simple, but I've exhausted all resources trying to get this working.
I'm running my Apache on Port:5000 and trying to direct to lsapp.dev instead of http://localhost:5000/lsapp/public/ with:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/lsapp/public"
ServerName lsapp.dev
</VirtualHost>
I have tried VirtualHost *:5000 but still can't get it work?
you can use this on command line in your project root
php artisan serve --port=your_port_number
or do this:
edit httpd-vhosts.conf that is located in C:\xampp\apache\conf\extra\httpd-vhosts.conf and add following lines at the end of the file:
# VirtualHost for LSAPP.DEV
<VirtualHost lsapp.dev:80>
DocumentRoot "C:\xampp\htdocs\lsapp\public"
ServerAdmin lsapp.dev
<Directory "C:\xampp\htdocs\lsapp">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
our apache is listening to lsapp.dev connections, but we have to configure our hosts file that allows to redirect lsapp.dev to the localhost that is located in C:\Windows\System32\drivers\etc
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 lsapp.dev
Set your Virtual host file like this.
<VirtualHost *:80>
DocumentRoot "D:\laravel Task\laravel\blog" //here set your project storage path
ServerName localhost.test.com // set your url for your project
<Directory "D:\laravel Task\laravel\blog"> // again set your project storage path
AllowOverride All
Order allow,deny
Allow from all
Require all granted
set your hosts file like this
127.0.0.1 localhost.test.com
Now you can Run your project
localhost.test.com
//OR//
If you dont want to use virtual host, then you can run your project like this
goto your project folder=>
command line in your project root=>php artisan serve
your project will run in
http://127.0.0.1:8000/
Currently, I have XAMPP setup to where typing 127.0.0.1 in the browser redirects me to the home page found within htdocs.
I would like to be able to type "devtest" and have that be an alias for 127.0.0.1.
What I have tried so far is modifying: C:\xampp\apache\conf\extra\httpd.vhosts.conf where I added an entry that looks like:
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host2.example.com
DocumentRoot C:\xampp\htdocs\Workspace\MyProject
ServerName devtest
ErrorLog C:\xampp\htdocs\Workspace\MyProject\MyProject-error_log
CustomLog C:\xampp\htdocs\Workspace\MyProject\MyProject-access_log common
</VirtualHost>
Is there another step I'm missing?
Open the hosts file in Notepad:
C:\Windows\System32\drivers\etc\hosts
Add the line:
127.0.0.1 devtest
Navigate to: http://devtest
Use this, and make sure you enable using vhosts config file in apache.
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\Workspace\MyProject"
ServerName devtest.local
<Directory "C:\xampp\htdocs\Workspace\MyProject">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I just started learning php and I am trying to host locally my own php website by using XAMPP.
I wanted to create virtual host with:
URL: myphpwebsite.local
Port: 8088
But when I attempted to access this website through the browser I got a:
Not Found
HTTP Error 404. The requested resource is not found.
Does anyone know what the problem is?
My httpd-vhosts.conf
NameVirtualHost 127.0.0.1:8088
<VirtualHost 127.0.0.1:8088>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost myphpwebsite.local>
DocumentRoot "C:/Microsoft/Workspace/myphpwebsite"
ServerName myphpwebsite.local
ErrorLog "C:/Microsoft/Workspace/myphpwebsite/logs/myphpwebsite.local.error.log"
CustomLog "C:/Microsoft/Workspace/myphpwebsite/logs/myphpwebsite.local.custom.log" combined
<Directory "C:/Microsoft/Workspace/myphpwebsite">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
And my C:\Windows\System32\drivers\etc\hosts file:
127.0.0.1 localhost
127.0.0.1 myphpwebsite.local
Any help would be appreciated!
make sure there's file/htaccess/index or whatever in directory you want to open, 404 may comes from that ;)
try using one below, eventually replace your port:
<VirtualHost *:80>
DocumentRoot "C:/Microsoft/Workspace/myphpwebsite"
ServerName myphpwebsite.local
</VirtualHost>
the question is your Apache running/serving on port 8088?
For example my xamp is running on 80 and 443...
xamp control panel is very handy, it has nice logs button that will open your log files to show you php and apache errors etc. check it out.
Try going with default port, if it works it means that you need to play with ports if you really want to.
just a quick tip, .com is shorter than .local and if you're using chrome and it works like mine then most of the time something.local will redirect you to google search (and I like my search there, you can switch it off ;))
I don't know if I am much help, but using WAMP, here are my settings. I am listening on port 80, I use 8080 for my tomcat server.
hosts file
127.0.0.1 local.mysite.com
httpd-vhosts.conf
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
....
<Directory "c:/wamp/www">
Options Indexes MultiViews FollowSymLinks
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
<VirtualHost *:80>
ServerName localhost
DocumentRoot "c:/wamp/www"
</VirtualHost>
<Directory "c:/wamp/www/path/to/site/root">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
ServerName local.mysite.com
DocumentRoot "c:/wamp/www/path/to/site/root"
ServerAdmin me#email.com
ProxyPreserveHost Off
RewriteEngine On
AllowEncodedSlashes NoDecode
#AllowEncodedSlashes On
ErrorLog "c:/wamp/www/path/to/logs/error.log"
CustomLog "c:/wamp/www/path/to/logs/access.log" common
</VirtualHost>
....
Then I can access my local site like this: http://local.mysite.com
Hope this helps...
The NameVirtualHost directive needs to match the value of VirtualHost exactly, and you need to specify the port in each instance. If you want to use port 8088 for myphpwebsite.local, you'd need to do:
NameVirtualHost 127.0.0.1:8088
<VirtualHost 127.0.0.1:8088>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost 127.0.0.1:8088>
DocumentRoot "C:/Microsoft/Workspace/myphpwebsite"
ServerName myphpwebsite.local
ErrorLog "C:/Microsoft/Workspace/myphpwebsite/logs/myphpwebsite.local.error.log"
CustomLog "C:/Microsoft/Workspace/myphpwebsite/logs/myphpwebsite.local.custom.log" combined
<Directory "C:/Microsoft/Workspace/myphpwebsite">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Notice the VirtualHost opening tags are identical; it's the ServerName value that actually tells Apache which domain this particular directive applies to. Restart your server after making the changes. Check out this page for more information: http://httpd.apache.org/docs/2.2/vhosts/name-based.html
Hope this helps!
Make sure that the port you are using is not being used by another service.
I created a project in zendframework:
zf create project dev.gamenomad.com
Then, I put this:
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host.localhost
DocumentRoot "C:/apache/docs/dev.gamenomad.com/public"
ServerName dev.gamenomad.com
ServerAlias dev.gamenomad.com
ErrorLog "logs/dev.gamenomad.com-error.log"
CustomLog "logs/dev.gamenomad.com-access.log" common
</VirtualHost>
and I put this:
127.0.0.1 dev.gamenomad.com in C:\WINDOWS\system32\drivers\etc
Then, restarted apached..
I get this message when putting this url:
http://dev.gamenomad.com/
Access forbidden!
You don't have permission to access the requested directory. There is
either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403 dev.gamenomad.com 12/11/2011 8:12:29 PM Apache/2.2.17
(Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4
Perl/v5.10.1
Why do I get that error?
You get this error because directory listing isn't enabled and there's no default document found.
Add the following code to the VirtualHost to show a list of files in the directory
Options +Indexes
Or alternatively create a file called index.html (or any other supported extension which you've installed) and put some content into the file
You may also wish to consider adding the following to the VirtualHost in order to allow access to that directory
<Directory "c:\{path_to_directory}">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Edit in response to the OP's comment
You already have the following VirtualHost configuration.
ServerAdmin webmaster#dummy-host.localhost
DocumentRoot "C:/apache/docs/dev.gamenomad.com/public"
ServerName dev.gamenomad.com
ServerAlias dev.gamenomad.com
ErrorLog "logs/dev.gamenomad.com-error.log"
CustomLog "logs/dev.gamenomad.com-access.log" common
Changing your configuration to add the Options and Allow settings you'll be able to run your website on localhost but it'll fix your error.
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host.localhost
DocumentRoot "C:/apache/docs/dev.gamenomad.com/public"
ServerName dev.gamenomad.com
ServerAlias dev.gamenomad.com
ErrorLog "logs/dev.gamenomad.com-error.log"
CustomLog "logs/dev.gamenomad.com-access.log" common
Options +Indexes
<Directory "c:\{path_to_directory}">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Refer to Apache's Allow and Options directives.