Laravel Deployment and DevOps Flashcards

(25 cards)

1
Q

What is Laravel deployment in DevOps?

A

Laravel deployment in DevOps automates the process of installing, configuring, and updating Laravel applications on a LAMP stack.

Deployment ensures Laravel apps, like WordPress sites, run reliably in production. For example, deploying to Apache with MySQL. Freelancers deploy client apps manually or with scripts, while enterprise architects use automated pipelines for scalability, aligning with your LAMP Deployment and DevOps experience.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you prepare a Laravel app for deployment?

A

Set APP_ENV=production in .env, run php artisan optimize, and ensure dependencies with composer install –no-dev.

Prepares the app, like WordPress’s production wp-config.php settings. Freelancers optimize apps, while enterprise architects automate pre-deployment tasks, per your Laravel Fundamentals deck.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the .env file’s role in Laravel deployment?

A

The .env file configures environment-specific settings, like DB_DATABASE and APP_KEY.

Like WordPress’s wp-config.php, it tailors the app for production. Freelancers secure .env (e.g., chmod 600), while enterprise architects manage environment variables, per your WordPress on LAMP deck.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you deploy Laravel to Apache in LAMP?

A

Copy files to /var/www/html, configure .htaccess, and set DocumentRoot to public/.

Similar to WordPress’s Apache setup. Freelancers configure virtual hosts, while enterprise architects automate deployments, per your Apache Configuration deck.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the .htaccess file’s role in Laravel deployment?

A

The .htaccess file in public/ routes requests to index.php, like RewriteRule ^(.*)$ index.php/$1 [L].

Like WordPress’s permalink .htaccess, it enables clean URLs. Freelancers secure it, while enterprise architects optimize routing, per your LAMP Integration deck.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you run Laravel migrations in production?

A

Use php artisan migrate –force to apply database changes.

Like WordPress’s database upgrades, it updates schemas. Freelancers run migrations, while enterprise architects automate them in CI/CD, per your Eloquent ORM deck.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Git in Laravel deployment?

A

Git is a version control system for managing Laravel code, like git push origin main.

Like WordPress theme/plugin versioning, Git tracks changes. Freelancers use Git for client projects, while enterprise architects integrate with CI/CD, per your LAMP Deployment deck.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you deploy Laravel using Git?

A

Push code to a repository (e.g., GitHub) and pull it on the server with git pull origin main.

Similar to WordPress plugin updates via Git. Freelancers sync code, while enterprise architects automate pulls, per your Git experience.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a CI/CD pipeline for Laravel?

A

A CI/CD pipeline automates testing and deployment, using tools like GitHub Actions or Jenkins.

Like WordPress’s automated updates, it ensures reliable deployments. Freelancers set up pipelines, while enterprise architects scale them, per your DevOps knowledge.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you configure a GitHub Actions workflow for Laravel?

A

Create .github/workflows/deploy.yml with steps for testing (e.g., phpunit) and deploying (e.g., rsync).

Automates Laravel deployment, like WordPress’s CI tools. Freelancers configure workflows, while enterprise architects ensure robustness, per your LAMP Deployment deck.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is rsync in Laravel deployment?

A

rsync synchronizes files to a server, like rsync -av ./ user@server:/var/www/html.

Like WordPress’s file sync for updates, it deploys code. Freelancers use rsync, while enterprise architects automate it, per your Linux basics deck.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you secure Laravel deployment files?

A

Set permissions (chmod 755 public/, chmod 644 .env) and use non-root users for deployment.

Like WordPress’s file permissions, it protects apps. Freelancers secure files, while enterprise architects enforce policies, per your LAMP Security deck.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Docker in Laravel DevOps?

A

Docker containerizes Laravel apps, like docker run -p 80:80 laravel.

Ensures consistent environments, like WordPress’s Docker setups. Freelancers use Docker for testing, while enterprise architects orchestrate containers, per your LAMP Deployment deck.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you create a Docker container for Laravel?

A

Use a Dockerfile or docker-compose.yml, like docker-compose up with Laravel and MySQL services.

Like WordPress’s docker-compose for LAMP. Freelancers deploy locally, while enterprise architects use Kubernetes, per your DevOps experience.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is Laravel Forge?

A

Laravel Forge is a server management tool for deploying Laravel apps to cloud providers.

Like WordPress hosting platforms, it simplifies deployment. Freelancers use Forge for clients, while enterprise architects integrate with cloud infrastructure, per your deployment goals.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you deploy Laravel with Forge?

A

Connect a Git repository, configure a server, and deploy via Forge’s dashboard.

Automates deployment, like WordPress’s managed hosting. Freelancers streamline client setups, while enterprise architects customize deployments, per your LAMP Deployment deck.

17
Q

What is Laravel Vapor?

A

Laravel Vapor is a serverless deployment platform for Laravel on AWS Lambda.

Like WordPress’s serverless plugins, it scales apps. Freelancers use Vapor for modern apps, while enterprise architects leverage serverless for cost-efficiency, per your enterprise aspirations.

18
Q

How do you automate Laravel backups?

A

Use cron for mysqldump or packages like spatie/laravel-backup, like 0 2 * * * php artisan backup:run.

Like WordPress’s backup plugins, it protects data. Freelancers schedule backups, while enterprise architects integrate with cloud storage, per your MySQL and Linux decks.

19
Q

What is server monitoring in Laravel DevOps?

A

Server monitoring tracks Laravel app performance, using tools like Laravel Telescope or Prometheus.

Like WordPress’s performance plugins (e.g., Query Monitor), it ensures uptime. Freelancers monitor servers, while enterprise architects use dashboards, per your LAMP Performance deck.

20
Q

How do you install Laravel Telescope for monitoring?

A

Run composer require laravel/telescope, then php artisan telescope:install and migrate.

Monitors requests, like WordPress’s debug tools. Freelancers debug apps, while enterprise architects analyze metrics, per your debugging deck.

21
Q

What is log rotation in Laravel deployment?

A

Log rotation manages storage/logs/laravel.log, configured in /etc/logrotate.d/laravel.

Prevents log bloat, like WordPress’s log management. Freelancers configure rotation, while enterprise architects automate it, per your LAMP Performance deck.

22
Q

How do you rollback a Laravel deployment?

A

Revert to a previous Git commit with git revert or restore a backup.

Like WordPress’s plugin rollback, it fixes issues. Freelancers rollback manually, while enterprise architects automate rollbacks, per your Git experience.

23
Q

What is blue-green deployment for Laravel?

A

Blue-green deployment switches between two environments to minimize downtime.

Like WordPress’s staging-to-production, it ensures smooth updates. Freelancers test manually, while enterprise architects automate switches, per your LAMP Deployment deck.

24
Q

How do you optimize Laravel deployment performance?

A

Run php artisan optimize, cache routes/views, and use opcache in php.ini.

Like WordPress’s performance tuning, it speeds up apps. Freelancers optimize deployments, while enterprise architects scale performance, per your Laravel Performance deck.

25
What is infrastructure as code (IaC) in Laravel DevOps?
IaC defines infrastructure with tools like Terraform, like resource "aws_instance" "laravel" {}. Like WordPress’s automated hosting, it provisions servers. Freelancers use IaC for consistency, while enterprise architects manage cloud infrastructure, per your enterprise goals.