XAMPP Symbolic link Access Forbidden - xampp

For a xampp server I have created a symbolic link.
Now when running the server I get an error:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.7 (Unix) OpenSSL/1.0.1e PHP/5.5.6 mod_perl/2.0.8-dev Perl/v5.16.3
In the project directory I currently only have an index.html file containing:
<!DOCTYPE html>
<html>
<body>
<p>test</p>
</body>
</html>
I have checked all the permissions on both the project directory and the directory the symbolic link is located in.
These are all set to 777.
What could I do to get this to work?

What you have to do is create virtual host in apache configuration.
I would recommend using pure apache without xampp on most unix based systems, but with xampp it's still possible.
Find your apache config directory and head to extra folder, it should be organised with something like: \xampp\apache\conf\extra\
Add listener and virtual host on the bottom of the file like that
ServerName localhost
Listen 8080
<VirtualHost *:8080>
DocumentRoot "diretory/with/index/"
<Directory "directory/with/all/files">
Require all granted
AllowOverride All
</Directory>
</VirtualHost>
The main difference between DocumentRoot and Directory is that DocumentRoot must point directly to the place where you index.php is located.
Directory is just poinitng to the all resources places.
For example you can have stuff/public folder in which are located all things that user can access, but also you have some frameworks like laravel which is upper in directory and still needs to be maintained by php interpreter, but shouldn't be accessible directly to the end user

Related

Pointing apache DocumentRoot to Laravel gives 403 Forbidden error

I wanted to host my laravel project on google CentOS 7 server. Following the instructions I have install the laravel project and have changed /etc/httpd/conf/httpd.conf files changing DocumentRoot to /var/www/html/laravel/public and <Directory /var/www/html/laravel. Now when I open my website Forbidden You don't have permission to access / on this server.. However, when I proceed to mysite.com/laravel/public my website loads perfectly, meaning that I'm in www folder even if I have changed the DocumentRoot. httpd -S points to my laravel public folder - Main DocumentRoot: "/var/www/html/unionbox.pro/public". When I change DocumentRoots back to /var/www/html my website just list files and folder in the www directory when I open my website. I would appreciate your help! (have been trying to resolve it for 2 days)

Laravel 5.5 CRUD on Chrome

I am currently trying to run the program after I have successfully created all the necessary CRUD files. Note that I am following this tutorial here.
However, I am facing problem in trying to run the sites from my cmd. I tried taskmanager.dev but Chrome returned 'This site can’t be reached'.
May I know, is the any specific ways for me to run the site on xampp?
I am using Windows.
Please help. Thank You.
I am quite sure the guy who made the tutorial is using valet.
Just use php artisan serve and you will be able to connect to your site on localhost.
But if you really want to use taskmanager.dev do the following:
Open the hosts file, which is lotcated # C:\Windows\System32\drivers\etc\hosts
Add 127.0.0.1 taskmanager.dev at the bottom
Make sure you follow their installation tutorial closely. It sounds like you may not have configured the server correctly.
For me, I have to edit my VHosts file which is in:
C:\xampp\apache\conf\extra
And to edit my hosts file I need to go to:
C:\Windows\System32\drivers\etc
If all else fails you can always just run php artisan serve in bash to launch your app.
But I would recommend going through these instructions again:
XAMPP Virtual Host
We need to configure XAMPP Virtual Host to set the document root to correct directory of laravel project and to also assign a name to the project by which we will be accessing it in browser.
Navigate and open file /Applications/XAMPP/etc/httpd.conf file and uncomment the line that includes the virtual host file.
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
Navigate and open file /Applications/XAMPP/etc/extra/httpd-vhosts.conf and include following Virtual host entry in this file.
# VirtualHost for TASKMANAGER.DEV
<VirtualHost taskmanager.dev:80>
DocumentRoot "C:\xampp\htdocs\taskmanager\public"
ServerAdmin taskmanager.dev
<Directory "C:\xampp\htdocs\taskmanager">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
With this entry our apache is listening to taskmanager.dev, but we also have to edit our hosts file to include an entry for the new domain.
Edit file /etc/hosts and add following entry to that file.
127.0.0.1 taskmanager.dev
Restart your apache and access taskmanager.dev on your browser you should be able to see this screen.
Chrome 63 now enforces .dev domains via HTTPS. Follow this article : https://laravel-news.com/chrome-63-now-forces-dev-domains-https to know more.
I've changed to .test for my valet domains. Hope this helps. Thank you.

