Make symlink laravel public folder - laravel

i've tried push my laravel 5.1 project to server. I want to make a symlink to public_html folder so i can access it like normal.
ln -sv app/crowd/public public_html
i've tried that one. but the symlink is taking the public folder instead of it's content.
ln -sv ~/app/crowd/public ~/public_html
i've tried that one too but it still fail.
any suggestion how to make it works?

If "the symlink is taking the public folder instead of it's content" means that your browser is giving a 403 or saying you can't access the folder, it may mean that you don't have index.php in your DirectoryIndex directive (if you're using Apache - not sure what the equivalent is on nginx).
When you enter a location in your browser and don't include a filename (www.host.com/page.html), the server looks at a list of default pages and sees if one of those is present. If not, it tries to serve the whole directory. Try browsing to www.host.com/index.php and see what you get. If it loads, you just need to update your config. If not, please explain what you see.

Related

Laravel 4.2 in FTP server throwing Error 500

I've searched everywhere for a solution. Plus, I tried tracking the error using echo("teste");, but can't find exactly what is wrong, since it works on my local host.
From index.php -> bootstrap/autoload.php -> vender/autoload.php:
I could print a msg until before the foreach in getLoader method of ComposerAutoloaderInitxxxxxx class.
I see it can't complete the require in both bootstrap/autoload.php or bootstrap/start.php
my directories levels are:
public_html/
|__laravel/
|__app/
|__bootstrap/
|__vender/
|__index.php
|__artisan
|__robots.txt
I've changed the paths correctly when moved the files from public/ to laravel root, since I can get into the files required (it just can't finish loading).
I get
500 (Internal Server Error)
Ps.: I uploaded the project through Filezilla, and I only have the FTP access.
Please, could someone help me with this?
Ok first you should not upload a Laravel project via FTP, if you only have an FTP access then you need a real hosting provider that has SSH. You should be able to use the composer command on your production server or you will be in big trouble later :)
Also, assuming this is a cPanel host (based on the public_html folder) the proper way would be to git clone the Laravel project under a folder, remove the public_html folder and create a symbolic link like this.
ln -s ~/laravel/public ~/public_html
This way your document root will point to Laravel's public folder.
Here is more information:
https://laracasts.com/discuss/channels/general-discussion/how-to-install-laravel-in-the-root-directory

Install Laravel on dedicated server's subfolder

So I am having an issue with pushing a Laravel app to production on a dedicated server's subfolder.
Server is run on Apache.
Url I want to push my app would be subdomain.domain.com/project
The structure of my dedicated server is
.cpanel
...
-laravel
-app
-vendor
-...
-public_ftp
-public_html
-folder
-contents of laravels public directory
-ssl
I know that in order not to expose my hidden files I am required to install it in a root directory, but this is not an option because I will be having multiple projects running under subdomain.domain.com/project-1, subdomain.domain.com/project-2 and etc... and all will have a separate laravel installation.
I need a hand in order to achieve that, can anyone give me some advice?
Managed to do it myself, the problem was when i was creating a symlink, so instead i just moved contents of my public directory to public_html/project-1/ and changed index.php path to /../../laravel/
The thing was that I have done it originally but I didnt expect that permissions for storage need to be manually set, that solved my issue and laravel works.
ALWAYS CHECK ERROR LOGS :)
You can place your separate folders in your subdomain with no problem.
The important thing is that you need to point the browser to public/ folder under your laravel projects.
You can create a .htaccess file with the command below in root folder of each project and perform a redirect.
Place the following command in your .htaccess file:
RedirectMatch ^/$ /public/

Index page is not coming / showing in laravel framework

I am using Ubuntu 14.04LTS. Here is what i have done till now:
I have installed composer using curl,
move this composer.phar file to usr/local/bin directory
Created project laravel in my root folder i.e. var/www/html
Change the permission of app/storage folder.
Created the file name as laravel.conf like 000-default.conf in etc/apache2/site-avaliable directory.
edit that laravel.conf file from terminal and save that file.
disable 000-default.conf file and enable laravel.conf file.
restarted the apache2 service.
Here is my problem: now i am trying to run it from my localhost but it does not show index.php page of my project laravel.
Any help to sort this, will be highly appreciated.
Laravel builds its own output based on your controllers, generally utilizing view files (blades) as templates. Unless you specifically tell it to in your controller, it will not return a static or dynamic index.php page. If this is your first Laravel project, I recommend reading up on how routing works at http://laravel.com/docs/5.0/routing .

Getting a 'Not Found' error on my website?

