Laravel Sub-subdomain - laravel

I've been trying to get my head around this all day. I understand how to create and manage single level subdomains in laravel, such as subdomain.domain.com
However, I'm trying to add a second level subdomain, for example: subsubdomain.subdomain.domain.com
I can get Homestead working fine with single level subdomains, but whenever I add the extra subdomain, I get a connection refused - unable to connect error in chrome.
There's nothing in the nginx error log either.
This is what I've done:
Open `~/.homestead/Homestead.yaml
Add the domain subsubdomain.subdomain.domain.com in addition to subdomain.domain.com
Save and exit, then run vagrant reload --provision
I can see the new sub-subdomain added to the hosts file, as well as a conf file created in the vagrant box
When I try to access subdomain.domain.com it works fine, when I try to access subsubdomain.subdomain.domain.com it fails with refused to connect.
I have no idea what to try next, there's nothing in the nginx error log, Homestead is up and running because I can access the single level subdomain completely fine. The only one that isn't working is the second level subdomain.
Any info on what I might be doing wrong, or anything else that might be helpful to debug would be greatly appreciated.
Update
I've managed to connect to the server if I add the port :8000 to the address: subsubdomain.subdomain.domain.com doesn't work, but subsubdomain.subdomain.domain.com:8000 works

Related

HTTPS not working for domain, but works for subdomain

I've got a subdomain set up for my nextcloud instance at nc.example.com, and I have set up a new virtual host for my main website that I will look at creating at example.com. I ran certbot on example.com, and initially it worked, then I accidentally ran certbot again, but ctrl C'd out of it, but now HTTPS on example.com does not seem to work, even though when I run certbox certificates, it's listed there.
Initially example.com would work, but now it will only work when I include www., but it's running on a HTTP connection.
My nc.example.com works fine with HTTPS and no www., in my DNS records I've added an A record pointing to 174.129.25.170 to fix the naked domain issue with having to include www., but as I mentioned, it was working briefly and now it's not.
A Record Entry
I feel like I've just messed something simple up cause it was working initially. Any assistance would be appreciated because I'm still learning this stuff. I'm running apache2 on an Ubuntu 22.04 AWS EC2 instance.
Cheers
My apologies, I fixed this literally 3 minutes after posting this.
I ran sudo certbot
and it asked which names I'd like to activate HTTPS for, it listed three domains
example.com
nc.example.com
www.example.com
I selected 3, and it seems to have fixed my problem, but now I have 3 certificates, will this matter?

Getting laravel app pretty url on Nginx (homestead) working

trying to lunch a laravel site on a homestead setup with a pretty url: moziz.app. my host file : 192.168.10.10 moziz.app
all i get back is Your connection is not private with this:
The problem is that you're accessing your local host with HTTPS. This might be caused by Chrome enforcing HTTP Strict Transport Security (HSTS) for all .app domains (Google owns the .app TLD, so they can enforce this).
The easiest solution is to switch your domain to moziz.test (update your hosts file and Homestead.yaml), and then use http:// instead of https://.
After changing the sites property in Homestead.yaml you might also need to run vagrant reload --provision.

Forge/DigitalOcean - This site can’t be reached

This is my first experience with Forge. So I created DigitalOcean account, had Bitbucket from before, made repository. Added .env to environment variables in Forge.
On server IP adress getting
This site can’t be reached
Try:
Reloading the page
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
What am I missing?
Somehow when server was installed it did not install nginx, and all what was necessary. In Forge was listed what was installed and that was clearly missing. So I decided to destroy it and install new server. New one works like it should.

Apache localhost/~username/ Forbidden

I am currently trying to get my apache webserver local host working so I can work on php websites on my own computer. I am running mac OSX 10.11.2.
I have tried every resource from every link I can find containing the same problem. I can access local host but when i try to access localhost/~username I get a 403 Forbidden error! Says I do not have permission. I have uncommented out all of the lines that I am told to do but I can not get it to work.
Any help is much appreciated
I can't figure out how to post my config, but I assure you I have uncommented everything I need to

Homestead/Vagrant refusing Image manipulation

I am running into a problem with Homestead. I have a piece of code that works well on an online dev server, but fails in the vagrant Homestead one.
The piece of code is an ajax executed one, where I upload an image, save it in a temp directory and send it back to the user, who then crops it. For this, I have two functions, tempUpload and tempCrop. It is failing in tempCrop, and most the line that triggers it is the following:
$img = getimagesize($imgUrl);
$imgUrl is an input with the url to an image in a temp folder. Checking in vagrant, I saw that these images have attributes -rwxrwxrwx 1 vagrant vagrant. The error appearing in the console is "SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data".
Again, this works perfect in an online version, so I guess it is either a permission problem or some environment setting. The permissions for the temp folder in vagrant are as following: drwxrwxrwx 1 vagrant vagrant
I have checked in /app/storage/logs, and the error I'm getting is:
'getimagesize(http://nominate.app:8000/temp/2078ec37e959dd733930ad758854ce4cb5f175de.jpg): failed to open stream: Connection refused'
I really don't know what else to look into, specially since it is working fine in another dev environment I have, running centOS.
Any ideas?
Thanks a lot.
The answer would be to put the path rather than the url into getimagesize.
Basically, as far as your virtual machine knows, it's serving on port 80. Vagrant seamlessly forwards this port to the host machine's port 8000. When you call getimagesize, it first tries to resolve the hostname (nominate.app), and, if successful, it tries to initiate a connection to it on port 8000. I'm guessing that nominate.app is configured to resolve to 127.0.0.1 (the VM), which isn't actually listening on port 8000.
It's a bad idea to perform those sorts of operations over HTTP, since it'll slow things down and potentially generate multiple temporary copies of the same image. You can use Laravel's path helpers to help you determine the local path of the image (i.e. getimagesize(public_path() . "/temp/" . $filename)).
Changing my host file to point homestead.app to the Homestead VM's IP of 192.168.10.10 rather than 127.0.0.1 resolved this very same issue. Additionally, I can now navigate to http://homestead.app rather than http://homestead.app:8000.
Thanks to ClarkF for pointing me in the right direction to get this resolved!
As much as we don't enjoy "it works in develop but not in production", it's even more curious when it works in production but not in develop!

Resources