Deploying Laravel 5 to Server Issues

So I have been following a tutorial on how to do this.
I zipped everything but my public folder.
uploaded and then unzipped files in the folder before the /www folder.
Uploaded the .env file separately since no hidden file got uploaded.
put public folder into my subdomain folder. I editted the index.php appropriately to go to the right directory.
Now I am getting a blank page on the site. Into my SSH I see the files including artisan but when I do php artisan nothing happens. Even when I do php artisan tinker nothing happens.
I'm not sure what is going on... What is wrong?
Laravel public folder serves the content of your website. the entire framework and vendor directory are behind this path. so public users cannot access all those folders its primary security for the framework.
It means on server you don't upload the entire framework to public_html folder and don't point the domain to public folder of laravel without setting proper symlink.
This point can be done with symlink creation in servers. for example you can edit the host file in Linux/Windows and set the project domain. something like homestead.app. Then in your apache configuration simply set this project domain to its physical path. like below.
<VirtualHost *:80>
ServerName homestead.app
DocumentRoot /home/User/Development/homestead/public
<Directory />
Require all granted
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
</Directory>
</VirtualHost>
So you can access the project in browser like homestead.app for more details check this link.
Hope its clear now.
I recommend putting all of your code together then creating a sym link to your public folder in your subdomain folder.

Domain points to wrong directory in XAMPP

I just set up my XAMPP server after reinstalling Windows due to a hard drive failure. When I backed up my server files, I just copied EVERYTHING, all files and folders, from the htdocs folder. After I installed XAMPP and got the security stuff worked out, I went to copy the backed up htdocs files back to the new htdocs folder. Now, whenever I type in my domain name, the one that should point to the htdocs folder, because that is the default DocumentRoot, it instead gives me an error page saying "Access Forbidden", and the URL I see in my URL bar is "soandso.com/xampp", rather than just "soandso.com"
Why is it sending me to the htdocs/xampp folder?
I think it is because of a wrong configuration. Check out
XAMPP-FOLDER/apache/conf/extra/httpd-vhosts.conf
and make sure you sure you have
<VirtualHost yourdomain.com>
ServerAdmin admin#yourdomain.com
DocumentRoot "XAMPP-FOLDER/htdocs/domain-root-folder"
ServerName yourdomain.com
ServerAlias yourdomain.com
<Directory "XAMPP-FOLDER/htdocs/domain-root-folder">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
written there.

Error getting images to show up in Symfony 1.4.8

Note: It was tough deciding whether this belonged here or ServerFault, but it seemed like a programming problem, so if it's out of place, feel free to migrate it.
I downloaded the sandbox of Symfony 1.4.8 and copied the files to my webserver. Unfortunately, when I try to access /symfony/sf_sandbox/web/ (where I installed it), I get the following:
It seems like the images aren't showing. According to the text:
If you see no image in this page, you may need to configure your web server so that it gains access to the symfony_data/web/sf/ directory.
However, when I try to locate the folder referenced above, it does not exist:
sf_sandbox
web
css/
images/
js/
uploads/
frontend_dev.php
index.php
robots.txt
As you can see, there is no sf/ directory under web/. What am I doing wrong?
Note: I am installing this on Ubuntu 10.04 64-bit using Apache.
All the images are located in the Symfony source directory.
I would try creating a symbolic link in the web folder called sf pointed to the following:
lib\vendor\symfony\data\web\sf
It should have access to the needed images at that point.
This is done by indicating the right path in the Alias directive in your apache configuration:
# Be sure to only have this line once in your configuration
NameVirtualHost 127.0.0.1:8080
# This is the configuration for your project
Listen 127.0.0.1:8080
<VirtualHost 127.0.0.1:8080>
DocumentRoot "/home/sfprojects/jobeet/web"
DirectoryIndex index.php
<Directory "/home/sfprojects/jobeet/web">
AllowOverride All
Allow from All
</Directory>
Alias /sf /home/sfprojects/jobeet/lib/vendor/symfony/data/web/sf
<Directory "/home/sfprojects/jobeet/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
Just replace "/home/sfprojects/jobeet" with your project's path and it should work.
This page shows the apache config to set up a new project correctly.
There are also important security notes for your webapp.
Symfony Documentation
All you need to do is copy the whole sf folder to the web folder. In my case i copied c:\wamp\www\jobeet\lib\vendor\symfony\data\web\sf\ to c:\wamp\www\jobeet\web. Hope that makes sense

Resources