Laravel Block Https Request - laravel

I'm developing laravel project, let's say www.domain.net
but when i try to enter https://www.domain.net
it's show the directory list with my server info (like Apache)
how to block access to https?

your httpd.conf should look something like this.
<VirtualHost *:443>
ServerAdmin john#email.com
#DirectoryIndex index.php
DocumentRoot "/var/www/html/project"
ServerName www.abc.com
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /path/certificate.crt
SSLCertificateKeyFile /path/certificate.key
SSLCertificateChainFile /path/keychain.crt
ServerAlias abc.in
ErrorLog logs/abc.in-error_log
CustomLog logs/abc.in-access_log common
<Directory "/var/www/html/project">
Options Includes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Related

Laravel .htaccess run another project on url

I have two projects on the same machine, both projects should be configured on a subdomain, currently at a time only a one project works if other one closed/shutdown
NameVirtualHost *
<VirtualHost *>
DocumentRoot /var/www/vhosts/client-portal/public
</VirtualHost>
<VirtualHost *:80>
ServerName subdomain.maindomain.com/
ServerAlias www.subdomain.maindomain.com/
DocumentRoot /var/www/vhosts/client-portal/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/vhosts/client-portal/public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName subdomain.maindomain.com/admin-panel
ServerAlias www.subdomain.maindomain.com/admin-panel
DocumentRoot /var/www/vhosts/admin-panel/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/vhosts/admin-admin/public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
If I turned off client-portal subdomain.maindomain.com/admin-panel works, otherwise if client-portal turns on subdomain.maindomain.com/admin-panel URL handled by client-portal.

MacOS Ampps domain not redirecting to directory

I'm trying to add domain in Ampps. In the admin panel http://localhost/ampps I've added domain: devvape.
I've got directory in /Applications/Ampps/www/devvape/ but when I enter http://devvape It shows me /Applications/Ampps/www/ directory.
Any ideas why?
Heres my virtual host:
<VirtualHost 127.0.0.1:80>
ServerName devvape
ServerAlias devvape
ScriptAlias /cgi-bin/ "/Applications/Ampps/www/devvape/cgi-bin/"
DocumentRoot "/Applications/Ampps/www/devvape"
ErrorLog "/Applications/Ampps/apache/logs/devvape.pl.err"
CustomLog "/Applications/Ampps/apache/logs/devvape.pl.log" combined
<Directory "/Applications/Ampps/www/devvape">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

I have port 8080 but if i don't use in link adres :8080 isn't working

