Cant get Xampp to follow symlinks - php

Im running Xampp on a windows 7 machine. I want to follow symlinks, but cant get it to work.
Anyone offer any help.
httpd-vhosts.conf file:
<VirtualHost *:80>
DocumentRoot E:\xampp\htdocs\xampp
ServerName localhost
<Directory E:\xampp\htdocs\xampp>
Options Indexes FollowSymLinks MultiViews ExecCGI
Require all granted
</Directory>
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" combined
<VirtualHost *:80>
DocumentRoot E:\PHPDev
ServerName mypc.localhost
<Directory E:\PHPDev>
Options Indexes FollowSymLinks MultiViews ExecCGI
Require all granted
</Directory>
ErrorLog "logs/mypc.localhost-error.log"
CustomLog "logs/mypc.localhost-access.log" combined

I found the answer out.
Kind of feel stupid, it was because I was pasting a shortcut and assumed that it was the same. I needed to use the windows "mklink" command.
Didnt know they were different.

Create an .htaccess in your Document Root
Copy and Paste,
Options +FollowSymLinks
Options +Indexes
I have a feeling that your configuration in the Virtualhost is been overwritten by a other configuration file. Try to create the .htaccess file

Related

Laravel 8 404 api routes in production

I have never had this issue before, it was working perfectly and after I reinstalled the server I now got a 404 when I call my 0.0.0.0/api/students/show.
I did composer production call on SSH to create latest autoloader. Cleared the cache for php artisan, the normal steps to setup a Laravel production app. But I still get 404 when I call the API endpoint.
Maybe the problems is something with chmod rights? Storage, etc. is already done...
In your apache2.conf make sure you've AllowOverride All and not AllowOverride none.
Example
<Directory /var/www/html/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Original Answer
You should not need to write Directory at all.
This is my working page custom .conf file on sites-available folder:
<VirtualHost *:80>
ServerName matiaslauriti.dev
ServerAlias www.matiaslauriti.dev
Redirect 301 / https://matiaslauriti.dev
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName matiaslauriti.dev
ServerAlias www.matiaslauriti.dev
DocumentRoot /var/www/html/public
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/matiaslauriti.dev/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/matiaslauriti.dev/privkey.pem
</VirtualHost>
</IfModule>
What I do have on my apache2.conf is default, I did not change anything:
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options +FollowSymLinks -Indexes
AllowOverride All
Require all granted
</Directory>

Windows XAMPP issue: The site ahead contains malware

I am just setting up virtualhost in xampp on windows. I edit the file D:\xampp\apache\conf\extra\httpd-vhosts.conf and add this
<VirtualHost *:80>
ServerAdmin webmaster#localhost.myproject.com
DocumentRoot "D:\virtualdomain\MyProject"
SetEnv APPLICATION_ENV development
<Directory "D:\virtualdomain\MyProject">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
ServerName localhost.myproject.com
ErrorLog "localhost.myproject.com"
CustomLog "localhost.myproject.com" common
</VirtualHost>
Then i edit the file C:\Windows\System32\drivers\etc\hosts and add this
127.0.0.1 localhost.myproject.com
Inside the directory D:\virtualdomain\MyProject i created one file index.php. But when i am trying to access the http://localhost.myproject.com/index.php, It will give me this error page

Unable to access my virtual host from the same network using IP address

I'm trying to run two different sources in xampp (one for admin one for users).
I have found one solution by using httpd-vhosts.conf.
In C:\xampp\apache\conf\extra\httpd-vhosts.conf file I have added below config.
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\project\user\www"
ServerName 192.169.9.99
<Directory "C:\xampp\htdocs\project\user\www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\project\admin\www"
ServerName 192.169.9.99.co
<Directory "C:\xampp\htdocs\project\admin\www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Now, I can able to see user and admin pages running in 192.169.9.99 and 192.169.9.99.co
But, here my problem is, I tried with another system that present in my same network.
It has given proper result for 192.169.9.99 but not for 192.169.9.99.co
192.169.9.99.co redirecting to 99.co website.
Where I did wrong, Is I missed anything?
There are any other solutions for achieving this requirement?
Is this possible to achieve this?Thanks.
#Start
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\project\admin\www"
ServerName 192.169.9.99.co
<Directory "C:\xampp\htdocs\auction\frontend\www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
#next
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\project\user\www"
ServerName 192.169.9.99
<Directory "C:\xampp\htdocs\auction\frontend\www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
192.169.9.99 Will be found earlier because the match.
VirtualHost *:80
192.169.9.99
192.169.9.99.co
I have added "Listen 8081" in httpd.conf, so that now my xammp will listen 80 and 8081 ports.
In httpd-vhosts.conf I have added
<VirtualHost *:8081>
DocumentRoot "C:\xampp\htdocs\project\admin\www"
</VirtualHost>
Document root for port 80 will taken from httpd.conf file.
Now I tried with another system that in my network, on 192.169.9.99 My user site is running.
In 192.169.9.99:8081 My admin site is running.

Subdomain, virtual host XAMPP

