3

My server is on DigitalOcean cloud. I am using Ubuntu with Apache web server. My home computer is running Windows 7. I am using putty for terminal.

Followed all of the directions on https://laracasts.com/series/laravel-5-fundamentals/episodes/1. Made it up to 8:40, where it directs you to run php -S localhost:8888 -t public. I run that, then open a web browser and tried the following:

-http://mywebsite.com:8888
-http://www.mywebsite.com:8888
-http://mywebsite.com/learning-laravel-5/public
-http://mywebsite.com/learning-laravel-5/public/index.php

None of the above work.

In Google Chrome, the first two options where I list the port number, I get a page saying This webpage is not available. ERR_CONNECTION_REFUSED. In IE, I just get a page with big font saying "This page can't be displayed."

For the last two options, I just get a completely blank page. In the console, I get this error: Failed to load resource: the server responded with a status of 500 (Internal Server Error).

I'm trying to pick up a web app framework to broaden my php skill set. Can someone help me out? What am I doing wrong/what is the video tutorial missing that I have to do in order to get Laravel up and running?

aCarella
  • 2,369
  • 11
  • 52
  • 85
  • The port could well be blocked by your host. If you have hosting you can just upload the website as a normal site and skip that step. – Styphon Jun 01 '15 at 14:46
  • I don't really know what that means, or how to do that @Styphon. I have complete control over my server, so if you point me in the direction of a tutorial that explains how to do what you're suggesting I'll be glad to read up on it. – aCarella Jun 01 '15 at 14:49
  • Without Laravel, did you get the apache standard page ? – w3spi Jun 01 '15 at 14:59
  • This post explains how to check if the port is open on the server - http://stackoverflow.com/questions/9609130/quick-way-to-find-if-a-port-is-open-on-linux. Otherwise you'll need to contact your host and ask them if they can open the port in their firewall. If you're hosting your own server and know nothing about ports I suggest you Google what are server ports and start reading. – Styphon Jun 01 '15 at 15:03
  • @zlen I did not get the apache standard page. – aCarella Jun 01 '15 at 15:18
  • @Styphon. Thanks for the link. DigitalOcean gives me complete control over the server that I have, so me calling them will not help me. I will read up on ports, although I am not sure if your answer comes from experience with Laravel. If you are unsure if this is a port issue, then I'd be hesitant to read up on something potentially unrelated to my problem. – aCarella Jun 01 '15 at 15:24
  • 1
    Have you changed Storage directory permissions to 777? – Alex Kyriakidis Jun 05 '15 at 20:57
  • Storage directory permissions are completely open. – aCarella Jun 05 '15 at 21:17

4 Answers4

2

php -S localhost:8888 -t public is meant for running a site locally, which is what the video is showing.

If you are using a Digital Ocean droplet with Ubuntu and Apache, you will need to configure Apache to use /public as the document root and have Laravel installed in the /var/www directory.

From there you can visit the droplet's IP address (http://XXX.XXX.XXX.XXX) instead of the domain name (unless you have configured the DNS for that domain name). You won't need the port in the URL either, since Apache will be serving it on the default port 80.

KevinD
  • 74
  • 9
1