I have port 8080 but if i don't use in link adres :8080 site looks like this enter image description here What am I doing wrong?
hots:
127.0.0.1 danzuz.eu
127.0.0.2 wordpress1.danzuz.eu
127.0.0.3 wordpress2.danzuz.eu
httpd-vhosts.conf:
<VirtualHost 127.0.0.1:8080>
ServerAdmin webmaster#danzuz.eu
DocumentRoot "C:/xampp/htdocs/"
ServerName danzuz.eu
ServerAlias danzuz.eu
ErrorLog "logs/danzuz.eu-error.log"
CustomLog "logs/danzuz.eu-access.log" common
<Directory "C:/xampp/htdocs/www/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.2:8080>
ServerAdmin webmaster#wordpress1.danzuz.eu
DocumentRoot "C:/xampp/htdocs/www/danzuzeu"
ServerName wordpress1.danzuz.eu
ServerAlias wordpress1.danzuz.eu
ErrorLog "logs/wordpress1.danzuz-error.log"
CustomLog "logs/wordpress1.danzuz-access.log" common
<Directory "C:/xampp/htdocs/www/danzuzeu">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.3:8080>
ServerAdmin webmaster#wordpress2.danzuz.eu
DocumentRoot "C:/xampp/htdocs/www/wordpress"
ServerName wordpress2.danzuz.eu
ServerAlias wordpress2.danzuz.eu
ErrorLog "logs/wordpress2.danzuz-error.log"
CustomLog "logs/wordpress2.danzuz-access.log" common
<Directory "C:/xampp/htdocs/www/wordpress">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Thanks for help :( and sorry if i make wrong with my post it is my first time and sorry for my english

WAMP 3.06, is Directory into Virtual Hosts broken?

I am using WAMP 3.06. I have a web site hosted in "c:/wamp64/www/webagenda"
When I try to access the site remotely using "http://cloudappoint.myvnc.com", I get:
Forbidden
You don't have permission to access /webagenda on this server.
Apache/2.4.23 (Win64) PHP/5.6.25 Server at agenda.myvnc.com Port 8000
My virtual host file is:
# Virtual Hosts
<VirtualHost *:8000>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
#if I uncomment the next lines the problem is over
#<Directory "c:/wamp64/www/webagenda">
#Options Indexes FollowSymLinks Includes ExecCGI
#DirectoryIndex index.php
#AllowOverride None
#Require all granted
#</Directory>
<VirtualHost *:8000>
ServerName cloudappoint
ServerAlias cloudappoint.myvnc.com
DocumentRoot c:/wamp64/www/webagenda
ErrorLog "logs/agenda-error.log"
CustomLog "logs/agenda-access.log" common
<Directory "c:/wamp64/www/webagenda/">
Options +Indexes +FollowSymLinks +MultiViews
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
As you can see from my comments, if I I uncomment the next lines the problem is over:
<Directory "c:/wamp64/www/webagenda">
Options Indexes FollowSymLinks Includes ExecCGI
DirectoryIndex index.php
AllowOverride None
Require all granted
</Directory>
What is wrong here, please?
If moving the <Directory> block out of the <VirtualHost> block causes access to be allowed then it is a fair assumption that there is something wrong with the <VirtualHost> definition.
Can I suggest that you try this change in your definition
<VirtualHost *:8000>
ServerName cloudappoint.myvnc.com <--change
ServerAlias www.cloudappoint.myvnc.com <--change
DocumentRoot c:/wamp64/www/webagenda
ErrorLog "logs/agenda-error.log"
CustomLog "logs/agenda-access.log" common
<Directory "c:/wamp64/www/webagenda/">
Options +Indexes +FollowSymLinks +MultiViews
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
EDIT
I assume you are adding the non standard port number to the url when trying to access the site?
http://cloudappoint.myvnc.com:8000
When I add the :8000 I do not get the error I get an offline page saying
The site you have requested is currently unavailable,
please try back again later.

Apache gives me 403 Access Forbidden when DocumentRoot points to two different drives

I am getting an 403 access forbidden when attempting to open a page under a vhost where the document root is sitting on a different drive than where apache is sitting. I installed using the apachefriends release. This is my httpd-vhosts.conf file:
NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1>
ServerName foo.localhost
DocumentRoot "C:/xampp/htdocs/foo/public"
</VirtualHost>
<VirtualHost 127.0.0.1>
ServerName bar.localhost
DocumentRoot "F:/bar/public"
</VirtualHost>
When opening bar.localhost in my browser, Apache is giving me 403 Access Forbidden. I tried setting lots of different access rights, even full rights to everyone, but nothing I tried helped.
Edit: Thanks! For future reference, add 'Options indexes' within to show directory indexes.
You did not need
Options Indexes FollowSymLinks MultiViews Includes ExecCGI
AllowOverride All
Order Allow,Deny
Allow from all
Require all granted
the only thing what you need is...
Require all granted
...inside the directory section.
See Apache 2.4 upgrading side:
http://httpd.apache.org/docs/2.4/upgrading.html
Somewhere, you need to tell Apache that people are allowed to see contents of this directory.
<Directory "F:/bar/public">
Order Allow,Deny
Allow from All
# Any other directory-specific stuff
</Directory>
More info
For Apache 2.4.2: I was getting 403: Forbidden continuously when I was trying to access WAMP on my Windows 7 desktop from my iPhone on WiFi. On one blog, I found the solution - add Require all granted after Allow all in the <Directory> section. So this is how my <Directory> section looks like inside <VirtualHost>
<Directory "C:/wamp/www">
Options Indexes FollowSymLinks MultiViews Includes ExecCGI
AllowOverride All
Order Allow,Deny
Allow from all
Require all granted
</Directory>
I have fixed it with removing below code from
C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf file
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
And added
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot "c:/wamp/www"
ServerName localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
</VirtualHost>
And it has worked like charm
Solved 403: Forbidden when visiting localhost. Using ports 80,443,3308 (the later to handle conflict with MySQL Server installation)
Windows 10, XAMPP 7.4.1, Apache 2.4.x My web files are in a separate folder.
httpd.conf - look for these lines and set it up where you have your files, mine is web folder.
DocumentRoot "C:/web"
<Directory "C:/web">
Changed these 2 lines.
<VirtualHost *:80>
ServerAdmin webmaster#localhost.com
DocumentRoot "C:/web/project1"
ServerName project1.localhost
<Directory "C:/web/project1">
Order allow,deny
allow from all
</Directory>
</VirtualHost>
to this
<VirtualHost *:80>
ServerAdmin webmaster#localhost.com
DocumentRoot "C:/web/project1"
ServerName project1.localhost
<Directory "C:/web/project1">
Require all granted
</Directory>
</VirtualHost>
Add your details in your hosts file
C:\Windows\System32\drivers\etc\hosts file
127.0.0.1 localhost
127.0.0.1 project1.localhost
Stop start XAMPP, and click Apache admin (or localhost) and the wonderful XAMPP dashboard now displays! And visit your project at project1.localhost

Resources