jericopulvera's avatar

DigitalOcean distributions

I was wondering what is the difference between XAMPP and digitalOcean LAMP stack in ubuntu 14.04 wherever I upload a laravel app in my LAMP stack in digitalOcean it won't work but it works in my XAMPP?

  • what might be the reason?

  • what should I change?

  • and another question if I use VMware and install ubuntu 16.04 and try to program from there will it be the same if I create droplet in digitalOcean then do what I did in VMware unbuntu 16.04 so that I would first create my website using VMware then create a droplet after.

  • or should I just develop using XAMPP then try to make it work in my droplet after?

in cPanel you just upload the file and it will work easily but in digitalOcean it becames tricky. why is that?

0 likes
9 replies
bobbybouwmann's avatar

Well if you want to do something with VMware I suggest you to look at Homestead. Homestead is provided by Laravel and gives you a complete development environment on Ubuntu. Check out the docs: https://laravel.com/docs/5.2/homestead

Now the difference between cPanel and digital ocean is that digital ocean is just a clean VPS. It's just a server. You need to install your own stack, which is suited for your projects. You can find a lot tutorials on how to do this. However if you find this really difficult, Laravel has you covered. Laravel introduced Laravel Forge. This is an admin panel that can work with your digital ocean server. From that panel you can deploy your sites from any git repository. Check out forge: https://forge.laravel.com/

1 like
jericopulvera's avatar

@bobbybouwmann I have tried homestead and it's good but same thing happens when I uploaded it in digitalOcean lamp stack. so I am trying to mimic digitalOcean server in my pc then that's where I'll develop my website so I could easily upload it.

bobbybouwmann's avatar

Have you looked at Laravel Forge? It will automatically configure your digital ocean server for you so it mimics the configuration of Homestead ;)

1 like
mikevrind's avatar

However your advice is well intended @bobbybouwmann , I don't think it helps solve the issue @Eco012390 has with his current environment. He's better of in learning why it isn't working in stead of offering an out-of-the-box solution.

@Eco012390, Bobby has a valid point about the difference between a server running cPanel and a VPS at DO. Have you created your virtual hosts within Apache (and restarted Apache)? If so, does the DocumentRoot points to the correct folder? Maybe you can also find some useful information within the Apache (error) log. After checking the Apache configuration, make sure the correct directories in your Laravel app have the correct permissions so Laravel is able to write files. And I don't want to point out the obious but did you also run a composer install (Happend to me a few weeks ago, took me to long to discover that one)?

1 like
bashy's avatar

What is the "error" or what is "not working"? Blank page? Error message? :/

2 likes
colourmill's avatar

Rule #1 when looking for advice, never say "it doesn't work" and expect to get anywhere. For all we know, your roof is leaking onto your router and it's giving you intermittent connection to Digitalocean's servers just because it has cultivated an aversion to anything water-related, who knows! At the very least, tell us exactly what happens, and ideally the steps you've taken to get there, that eliminates 90% of the possible issues.

If we make the assumption that your server receives your requests made to the domain, and if we assume that either apache or nginx is set up to handle those requests, then you should see some information in the log files of those applications or even the vhost in question, they will tell you what's wrong.

1 like
jekinney's avatar

Laravels index.php and htaccess are set up to work with nginx. A basic LAMP stack uses Apache and no nginx. I will guess to either need to install nginx and configure it or reconfigure Apache. Also by default you need to make sure Apache is pointed the public folder and every folder has proper permissions. Xamp has gui to help set this up and in a local environment permissions and access are a less of a worry.

You also will need to install composer if your pushing from git to your server.

Forge actually sets up droplets for you with all the above services, and more, installed and basic configurations done just like homestead. Matter of fact the exact same. If your not comfortable ssh into a server and installing and configuring the software I to recommend using forge.

It's always nice to know, but no one can be a expert at everything. Trying to master php, Laravel, HTML, CSS, and JavaScript is enough for me to focus on. Adding in Apache, nginx, etc for me is a bit to much, more so when you don't use it even weekly.

1 like
colourmill's avatar

@jekinney Adding in Apache, nginx, etc for me is a bit to much, more so when you don't use it even weekly.

Then again, you're a web-developer, you use a webserver all day every day, you should at the very least know how to install it, start it, add a vhost and configure the very basics, just like you know how to install your operating system and IDE.

These are small things that are not hard at all, but in my opinion absolute necessity. I don't think there's a need to master them, but if you can't get things up and running, outsourcing the whole ordeal and hoping that it never goes wrong is not the best approach in my opinion. I'd advise doing so when you're already comfortable doing it yourself, so that "that thing over there that runs everything" doesn't amount to black magic.

2 likes

Please or to participate in this conversation.