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>
Related
I am trying to upload my laravel project on aws by installing ubuntu. I pretty much already installed everything I have to but after writing .conf inside the sites-available, and reloading the apache2.service. There is an error indicating that the ServerAdmin is misspelled.
domain.conf
<VirtualHost *:80>
SeverAdmin ...#gmail.com
ServerName domain.com
SeverAlias www.domain.com
DocumentRoot /var/www/domain/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/domain>
Require all granted
AllowOverride All
Options Indexes Multiviews FollowSymLinks
</Directory>
</VirtualHost>
Sorry about that everyone! That was a simple spelling mistake
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.
OS: Microsoft Windows 10
backend framework: Laravel
my goal: when I access to "http://example.domain", it can direct to laravel index.php.
httpd-vhosts.conf:
<VirtualHost *:80>
DocumentRoot "C:\Apache24\htdocs\NKUST_foodpanda\public"
DirectoryIndex index.php
ServerName example.domain
ErrorLog "C:\Apache24\logs\error.log"
CustomLog "C:\Apache24\logs\access.log" combined
<Directory "C:\Apache24\htdocs\NKUST_foodpanda\public">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
I save httpd-vhosts.conf and restart my apache, and now, when I access to "http://example.domain", it will direct to "C:\Apache24\htdocs", not "C:\Apache24\htdocs\NKUST_foodpanda\public".
I have tried with same possible scenario as yours with following entry httpd-vhost.conf. Checked it with both '' and '/' and it is working for me. Make sure to provide proper permission to your directories. If this could not work you need to provide more info.
<VirtualHost example.domain:80>
DocumentRoot "C:\Apache24\htdocs\NKUST_foodpanda\public"
DirectoryIndex index.html
ServerName example.domain
ErrorLog "C:\Apache24\logs\error.log"
CustomLog "C:\Apache24\logs\access.log" combined
<Directory "C:\Apache24\htdocs\NKUST_foodpanda\public">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
If you want to set a newer setup in "httpd-vhosts.conf", you have to delete comment out "Include conf/extra/httpd-vhosts.conf" in "httpd.conf".
I have not notice this problem, I comment out "Include conf/extra/httpd-vhosts.conf" and set something in "httpd-vhosts.conf" at the same time, so "httpd-vhosts.conf" doesn't work.
I'm running Ubuntu 20.04 lts with Apache 2. I enabled mod_rewrite, but when my rules are enabled it results in a 404 error.
This is my current (stripped down) .htaccess file and I still get a 404:
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)(|/)$ index.php?page=$1
I've configured my virtualhost like so:
<VirtualHost *:80>
ServerName website
ServerAlias www.website
ServerAdmin webmaster#localhost
DocumentRoot /var/www/website
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/website/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
What have I done wrong? It works on IIS.
Nvm already solved it, somehow the MultiViews option was causing trouble or I made a type error.
replaced
Options Indexes FollowSymLinks MultiViews
with this
Options Indexes FollowSymLinks
And it works now
This is the virtualhost configuration. This is not working. please help me
ServerName example.com
DocumentRoot /var/www/html/blog/public
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html/blog/>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
most common case after deployment is proper permissions. storage and bootstrap should have writeable permissions.
if the problem not about permissions then check the logs of laravel
storage/logs/laravel.log