Looking for some help with setting up a subdomain in XAMPP.
I've read a few articles, whilst they seem to be all related to local installs, what I have is a PORTABLE version of XAMPP so there is no drive prefix.
I tried some of the mentioned articles below but none seem to work. They all display a server not responding or end up going to google to search.
I have in httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Then in extra/httpd-vhosts.conf
NameVirtualHost *:80
<VirtualHost *>
ServerAdmin admin#localhost.com
ServerName localhost
ServerAlias localhost
DocumentRoot "/xampp/htdocs/public"
<Directory "/xampp/htdocs/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost forums*>
ServerAdmin admin#localhost.com
ServerName forums
ServerAlias forums
DocumentRoot "/xampp/htdocs/public/forums"
<Directory "/xampp/htdocs/public/forums">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
When I do this "forums.localhost" is turns into this in chrome "http://www.forums.localhost/" and then I get:
The webpage is not available
Amongst many I have read, some mention editing windows hosts file, but given this is a PORTABLE version of XAMPP I can't always go editing the hosts file in every computer.
these were few I tried but they all fail
http://austin.passy.co/2012/setting-up-virtual-hosts-wordpress-multisite-with-xampp-on-windows-7/
https://community.apachefriends.org/f/viewtopic.php?p=198815&sid=7a72729a95ed298148f8635dd414295a
how to create subdomains in apache(xampp) server?
Can someone please help me how to get subdomain to work on a PORTABLE version or how I should be doing it, or is editing windows hosts file compulsory?
not tested but try this:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin admin#localhost.com
ServerName localhost
ServerAlias localhost
DocumentRoot /xampp/htdocs/public
<Directory "/xampp/htdocs/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin#localhost.com
ServerName forums
ServerAlias forums
DocumentRoot /xampp/htdocs/public/forums
<Directory "/xampp/htdocs/public/forums">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Don't forget to write
127.0.0.1 forums
to your hosts file, if you don't have a DNS-Server.
You need to add forums.localhost to your hosts file.
Edit %SystemRoot%\System32\drivers\etc\hosts and add 127.0.0.1 forums.localhost.
I don't think there is another way to do this, sorry (maybe creating a script that automatically edits the hosts file, but it's quite dirty).

Apache Gives me 403 Error when trying to access "/" on server

When I try to change the web root path to any other folder it give me a 403 error (Forbidden), The default path is /Library/WebServer/Documents, but since this rather annoying for me, I changed it too /Users/Xero/WebServer
Permissions I got the permissions from /Library/WebServer/Documents by right clicking and selecting Get info (http://i.imgur.com/f21D7z0.png What it looks like)
So I changed it to be the exact same for /Users/Xero/WebServer. But it give me a 403 error still.
Attempt to fix
So, I looked it up on Google, and I tried these solutions to fix my problem:
http://www.cyberciti.biz/faq/apache-403-forbidden-error-and-solution/
Error message "Forbidden You don't have permission to access / on this server" (Stack Overflow)
But they didn't help.
Other Notes
Remember I'm using the preinstalled Apache on OS X Snow leopard. And, my virtual host isn't local, so it's not part or the hosts file issue (It's hosted off my DNS, and my IP as a backup, neither work)
My Virtual Hosts:
<VirtualHost *:80> ( Edited 2 )
DocumentRoot "/Users/Xero/WebServer"
</VirtualHost>
<VirtualHost *:80>
Options Indexes FollowSymLinks Includes ExecCGI
DocumentRoot "/Users/Xero/WebServer"
ServerName wrks.tk
ErrorLog "/Logs/Workarea/wrks-err"
CustomLog "/Logs/Workarea/wrks-acc" common
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
<Directory "/Users/Xero/WebServer">
Options +Indexes FollowSymLinks +ExecCGI
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/Xero/WebServer"
ServerName 209.169.203.53
ErrorLog "/Logs/Workarea/ip"
CustomLog "/Logs/Workarea/ip-acc" common
<Directory "/Users/Xero/WebServer">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Also, I have my httpd.conf User and Group setup like this:
User _www
Group _www
Responses to Answers
Edits
So, I fixed the path's to the document's, but it still giving me the same error, 403.
I checked my FireWall settings and it's off. I also checked my `Sharing Preferences`, `File Sharing` and `Web Sharing` are on.
I edited the duplicate of `DirectoryIndex Home.php Home.html` in the `wrks.tk` VirtualHost, but still, I'm getting the same error. (See Other Notes)
Added more too Other Notes.
Fixed directory, but still didn't fix problem.
Added another to Answer Responses.
Tried a computer restart, did not work.
I put a `index.html` in the folder, still got the same 403 error, I tried accessing `/index.html`, still, 403.
What file exactly are you getting all of this from?
<VirtualHost *:80> ( Edited 2 )
DocumentRoot "/Users/Xero/WebServer"
</VirtualHost>
<VirtualHost *:80>
Options Indexes FollowSymLinks Includes ExecCGI
DocumentRoot "/Users/Xero/WebServer"
ServerName wrks.tk
ErrorLog "/Logs/Workarea/wrks-err"
CustomLog "/Logs/Workarea/wrks-acc" common
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
<Directory "/Users/Xero/WebServer">
Options +Indexes FollowSymLinks +ExecCGI
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/Xero/WebServer"
ServerName 209.169.203.53
ErrorLog "/Logs/Workarea/ip"
CustomLog "/Logs/Workarea/ip-acc" common
<Directory "/Users/Xero/WebServer">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
There are more than one file for those settings. If you have apache, then take a look in the sites-enabled and sites-available folders.
Change the bottom part of your httpd.conf file to:
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
Make a new file index.html and put the following in it:
<!DOCTYPE html>
<html>
<body>
<h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
</body>
</html>
Then place the index.html file into the empty directory.
create a file in /etc/apache2/users/ called yourusername.conf (yourusername being the account short name, e.g. hulu – it's usually the name of your home folder in /Users) with the following contents:
<Directory "/Users/yourusername/Sites/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Categories