My virtual host in xampp isn't working for laravel - laravel

i've set my virtual hosts in xampp for laravel
httpd-vhosts.conf file:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/shareitbaby.io/public"
ServerName www.shareitbaby.io
ServerAlias shareitbaby.io
<Directory "C:/xampp/htdocs/shareitbaby.io/public">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
and my host file:
127.0.0.1 shareitbaby.io
::1 shareitbaby.io
and when i type shareitbaby.io it's not working

Related

csrf_token error in virtual host in Ubuntu

My laravel project working fine on 127.0.0.1 but when trying to run on a virtual host I am getting a csrf_token mismatch error.
This is my .conf file code
<VirtualHost *:80>
ServerAdmin admin#server.in
ServerName test.local
ServerAlias test.local
<Directory /var/www/html/test/development/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
DocumentRoot /var/www/html/test/development/public/
</VirtualHost>

403 Forbidden apache mac os

Help set up a virtual host. In the file /etc/apache2/httpd.conf I uncommented this line here:
# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf
Next, the file is opened, and in the end ordered a new virtual host:
<VirtualHost *:80>
ServerName localhost
DocumentRoot "/Library/WebServer/Documents/"
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot "/Users/igor/sites/advanced"
ServerName advanced
ErrorLog "/private/var/log/apache2/lab.domain-error_log"
CustomLog "/private/var/log/apache2/lab.domain-access_log" common
<Directory "/Users/igor/sites/advanced/">
Options Indexes MultiViews
AllowOverride All
Allow from all
Require all granted
</Directory>
</VirtualHost>
Then added to the hosts 127.0.0.1 advanced. Restart Apache, but the browser displays a 403 error! What could it be?

Mac Os X. Virtual hosts

I want to install few virtual hosts on my Mac OS 10.9.4, using apache 2.2.6. I already have one virtual host, it's working correct, but when I added 2nd host it redirects me to 1st.
/etc/apache2/users/alex.conf:
<Directory "/Users/alex/Sites/">
Options FollowSymLinks Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
ServerAdmin webmaster#example
DocumentRoot "/Users/alex/Sites/site1.loc"
ServerName site1.loc
ServerAlias site1.loc
<Directory "/Users/alex/Sites/site1.loc">
AllowOverride All
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster#example
DocumentRoot "/Users/alex/Sites/site2.loc"
ServerName site2.loc
ServerAlias site2.loc
<Directory "/Users/alex/Sites/site2.loc">
AllowOverride All
Allow from all
</Directory>
</VirtualHost>
/etc/hotst:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 site1.loc
127.0.0.1 site2.loc
SITE1.loc works correct, but when I go to site2.loc it redirect to site1.loc. How can I fix this?
Thanks. Sorry for my English

MAC OSX: Cannot run multiple local domains

i am trying to add another local domain to my mac osx:
No matter what i do when visiting say 'domainnumber2.dev' it always displays the first host in my list.
If i swop them around in my httpd-vhosts file then i get the domainnumber2.dev site.
How can i run multiple localhost site on my mac.
I have a simple set up as below:
<VirtualHost *:80>
ServerName mydomain.dev
ServerAlias mydomain.dev
DocumentRoot "/Users/UserName/Sites/mydomain/"
</VirtualHost>
<VirtualHost *:80>
ServerName mydomainTwo.dev
ServerAlias mydomainTwo.dev
DocumentRoot "/Users/UserName/Sites/mydomainTwo/"
</VirtualHost>
I have also had the more details set up adding the below for both
<Directory "/Users/UserName/Sites/mydomain/">
DirectoryIndex index.php
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
In my hosts file i have:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 mydomain.dev
127.0.0.1 mydomainTwo.dev
which ever VirtualHost is first is the site that is served up
I stumbled across this same problem...
In your httpd-vhosts.conf file (/private/etc/apache2/extra/httpd-vhosts.conf after showing hidden files) add the following for each domain...
<VirtualHost *:80>
ServerName mysubdomain.dev
CustomLog "/root/to/site/logs/mysubdomain.dev-access_log" combined
ErrorLog "/root/to/site/logs/mysubdomain.dev-error_log"
DocumentRoot "/root/to/site/mysubdomain.co.uk"
<Directory "/root/to/site/mysubdomain.co.uk">
DirectoryIndex index.php
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
</VirtualHost>
Then restart apache. Everything else you have seems to be the same as my setup.
Make sure you have the correct permissions to be able to write the log files etc too.

After adding vhosts definiation xamppfiles/htdocs is invisible on http , but still accessible through https

I have vhost like this:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName local.testing.com
DocumentRoot "/Users/myname/Sites/myapp"
DirectoryIndex index.html
<Directory /Users/myname/Sites/myapp>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order Allow,Deny
Allow From All
</Directory>
</VirtualHost>
hots files
127.0.0.1 localhost
127.0.0.1 local.testing.com
::1 localhost
after enabling this vhost , i am unable to access any of the sites under xampp/htdocs through http. But they are accessible through https
when I access localhost it shows directory listing for :"/Users/myname/Sites"
plz help me sort out this issue ,
thanks in advance
so the issue was that we need a virtual host for localhost e. g like this SOQ
<VirtualHost *:80>
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
ServerAlias localhost
ServerName localhost
</VirtualHost>

Resources