fideloper

fideloper

Product Engineer at UserScape

Member Since 6 Years Ago

San Antonio

Experience Points
43,905
Total
Experience

1,095 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
25
Lessons
Completed
Best Reply Awards
43
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 9
43,905 XP
Apr
24
1 month ago
Activity icon

Awarded Best Reply on Nginx / Forge / 404

It's likely that you need to update your Site within Forge and set the Web directory to /public.

When editing/viewing a Site within Forge, that option is in the Meta section.

This tells Forge to update Nginx to set the correct root (document root, the public web root directory) for the Laravel code base.

Apr
21
1 month ago
Activity icon

Replied to Nginx / Forge / 404

It's likely that you need to update your Site within Forge and set the Web directory to /public.

When editing/viewing a Site within Forge, that option is in the Meta section.

This tells Forge to update Nginx to set the correct root (document root, the public web root directory) for the Laravel code base.

Feb
26
3 months ago
Activity icon

Awarded Best Reply on How Does One Utilise Multiple Queue/Worker Servers In A Load Balanced Environment?

Is it as simple as setting up the first? So, I install my application on another server, and set up the Queues?

Yes!

You have some options:

  1. If your server resources are under-utilized, you can add more workers to your one server (multiple things running php artisan queue:work ..., or if you're using supervisor, increase the number of processes in the configuration).
  2. If you need more workers but can't run them all on one server because of server resource usage, you can use multiple servers.

Caveats to multiple servers:

  1. All servers need access to the same database instance (and likely same cache if using redis/memcached). This likely means making sure the 2nd server can reach the database on the first server. Forge can help you out there, it has settings for allowing connections to/from each server on certain ports.
  2. On the 2nd server, assuming it's only used for workers and not for accepting web requests, you can disable nginx so it won't accept web requests (or even use the ufw command to disallow HTTP(S) connections on port 80/443).
Jan
15
4 months ago
Activity icon

Replied to Artisan Commands With SSH

The php command is likely actually running “php-cgi” and thus running php as a web request (instead of running “php” the command line client).

There likely is a php-cli command or similar available to use instead:

e.g. php-cli artisan list

Activity icon

Replied to Envoyer Didn't Really Restart Forge Managed Queue Workers

Just as a sanity check - Are your app files actually in the default directory?

Jan
09
4 months ago
Activity icon

Replied to Mail::send Not Working, But Mail() Works

The mail() function is likely using the sendmail option (which is a command/binary on the server your application is hosted on, often something like /usr/sbin/sendmail).

However you're attempting to make a SMTP connection over the network. I can't say if that's to the same mail server or not as I don't know your server setup/hosting provider.

My point is that the 2 aren't really equivalent tests - the mail() option working doesn't mean connecting to a mail server over the network will work (especially if that smtp server is on a different server - altho it sounds like this is all one server?). An equivalent test would be to use MAIL_DRIVER=sendmail in your Laravel config.

That being said, the smtp option may be better for reasons related to ensuring your emails aren't put in people's spam box (which is a great reason to use Mailgun or another provider instead of your local server's mailbox. I can't overstate that - definitely use a mail service if you can).

That being said, try testing out the connection to that smtp service using the telnet command:

telnet mail.[mydomain].com 587

You may get more information that way. Here's a link that provides some info/commands you can try to run to authenticate and send an email over SMTP (this will be the equivalent of what Laravel is trying to do via the email libraries when using the smtp driver): https://www.ndchost.com/wiki/mail/test-smtp-auth-telnet

Activity icon

Replied to How Does One Utilise Multiple Queue/Worker Servers In A Load Balanced Environment?

Is it as simple as setting up the first? So, I install my application on another server, and set up the Queues?

Yes!

You have some options:

  1. If your server resources are under-utilized, you can add more workers to your one server (multiple things running php artisan queue:work ..., or if you're using supervisor, increase the number of processes in the configuration).
  2. If you need more workers but can't run them all on one server because of server resource usage, you can use multiple servers.

Caveats to multiple servers:

  1. All servers need access to the same database instance (and likely same cache if using redis/memcached). This likely means making sure the 2nd server can reach the database on the first server. Forge can help you out there, it has settings for allowing connections to/from each server on certain ports.
  2. On the 2nd server, assuming it's only used for workers and not for accepting web requests, you can disable nginx so it won't accept web requests (or even use the ufw command to disallow HTTP(S) connections on port 80/443).
Jan
07
4 months ago
Activity icon

Awarded Best Reply on Laravel Forge - Server Security

You don't need to do anything extra - forge takes care of:

  1. Setting up firewalls (it uses ufw, which is a wrapper around iptables)
  2. Setting up Fail2ban (configured to block connections for a time period after too many failed ssh attempts)
  3. SSH authentication settings (only allow ssh authentication via ssh keys, instead of passwords)
  4. Enabling auto updates, including security patches

These are the big things to setup. There are other things, but in general these get you 90%+ of the way there. There are only a few other technical things you may want to do (selinux or apparmor, but the effort is often not worth it. Setting up a sever per app instead of using shared app servers is another security measure. You can even setup of 2fa for SSH logins!).

Most other security measures are "human" things like having access policies about who can access what servers, or rotating SSH keys and ensuring people have updated key when they need them. That gets pretty high-effort and is usually not done in situations without having a medium/larger team.

Activity icon

Replied to Laravel Forge - Server Security

You don't need to do anything extra - forge takes care of:

  1. Setting up firewalls (it uses ufw, which is a wrapper around iptables)
  2. Setting up Fail2ban (configured to block connections for a time period after too many failed ssh attempts)
  3. SSH authentication settings (only allow ssh authentication via ssh keys, instead of passwords)
  4. Enabling auto updates, including security patches

These are the big things to setup. There are other things, but in general these get you 90%+ of the way there. There are only a few other technical things you may want to do (selinux or apparmor, but the effort is often not worth it. Setting up a sever per app instead of using shared app servers is another security measure. You can even setup of 2fa for SSH logins!).

Most other security measures are "human" things like having access policies about who can access what servers, or rotating SSH keys and ensuring people have updated key when they need them. That gets pretty high-effort and is usually not done in situations without having a medium/larger team.

Activity icon

Replied to I Don't Understand Why I Need To Mount Docker Volumes For Both Nginx And PHP

What you decide to do here depends on your use case.

For local development, mounting volumes is often required so you can have code on your local machine that the containers can see.

A note about PHP-FPM with Nginx: The most common Nginx configuration to use with php-fpm actually requires that Nginx "sees" the *.php file on the server before it decides to send it to php-fpm instead. If it doesn't find the file, it returns a 404 error. This is why if you have Nginx and PHP-FPM in separate containers, they both often need volume mounts.

I tend to install php-fpm and Nginx in one container for this reason. See Vessel for an example of that.

For production, code is often built into a Docker image (via COPY), and that container can then be deployed wherever based on that new image with that code.

I do that method, and tag each new image with the commit sha (and "retag" the latest image as tag latest - so the same image is tagged twice). This way I have a history of built images at each commit sha.

Hope that makes sense!

Jan
06
4 months ago
Activity icon

Replied to Correct Way To Stream Logs To CloudWatch

I'm looking into this also. You should note that sending logs via monolog to CloudWatch comes with a small time penalty while the code sends logs to CLoudWatch via it's HTTP end point (potentially on every web request, but it depends on how much logging you do).

I'm currently looking into the AWS CloudWatch agent, which is a program that runs on the server and can tail the log files / send them to CloudWatch (in addition to collect other metrics, altho I plan on only using it for collecting logs).

The benefit is that it doesn't add time to a web request (runs outside of PHP), but the drawbacks that I haven't yet determined might be:

  1. Server setup / configuration setup (alleviated if you automate setting up your infrastructure)
  2. I haven't yet determined if I need to adjust the log format for laravel/nginx logs to be parsed by CloudWatch