Apache Symfony Vitrual Host - apache

I clone project in /home/ivan/host/name/web and create virtual host. a2ensite and reload and restart server.
<VirtualHost *:80>
ServerName name.local
DocumentRoot /home/ivan/host/name/web
DirectoryIndex app.php
ErrorLog /var/log/apache2/name-error.log
CustomLog /var/log/apache2/name-access.log combined
<Directory "/home/ivan/host/name/web">
AllowOverride All
Allow from All
</Directory>
and hosts
127.0.0.1 name.local
but have
Forbidden
You don't have permission to access / on this server.
I doing chmod 777 -R host/ but still have error
what I'am doing wrong ?
SOLVED
<VirtualHost *:80>
ServerName aog.local
DocumentRoot /home/ivan/host/name/web
DirectoryIndex app.php
ErrorLog /var/log/apache2/name-error.log
CustomLog /var/log/apache2/name-access.log combined
<Directory "/home/ivan/host/name/web">
AllowOverride All
Require all granted
Allow from All
</Directory>

Look like you are using apache 2.4,
add directive Require all granted as shown below:
<Directory /home/ivan/host/name/web>
AllowOverride All
Options +FollowSymlinks
Require all granted
</Directory>

Related

Why isn't my apache httpd server serving content from my VirtualHost

I have an apache httpd server running on a linux server. The server's fqdn is www.example.com, but I have a dns alias of www.example2.com for the same server.
When I access the server using my browser and use http://www.example.com it serves the correct content, but if I use http://www.example2.com, I get the default content from my /var/www/html folder not the content from the /var/www/html2 folder.
A stripped-down copy of my httpd.conf file follows:
ServerName www.example.com:80
DocumentRoot "/var/www/html"
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
CustomLog "logs/access_log" combined
ErrorLog "logs/error_log"
LogLevel warn
<VirtualHost www.example2.com:80>
ServerName www.example2.com:80
DocumentRoot /var/www/html2
CustomLog "logs/access_log2" combined
ErrorLog "logs/error_log2"
<Directory "/var/www/html2">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName www.example2.com
DocumentRoot /var/www/html2
CustomLog "logs/access_log2" combined
ErrorLog "logs/error_log2"
<Directory "/var/www/html2">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
The VirtualHost tag is for IP based filtering, to filter by host\server name use the ServerName directive.

why apache force me to use https?

i have a problem with apache2 on localhost
i have many virtualhost and thats worked fine before, but today i have a problem
when i try open test-bot.app apache force me to https://test-web.app!
this is my vhost file:
<VirtualHost *:80>
ServerAdmin webmaster#localhost
ServerName test-bot.app
ServerAlias test-bot.app
DocumentRoot /var/www/html/test-bot/public
<Directory />
AllowOverride All
</Directory>
<Directory /var/www/html/test-bot/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require all granted
</Directory>
ErrorLog /var/log/apache2/test-bot.app-error.log
LogLevel error
CustomLog /var/log/apache2/test-bot.app-access.log combined
</VirtualHost>
what can i do?

AWS AMI Virtual Host showing

i have tried creating the virtual hosts via this following link
Digital Ocean Virtual Host
However it is using only first vhost settings. i have tried many tutorials but nothing is working.
Finally i have put the vhost settings in httpd.conf file
Listen 8000
<VirtualHost *:80>
ServerName abc.edu
ServerAlias www.abc.edu
DocumentRoot /var/www/html/abc/frontend/dist
<Directory /var/www/html/abc/frontend/dist>
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost *:8000>
ServerName apiabc.edu
ServerAlias www.apiabc.edu
Alias /static /var/www/html/abc/abc/static
<Directory /var/www/html/abc/abc/static>
Require all granted
</Directory>
<Directory /var/www/html/abc/abc/abc>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess abc python-path=/var/www/html/abc/abc python-home=/var/www/html/abc/env
WSGIProcessGroup abc
WSGIScriptAlias / /var/www/html/abc/abc/abc/wsgi.py
</VirtualHost>

you don't have permission to access / on this server. apache 2.4

I'm having the problem
you don't have permission to access / on this server. apache 2.4
while accessing my local web site. I already googled a lot and read a lot of posts here in StackOverflow and everything seems to be correct.
This is my apache version:
Server version: Apache/2.4.27 (Unix)
Attached my httpd.conf file.
Here is my httpd-vhosts.conf:
<VirtualHost *:80>
ServerAdmin webmaster#localhost.smatchme.com
DocumentRoot "/Users/samuelrabini/Project/SmatchMe/smatchme.web"
ServerName localhost.smatchme.com
<Directory /Users/samuelrabini/Project/SmatchMe/smatchme.web>
Require all granted
Options Includes FollowSymLinks
AllowOverride All
</Directory>
DirectoryIndex index.php
ErrorLog "/private/var/log/apache2/localhost.smatchme.com-error_log"
CustomLog "/private/var/log/apache2/localhost.smatchme.com-access_log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster#localhost.piuproduct.com
DocumentRoot "/Library/WebServer/Documents/piuproduct/public"
ServerName localhost.piuproduct.com
<Directory /Library/WebServer/Documents/piuproduct>
Require all granted
Options Includes FollowSymLinks
AllowOverride All
</Directory>
ErrorLog "/private/var/log/apache2/localhost.piuproduct.com-error_log"
CustomLog "/private/var/log/apache2/localhost.piuproduct.com-access_log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster#localhost.b2b.com
DocumentRoot "/Library/WebServer/Documents/b2b.tony"
ServerName localhost.b2b.com
<Directory /Library/WebServer/Documents/b2b.tony>
AllowOverride All
Require all granted
</Directory>
ErrorLog "/private/var/log/apache2/localhost.b2b.com-error_log"
CustomLog "/private/var/log/apache2/localhost.b2b.com-access_log" common
</VirtualHost>
Can anyone help me understand what I'm doing wrong?
I'm trying to access my site via http://localhost.b2b.com/
And I added in the /etc/hosts the entry:
127.0.0.1 localhost.b2b.com
thanks in advance
Samuel

403 Forbidden vhost Ubuntu

Trying to setup my webserver and allow .htaccess in all www directories. When accessing sub.domain.com on my laptop (with host files adjusted), returns a 403 Forbidden. "You don't have permission to access / on this server."
It feels like the .htaccess file is not allowed, and therefore throws the 403. But as per my understanding the settings are correct isn't? Am I overlooking something?
apache2.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
AllowOverride All
</Directory>
domain.com.conf
<VirtualHost *:80>
ServerName domain.com
ServerAlias sub.domain.com
ServerAdmin webmaster#domain.com
DocumentRoot /var/www/domain.com/public_html/support/current
<Directory "/var/www/domain.com/public_html/support/current">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerName domain.com
ServerAlias .domain.com
ServerAdmin webmaster#domain.com
DocumentRoot /var/www/domain.com/public_html/support/current
<Directory "/var/www/domain.com/public_html/support/current">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Either /var/www/domain.com/public_html/support/current doesn't exist, or its rights are not correct for user Apache runs on. Check the User and Group settings in the main Apache config to find out what they are.
You might also want to check the error log to get additional clues.