I created a new folder in public/ (in a laravel porject running on apache2) I set the permissions to 777 but apache keep having this error when I try to acceed to the folder with my browser : "You don't have permission to access this resource."
I'm using ubuntu for the OS. Here is my apache configuration file :
<VirtualHost *:80>
ServerAdmin contact#wewatch.fr
DocumentRoot /var/www/html/public/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/public/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
I have a Laravel project that is on a live server and I have made a copy to place in a development server. When I try to login, it says The requested URL /xxxx/login was not found on this server..
I am not quite sure what to do, as I changed my httpd.conf to
<Directory "/var/www">
AllowOverride All
Require all granted
</Directory>
and
<Directory "/var/www/html">
AllowOverride All
Require all granted
</Directory>
but I am still getting the same error after restarting apache. Is there any way to solve this?
I think you didn't config for the virtual host or you config it wrong.
You can find that config file under folder /etc/httpd/conf.d/vhosts/ Below are a sample file config:
$ cat /etc/httpd/conf.d/vhosts/yoursife.conf
<VirtualHost *:80>
ServerName yourdomain.com
ServerAdmin youradmin_server_mail
DocumentRoot /your_src_path/public/
<Directory "/your_src_path/public/" >
Options FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog /your_src_path/public/logs/error_log
CustomLog /your_src_path/public/logs/access_log combined
</VirtualHost>
You can create a new file if you want.
I am experiencing a problem when uploading laravel 8 to the service, it is only recognizing the "/" route and nothing else, then I am receiving the following error "The requested URL was not found on this server."
However if I indicate "domain/index.p/route", then it works normally, I saw several articles indicating that it was on apache2 in the .conf file but I couldn't configure it in case I'm using debian on EC2.
How could I be solving this issue?
.conf file
<VirtualHost *:80>
ServerAdmin webmaster
DocumentRoot /var/www/directory/public
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/directory>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
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.
The issue is my server had to be installed so I am trying to get the websites in www up and running. I have copied in my old contents of www but when I try to restart apache2 I get the following:
root#microsoft:/# service apache2 restart
Syntax error on line 1 of /etc/apache2/sites-enabled/microsoft.com:
Invalid command '../sites-available/microsoft.com', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
etc/apache2/sites-enabled/microsoft.com
inside the file: ../sites-available/microsoft.com
/etc/apache2/sites-available
inside the file:
<VirtualHost *:80>
ServerAdmin admin#microsoft.com
ServerName microsoft.com
ServerAlias www.microsoft.com
DocumentRoot /var/www/microsoft
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/microsoft>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Any help would be amazing!
Try again closing your <VirtualHost *:80> with a </VirtualHost> after </Directory>
<VirtualHost *:80>
ServerAdmin admin#microsoft.com
ServerName microsoft.com
ServerAlias www.microsoft.com
DocumentRoot /var/www/microsoft
<Directory "/var/www/microsoft">
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/microsoft>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Looks like you symlinked it incorrectly and the sites-enabled version of the file is corrupt.
"etc/apache2/sites-enabled/microsoft.com inside the file:
../sites-available/microsoft.com"
You're showing the contents of the sites-available file, but the error message implies the content of the sites-enabled file is not a valid httpd configruation.
Follow the exiting pattern and read the error messages carefully.
Try to delete your microsoft.com file in sites-enabled, rename microsoft.com to microsoft.com.conf in sites-available. Run a2ensite and restart apache2 service.