This probably is not the answer you want, but here's my advice based on setting up a few VPSs on Digital Ocean. Step back. Spin a new VPS. Keep your old one around, if you want, but start afresh.

  1. Create a new droplet
  2. Setup your SSH and PuTTY and make sure that works
  3. Setup your FTP (if you're using it)
  4. Setup your DNS
  5. Setup your Apache config files. DO has a very good tutorial on this: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04
  6. Now, work on getting your "Hello world" html page to show when you access your domain www.yourdomain.com, yourdomian.com. Don't fixate on ports at this point, just get a minimal server running. This might help too: https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts
  7. Make an saved "image" of this basic working setup so you can spin a new VPS if you need to.
  8. Now that you have a server that loads your domain index page, you can start to install your Laravel.

In a nutshell, I'd advise you to establish a stable working server platform before you try to install and launch a more complex technology like Laravel, or Rails, etc.

Tutorials often make complex technologies seem easy, the 10-minute expert, but there is tremendous complexity masked under the hood of these frameworks. Start simple and build on a server one piece at a time. You have to walk before you run.

Elvn
  • 3,021
  • 1
  • 14
  • 27
  • I guess this would just be the same as installing Laravel on my regular server, which I currently don't use. I'll give it a try, although I thought I did this already with no success. – aCarella Jun 05 '15 at 21:18
  • Good luck with it. Post results and let us know how it goes. – Elvn Jun 05 '15 at 23:32
0

I use Laravel often, but my experience with servers is more relevant here. Everything you've said indicates an access problem, and knowing how hosting companies work, they probably have that port blocked (along with all other non-standard ports).

You can test this using PuTTY, open it up and enter the host name of your server. Change the port to 80 and change close on window exit to never, then connect. Enter:

GET / HTTP/1.1
Host: yourwebsite.com

Then press enter twice and the server will process the result. It should show you the HTML of your home page.

Now try it again with port 8888 and see if you can even connect. If you can connect then it's not a port issue, but my guess is you'll get a fatal error Network error: Connection refused, which means the port is closed or blocked via firewall.

Even though DigitalOcean give you complete control over the server, the connection probably still runs through their firewall. It's possible that you have your own firewall, but otherwise if the server runs through their firewall and the port is blocked nothing you can do on the server will open that port.

Styphon
  • 10,304
  • 9
  • 52
  • 86
  • Thanks for the response. I opened up PuTTY. In the "Host Name (or IP address)" field, I tried first entering my website name then the IP address of my website with the Port field being 80, and clicking the "Never" radio button where it says "Close window on exit:". The black PuTTY screen opens up, doesn't let me type anything, and doesn't ask me for login username or password. That's as far as I was able to get. – aCarella Jun 01 '15 at 15:58
  • If I do this while leaving the port at 22, it will ask me for my username and password and I am able to log in. I then type on one line `GET / HTTP/1.1' Host: mywebsite.com`, and it shows me the html on my website's main page. When I try to log into PuTTY with the port number being 8888, it just says "Connection refused." – aCarella Jun 01 '15 at 16:02
  • Port 22 is the default port for SSH, it's how you're connecting in and controlling your server. Port 80 is the default port for HTML, whenever a browser connects to a web server it does it over Port 80. Port 8888 is a non-standard port being used by Laravel for web trafic, but it's blocked on your server. Google opening ports on Linux, specifically the version of Linux installed on your server. If you have cPanel I'd recommend googling the same, but cPanel instead of Linux. – Styphon Jun 01 '15 at 16:05
  • 1
    Rather than trying to get it working using port 8888, you're better off setting it up just to work off `www.mywebsite.com`, or a subdomain if you have a main website. – Styphon Jun 01 '15 at 16:08
  • Yea, I'm perfectly okay with getting this to work the easiest way possible. I don't really care which port it works on; I don't even know how ports really work. In the directions that the video tutorial gave, as well as a lot of directions for Laravel for beginners online, little to nothing was said about ports. I just want to learn how to use Laravel. – aCarella Jun 01 '15 at 16:11
  • I still have no idea how to get it to work on `mywebsite.com`. I've tried going into the `000-default.conf` file on my server to change the document root to `learning-laravel-5/public` with absolutely no luck. Just a blank page. I was under the impression that if all was installed well, there should be a Laravel welcome page. – aCarella Jun 01 '15 at 16:13
  • That command, `php -S localhost:8888 -t public` is designed to be used on your local machine while you're developing the site. It's not supposed to be used on a live web server. Set up a subdomain and point it to the `public` directory in your `learning-laravel-5` folder. Then when you go to `subdomain.mydomain.com` it should just work. If you don't know how to set up a subdomain I strongly recommend you get cPanel. You have to pay a small amount for it, but it will make your experience so much easier. – Styphon Jun 01 '15 at 16:13
-1

did you try chmod -R 0777 storage ?

cybertextron
  • 10,547
  • 28
  • 104
  • 208
benjolly1989
  • 134
  • 2
  • 9