Why do my laravel routes not work

Method 1

Edit your site_name.conf

...
<Directory /var/www/gloops/public>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>
...

Method 2

Hi, i just deployed my laravel project to digital ocean. The mysql database is correctly migrated and seeded (checked in phpmyadmin). I can currently surf to the homepage. But when i start going to other pages like http://-ip-adress-*/test * it gives me a 404 Not found errorpage. After going trough some forums i think it has something to do with my apache configuration and the modrewrite rule. So i will provide all the files i edited to try and fix this :

*.htacess file in public folder : *

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On
    RewriteBase /var/www/gloops/public/
   # change above to your site i.e.,  RewriteBase /whatever/public/

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

*apache2.conf file in /etc/apache2 : *

ServerName localhost

Mutex file:${APACHE_LOCK_DIR} default
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf

<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/gloops/public>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

*000-default.conf in etc/apache2/sites-enabled : *

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/gloops/public
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Access Phpmyadmin remotly

Go to the file C:\xampp\apache\conf\extra\httpd-xampp.conf

It you have this bit of v=code in that file then edit it or if not then add it to that file


# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Require local
Require ip 192.168
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var

 

XAMPP/WAMP Reset ROOT Password

If the problem is just a forgotten password this will allow you to reset it. However if you have mixed incompatible databases with MySQL Server versions there will be other problems later once you have reset the password.

 

Stop the mysql service

wampmanager -> MySQL -> Service -> Stop Service

Edit the my.ini file

wampmanager -> MySQL -> my.ini

Find the [wampmysqld] section in the ini file. Add this line directly after the section [wampmysqld]

skip-grant-tables

Restart the mysql service. wampmanager -> MySQL -> Service -> Start/Resume Service

Open the MySQL console wampmanager -> MySQL -> MySQL Console

Now we are going to reset the password for the root user, of course this could be used to reset any users password. Enter the following 2 commands at the mysql> command prompt, each with a semi colon at the end of a line, and press ENTER after each line to issue the command to mysql.

For MySQL versions prior 5.7.0

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;

For MySQL versions after 5.7.0

UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPass'), 
                      password_expired = 'N' 
WHERE User = 'root';
FLUSH PRIVILEGES;

Note that the update should report that it has updated more than one row, that is because there are actually 3 user accounts with the userid of ‘root’ each with a different domain

i.e. 127.0.0.1, localhost and ::1*

Now enter ‘quit’ at the mysql command promt to exist mysql.

Stop the mysql service wampmanager -> MySQL -> Service -> Stop Service

Edit the my.ini file wampmanager -> MySQL -> my.ini

Find the [wampmysqld] section in the ini file Remove the skip-grant-tables parameter we added earlier.

DO NOT Leave this parameter in the ini file its a HUGH security hole.

Restart the mysql service. wampmanager -> MySQL -> Service -> Start/Resume Service

Automatically Backup MySQL Databases on Windows

The best way to create and automate backups of MySQL databases is to:

1. Use the Windows Task Scheduler to automatically run a backup task every day or week.

2. Have the task run a BATCH file containing the “mysqldump” and “makecab” commands to export and compress the databases.

3. For additional recovery, use MySQL’s Binary Log files to record transactions between backup jobs (to rebuild the database to the last transaction recorded).

This solution will work for everything from Windows 10, down to XP, and Server 2003. No external tools are required.

 

Backup MySQL Databases with Batch File

Create a mysql-backup.bat file to export all the databases (or only select databases), using a DATE-TIME file-name stamp, and compress the SQL file…

@ECHO OFF

set TIMESTAMP=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%

REM Export all databases into file C:\path\backup\databases.[year][month][day].sql
"C:\path-to\mysql\bin\mysqldump.exe" --all-databases --result-file="C:\path-to\backup\databases.%TIMESTAMP%.sql" --user=username --password=password

REM Change working directory to the location of the DB dump file.
C:
CD \path-to\backup\

REM Compress DB dump file into CAB file (use "EXPAND file.cab" to decompress).
MAKECAB "databases.%TIMESTAMP%.sql" "databases.%TIMESTAMP%.sql.cab"

REM Delete uncompressed DB dump file.
DEL /q /f "databases.%TIMESTAMP%.sql"

Make sure to update all the paths used, and the MySQL’s username (root) and password (if no password is used, leave the “--password” switch out).

Why use CAB instead of ZIP?…

MS-CAB files have almost 50% better compression ratios over ZIP (especially for single files), and the MAKECAB/EXPAND commands exist on all Windows versions.

Scheduled MySQL Backup Task

Create a Windows Task to run the above BATCH file every day or every week.

Make sure that:

1. The user has rights to Log on as a batch job.

2. If the drive/path you are exporting to is a mapped drive, to use the UNC path.

3. If the drive/path is a shared folder, the user the task is ran on has the correct permissions.

Use MySQL Binary Log

Verify that my.ini has the Binary Log enabled, set to either a MIXED or ROW mode, and does not expire between backup tasks (make it 2x the frequency of the backup task schedule +1 day).

log-bin=mysql-bin
binlog-format=MIXED
expire_logs_days=15

This way you can restore to the last transaction recorded by replaying the log over the last backup job.