Install Laravel in windows xampp, fix "object not found" error - .htaccess

I have installed xampp in my system including several projects.
Now I want place my new site to another directory not in htdocs.
My new project is based on laravel.
I edited the http-xampp.conf as following.
Alias /newsite "f:/newsite/"
<Directory "f:/newsite">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
Now it works fine.
http://localhost/newsite
But when I access the sub routes, it occurs object not found error. My laravel site has several routes.
http://localhost/newsite/subroute
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
192.168.0.2
Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.5.28
I really headache. Can you help me?
Thanks for your time.

Related

How do I make my git repository HTTP accessible

I have recently been tasked with hosting a git server on Linux. I am very new to the Linux world so it was struggle just to get where I am today. I am at the point where I have created a bare repository and can view it using GitWeb (hosted on Apache).
Since I can browse to it with GitWeb I figured my configuration of the apache server and git were correct, but I still cant clone the repository on a remote machine. Depending on how I have apache configured, I either get a 403 Forbidden error or a 404 error when attempting to clone.
I am not sure if my git repository isn't configured correctly, my apache configuration is bad, or the folder security makes it inaccessible. It could be multiple things.
I have since removed GitWeb so that I could work with the simplest git and apache configurations possible. I am sure there are plenty of different reasons for my issues, so I am more asking for a few common misconfigurations that might be the culprit.
Here are some portions of my apache configuration. My repository is located at /opt/git
<VirtualHost *:80>
ServerName gitserver
DocumentRoot /opt/git
<Directory /opt/git>
Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch
AllowOverride All
order allow,deny
Allow from all
</Directory>
ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
</VirtualHost>
<Directory "/opt/git">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
As I said, I was able to (with a different configuration) browse to my GitWeb page, so apache is definitely running and at some point the VirtualHost was configured correctly, but something is definitely wrong.
Thanks!
Looks like it wasn't an issue with apache, it is an issue with git. I needed to run the command
git update-server-info
I was confused because This Documentation made it seem like the command would run automatically, since I just copied the sample hooks. I guess you have to run the command whenever you create a new repository?

403 Forbidden on PHPMyAdmin in Puppy Linux

I have installed XAMPP in TahrPup. I need this for a class, but being the only one who runs Linux I can't get help from others in class or the instructor.
I'm getting a 403 Forbidden error accessing 127.0.0.1/phpmyadmin/ and localhost/phpmyadmin, or even just trying to access 127.0.0.1 and localhost.
Version: XAMPP for Linux 5.6.3-0
I did check that Apache and MySQL and stuff is started (running xampp start).
I have tried based on other answers editing httpd-xampp.conf under <LocationMatch ... to say
Order deny,allow
Deny from all
Allow from ::1 127.0.0.0/8
Allow from all
And in httpd.conf it says
<Directory "/opt/lampp/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
... this was already the configuration, and most answers said to change it -to- this, which it already was.
I can post config files if needed. I'm just to the point of not knowing where to start anymore.
As stated here:
Why can't I access Xampp's phpmyadmin on localhost? Access is forbidden.
The lines
Order allow,deny
Allow from all
needed to be removed. Okay.

Laravel (on Linux, EC2) routes won't work

I have Laravel finally configured (for the most part) on my linux EC2 instance, but right now I can't get to any routes past my home page. All I get back is that *.net/people is not on the server. Anybody have any tips?
If you are using apache, check if your .htaccess is working. For example add 'deny from all' line at the beginning of file. If not - check your httpd.conf. Find <Directory /> block, if there is AllowOverride None line, change it to AllowOverride All and restart your apache.

PHPMyadmin xampp error

I'm desperately trying to get phpmyadmin access on xampp for linux 1.8.0 for ubuntu 12.04 LTS. I know this is a common problem, but I have tried many threads across the web, and I am still stuck getting it going.
Xampp seems to be running ok, localhost start page good, including link to phpmyadmin in the sidebar. When I follow that link I get a 403 error:
Access forbidden!
New XAMPP security concept:
Access to the requested directory is only available from the local
network.
This setting can be configured in the file "httpd-xampp.conf".
If you think this is a server error, please contact the webmaster.
Error 403
localhost Apache/2.4.2 (Unix) OpenSSL/1.0.1c PHP/5.4.4
I have tried numerous things, including amending httpd-xampp.conf, the relevant bits of which now look like: http://pastebin.com/J4f4tNVs
my /opt/lampp/phpmyadmin/config.inc.php looks like: http://pastebin.com/5PZPXK5s
Following other instructions I changed ownership of /lampp with:
chown -Rv nobody:root ./lampp/*
Please help me!
Thanks,
Matt
I've found a solution here: http://www.apachefriends.org/f/viewtopic.php?f=17&t=50902&p=196185#p196185
Edit /opt/lampp/etc/extra/httpd-xampp.conf and adding Require all granted line at bottom of block <Directory "/opt/lampp/phpmyadmin"> to have the following code:
<Directory "/opt/lampp/phpmyadmin">
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
Require all granted
</Directory>

FilesMatch results in Internal Server Error

I added the code below to my .htaccess file to enable caching files for 3 days. After that my website wasn't available anymore and I got a message displayed that told me it's an Internal Server Error
The code:
# 3 DAYS
<FilesMatch "\.(html|css|js|gif|jpg|jpeg|png|ico|swf)$"> Header set Cache-Control "max-age=259200, proxy-revalidate" </FilesMatch>
The message:
Internal Server Error
The server encountered an internal
error or misconfiguration and was
unable to complete your request.
Please contact the server
administrator, webmaster#exampple.com
and inform them of the time the error
occurred, and anything you might have
done that may have caused the error.
More information about this error may
be available in the server error log.
What is wrong with the FilesMatch or what else could cause the Internal Server Error?
Thanks
I had this issue a while ago, You can solve it by typing
"sudo a2enmod headers" in the command line
this is another solution
http://diogomelo.net/node/24
To enable this module, log in as root, and create a symbolic link from mods-available/headers.load to mods-enabled. After that, reload apache and it's done. To do so, I've used this commands.
su -
cd /etc/apache2/mods-enabled/
ln -s ../mods-available/headers.load headers.load
sh /etc/init.d/apache2 force-reload
After that procedure the issue is solved.
It has to be on multiple lines, not all in a single line. This one works fine for me:
<FilesMatch "\.(html|css|js|gif|jpg|jpeg|png|ico|swf)$">
Header set Cache-Control "max-age=259200, proxy-revalidate"
</FilesMatch>
This is another possible solution, after applying multiple lines do this simple possible solution.
Problem:
You may have copied and pasted the htaccess instructions directly from a sample code on a website or a slide presentation or somewhere else which creates a problem with the text encoding format.
Solution:
Copy the code again but this time paste it on a simple notepad or text editor and then, copy and paste it again into the ataccess file. This will remove any encoding problem.
Another problem you can have which returns error 500 it's you don't have enabled the AllowOverride directive correctly on the Apache conf file.
Example:
<VirtualHost *:80>
ServerName yoursitename
DocumentRoot /var/www/html/site
<Directory /var/www/html/site>
Options -Indexes +FollowSymLinks +MultiViews
Require all granted
AllowOverride None
</Directory>
ErrorLog /var/log/apache2/error_site.log
On that sample there's one AllowOverride none which blocks all .htaccess modifications you can do.
You can remove that AllowOverride None or modify it allowing only the directives do you need. On the example you placed with AllowOverride FileInfo will be ok.
More info about the AllowOverride directive here: https://httpd.apache.org/docs/2.4/es/mod/core.html#allowoverride

Resources