I'm trying to upload files to my domain that I'm hosting with Dreamhost. I connected to the server with FileZilla and I'm pretty sure I put the files in the right spot.
Their tutorial says to create a directory with your domain name like this: 'mydomain.com' and put your files in there. I put an index.html, p.css, register.php, login.php, and logout.php file in there. However, when I navigate to mydomain.com in Google Chrome, all I see is this:
Does anybody know what could be causing this?
BTW I didn't actually create a directory called "mydomain.com" I used the domain I own.
UPDATE:
The directories are set up like this:
/
mydomain.com
public_html
register.php
main.css
logout.php
login.php
index.html
Can you make sure you have group read permissions on the file you are attempting to fetch?
You want permission each file has a 755 permission, here is how you would change a file permission in FileZilla.
Also, make sure everything is in the public_html file.
public_html/index.html
public_html/p.css
public_html/register.php
public_html/login.php
public_html/logout.php
Try adding a file named .htaccess to your public_html directory. In this file, put the following line:
DirectoryIndex index.html
Assuming the webserver is Apache (or a work-alike) this tells the server to send index.html whenever someone asks for /.
I finally figured it out. For some reason it wasn't working when the directory was labeled mydomain.com. I changed it to mydomain_com and it fixed it for whatever reason. Thank you to cevaris and Amazed for helping me.

How To Direct Magento installation path in subfolder to main domain name

I have installed Magento 1.7.0.2 to mydomain.com/mag
(mydomain - is the primary registered domain at my hosting account)
(mag - is any subfolder)
As my website in testing mode, if anything goes wrong, i simply have to delete the “mag” folder and also it does not overwrite any files under public_html.
But if i install on directly to root directly public_html, then it may overwrite few files or folders and if i want to revert any time, then i cannot do that manually.
As i don’t even know the exact folder and file default structure under public_html prior to magento installation.
(I did that once by mistake, that happened)
Now at frontend the site URL will be mydomain.com/mag
But i want, if customers type the http://www.mydomain.com, they will be able to see the LIVE website instead of typing http://www.mydomain.com/mag
How do i do that
Also, will this be OK for SEO part.
Do we need to do this in Magento backend.
or
Do we need to do with hosting company by setting sub-domain type
or
By telling Simple scripts the installation to change the installation folder from mydomain.com/mag to www.mydomain.com
Please do suggest how can i do so.
Regards
In System > Config > Web you will find the following settings for your 'base url'. To update this you will have to perform the following 3 steps:
Step 1: Set the default store to the proper base url
Notice that the base url has the subfolder defined.
Step 2: Set your STORE VIEW base url to the root url
Using your dropdown on the left, change the "Current configuration scope" to your store view [NOT DEFAULT]
To change the base url value, uncheck 'use website' and enter your new base url:
Also, double-check in the same screen that your Session file management cookie path is set to the root folder of your site and that the domain is correct:
Step 3 [also used for multiple store management]
Finally, and this is important, you need to copy the index.php file, .htaccess file, and symlink your media,skin and js folders to your root directory, because they're only available to your subfolder Magento base install right now - we need to let your main domain know where to look for Magento!
From secure shell in your Magento installation directory (in your case, mag) as sudoer:
sudo cp index.php ../
sudo cp .htaccess ../
sudo ln -s js ../
sudo ln -s skin ../
sudo ln -s media ../
Your admin will still be available at yoursite.com/mag/admin.
Edit your index.php file in this main webroot (the file you just copied) and update it around line 45:
$mageFilename = 'app/Mage.php';
Change this to :
$mageFilename = 'cart/app/Mage.php';
Where 'mag' is the subfolder. In your case you'd use the folder named 'mag'. Finally, you need to clear the cache for these changes to take effect.
Step 4: Multi-store [optional]
If you have more than one store, they can all be served this way, but you need to edit the index.php file to give it the correct store code. More info about that can be found here:
http://www.magentocommerce.com/knowledge-base/entry/overview-how-multiple-websites-stores-work
i must say that figuring out how to symbolic link was a hassle and i still couldnt figure it out. All the other steps worked fine except i copied my htaccess and my index.php and i just pasted it to my root. So for those who are having trouble, i found a better solution instead of symbolic link for "media, skin and JS" folders. In your magento admin. System>config under general click web. just change your base skin, media and js to the folder you want them to point to...
ex: {{unsecure_base_url}}cart/skin/
worked for me. Hope it works for anyone with the same problem. Ohh and im using magento 1.8.1 Thanks again #philwinkle

Resources