Default IP Access Behavior0:01
So now that we have a server spun up, what happens if you just visit the IP address of that server, which is the only way to access it right now, it doesn't have a domain. An old Forge, you'd see a default configuration site that gives a lot of details about how that server is configured. And a new forge, that's not the case anymore. You're just gonna get an error that says empty response, which is on purpose.
Creating a New Site0:16
You're just gonna get an error that says empty response, which is on purpose. That's a security concern. So the first thing we need to do in order to make us able to actually visit the server anyway is to create our first site. So let's go to it. We visit our server and we hit new site and we can choose what particular type of site we wanna serve. Here you can see you've got a lot of different PHP tools.
particular type of site we wanna serve. Here you can see you've got a lot of different PHP tools. You've got a couple JavaScript tools. You can do static HTML or other, which is basically the same as static HTML. And each of these are gonna have minor differences in where they're serving their files from and also some default scripts that they're gonna be running in order to power them. Now the majority of the time people use Forge, it is
Selecting Laravel Repository0:47
that they're gonna be running in order to power them. Now the majority of the time people use Forge, it is for Laravel 'cause it's a Laravel focused tool. So we're gonna focus on that for these videos. But just know that you can do all of these, uh, and much more, uh, with Forge. So let's go further Laravel. So I'm gonna choose the repository I wanna push and I can choose which branch. By default, it's gonna go for your main or master,
and I can choose which branch. By default, it's gonna go for your main or master, and you can connect it to a database here if you want. And if you want, you don't have to choose the Forge database. You can also create your own database specifically for this project. By default, it's gonna give you the name of your repository plus some random text, but sometimes you can actually get the name
of your repository plus some random text, but sometimes you can actually get the name of your repository if you want. And this is a subdomain of the on-forge.com domain, which makes it really easy for you to get this up and running in a way you probably won't use as your permanent version, but at least it can get you working really quickly. If you wanna use your custom domain from Jump, you can just do that.
Configuring Domain Options1:36
If you wanna use your custom domain from Jump, you can just do that. Um, and you can even change the settings a little bit there so you can change to say it will or will not include wild cards. So for example, if my custom domain was lyric cast.com, if I hit off, all I'm getting here is layer cast.com. And if I do this, I'm getting everything asterisk star layer cast.com. And then similarly here, is it going
layer cast.com. And then similarly here, is it going to just specifically manage the www for me? If we have the redirect from www, that means that if I type www layer.cast.com, it immediately takes me over tolar cast.com. Or I can say if I type layer cast.com immediately forward me to www.layercast.com, or I can say ignore www entirely. So the default settings are No Wild Card and www should redirect to the route.
So the default settings are No Wild Card and www should redirect to the route. For now though, I'm just gonna use my Forge domain because it's an easy way to get it up and running and I don't have to deal with DNS right now. Uh, and install Composer Dependencies is something you're always gonna wanna run unless you have any specific composer dependencies that can't install without authentication or something else that makes it a special edge case. If you do that, you're just gonna get an error.
or something else that makes it a special edge case. If you do that, you're just gonna get an error. When you first deploy, generate a site Deploy Key basically allows you to say that instead of attaching this Forge Servers SSH key to my entire GitHub account, instead I can get a specific key attached to this specific site and just attach it to that repo. It's a little bit more work, but it's also a little bit more secure
Advanced Deployment Settings2:59
It's a little bit more work, but it's also a little bit more secure if you'd like to do it that way. And finally, we have our advanced settings. So the web directory, you can customize if you need to. I don't know why you would with a Laravel app. PHP version, you can customize if you have different versions of PHP installed. I don't on the server, but it's very easy to do. Uh, website isolation means that instead
I don't on the server, but it's very easy to do. Uh, website isolation means that instead of the Forge user being what this is set under, it's gonna have its own specific user tied specifically to this website. So I can create a new username just for this, and then when ISSH in, I'll have to SSH in as that user. And I'll see only this site, not the rest of the sites running on this server. It's a little bit of extra work,
of the sites running on this server. It's a little bit of extra work, but a little bit of extra privacy. Push to Deploy automatically runs your Deploy script every single time. A new commit is pushed to your primary branch, which isn't main in this case, and zero downtime deployments. We'll have a whole video about later, but basically allows it so that the Deploy process runs.
We'll have a whole video about later, but basically allows it so that the Deploy process runs. And only then does it switch over. So if your NPM install or your composer install or whatever else takes 30 seconds, your site will be live while that's running in a separate directory. And then it'll swap out to the new directory once it's done building. And finally, link directory.
to the new directory once it's done building. And finally, link directory. There's a thing in Laravel where your storage uploads go into a directory that is outside of the public space, but it is SIM linked into the public space. So this allows you to customize the directories if you want. Again, these are the defaults and they're perfectly fine for the vast majority of Laravel apps.
Creating and Deploying Site4:19
and they're perfectly fine for the vast majority of Laravel apps. So we're just gonna stick with it and hit Create Site. Just like when we spun up a server, you can see that we've got this incremental process. It's gonna tell us every single step it's gonna take and watch us, allow us to watch what's going on as it installs. It's gonna configure Engine X for us. It's gonna clone the repository, create the environment,
It's gonna configure Engine X for us. It's gonna clone the repository, create the environment, file and install dependencies if necessary, run our migrations. And also this is gonna set up that zero downtime deployment set up unless we turn it off and by default it won't have any problems. It'll just be up and running. And now we have laracasts tutorial dot on forge.com up and running, serving that version.
Reviewing Settings and SSH4:53
tutorial dot on forge.com up and running, serving that version. And we can actually just go to that laracasts tutorial. Do on-forge.com. And there we go, up and running on our server. So now that it's up and running, let's see a few configuration options we're not gonna cover in later videos. And also see what it looks like when we SSH in. So if we go to settings, we're gonna see some
And also see what it looks like when we SSH in. So if we go to settings, we're gonna see some of those configuration options we saw when we were first setting up the site, like the directory, the framework, the PHP version tags and color like we set up in the server. We can also give a unique avatar to every single site. If you wanna put the deploy status of your site, whether it's deployed or failed to deploy on your GitHub, you can grab a badge here and you can also delete your site from this.
you can grab a badge here and you can also delete your site from this. You can also set up notifications for Failure to Deploy. You can do a hook that will be pinged every single time your site is deployed, just a URL web hook. And you can set up deploy notifications in Slack, discord, and Telegram. And finally, we can go over to SSH, we can SSH into our server. And if we list our directory here, we will see
we can SSH into our server. And if we list our directory here, we will see that Layer Cast tutorial do on-forge.com is now a folder on our server. And if we see the Intuit, we can actually see the contents. And it's not gonna be super familiar if you've never worked with Zero Downtime Deploy before, we can take a look at that in a second. But just know that this is where your actual application is being served from.
But just know that this is where your actual application is being served from. Good to go.
