I'm building a Laravel application on Homestead, which manages the creation of subdomain company accounts. Basic sitemap as follows:
Primary Domain
Home (http://laravel.app)
- About (http://laravel.app/about)
- Contact (http://laravel.app/contact)
- Terms (http://laravel.app/terms)
Subdomains
Company A (http://company-a.laravel.app)
- Dashboard (http://company-a.laravel.app/dashboard)
Ideally, I'd like to have a position where I can create subdomains on the fly, without having to edit /etc/hosts or Homestead.yaml every time a new account is created. I understand this is quite a common question, but I wouldn't be here unless I'd already tried everything I can find.
The closest is got was using dnsmasq, following the steps here: Configure homestead for subdomain routing - however this only results in a 403 permission error on both laravel.app and subdomain.laravel.app
Chances are I'm almost there and it's just a permissions error to resolve. But how???
Has anyone been in this position before? And if so, please share with us how you did it.
I can post more info if required!
Related
I'm new to using Heroku so I'm a bit confused because I initially had my website hosted on GoDaddy, but when I added node to my web app I switched to Heroku.
So what is happening is when I visit my website using www. it goes to the correct, updated site, however, when I try the naked route it takes it to the older version of the website. I figured since it's still showing the older site with the naked route that there was a problem on GoDaddy, therefore, I updated one page on GoDaddy and sure enough, the page is updated via the naked route now.
That leads to my first question. If my website is now on Heroku, does it still need to be hosted on GoDaddy as well? Additionally, if the first question is yes, then how do I set up the naked route to point to the same site as the www. route?
I've already have the host as www with the 'points to' pointing to the Heroku domain name but still getting the problem above. This is why I believe the problem lies with the hosting on GoDaddy.
You don't need to host a copy of your site at Goddady.
In Godaddy, you must have a CNAME www pointing to heroku:
your_application_name.herokuapp.com
or
www.your_application_name.com.herokudns.com.
To use heroku for your naked domain, you can define a redirection for the naked domain to your www:
Go to My domains (https://dcc.godaddy.com/manage/)
Click on Manage connection
Set forwarding option (choose www.your_application_name.com, forward type permanent)
This is what helped me as of 2019. First, get to the list of your domain(s) on GoDaddy's interface. You'll see something like this:
GoDaddy's all domains page
Choose your domain. Once you're on your domain's settings, scroll to the bottom and click on 'Manage DNS'. You should see some records created, if there are any.
ACTUAL CONFIGURATION
FIRST STEP:
Create a CNAME record(there should be an 'add' button somewhere). The record should have the following parameters - Type - CNAME, Host - www, Points to - enter the link heroku created for your app.
creating a CNAME record on GoDaddy's
Sometimes when there are other old CNAME records, it'll throw an error. Erase old CNAME records and try again.
SECOND step:
Go to your terminal and enter the command 'host www.yourdomain.com'. If the CNAME record was successful, you should see the heroku domain you enter earlier. IMPORTANT - You should also see a bunch IP addresses which we will need.
THIRD step:
Create 'A' records for all the IP addresses provided on the 'host www.yourdomain.com' terminal command. They should have the following parameters: Type - A, Host - #, Points to - IP address, choose TTL custom and type 600 seconds.
This should do it
I'm having some major issues deploying a website I have built in Laravel which is a technology I am still learning.
I built the site on a temporary subdomain (new.example.com) on a brand new server. I have now come to deploy it so I removed the subdomain mapping in cPanel and changed the primary domain's document root to point Laravel's /public folder as described here.
This shows what I have done:
new.example.com - /public_html/mainsite/public
www.example.com - /public_html/mainsite/public
Now when I try to access www.example.com I get the error message:
No input file specified.
I saw this question but it doesn't seem to match what I have in my .htaccess file. I appear to have run out of talent to be able to fix this problem on my own and need help.
My questions are:
How can I resolve the error mentioned above?
Is there a better way to deploy Laravel sites to cPanel environments?
Have I created an XY problem for myself and I should be looking at something else to get this to work?
This is for a client so I won't share exact domains but the problem is as follows..
I took over development of a website from a prior developer.
The hosting is Hostgator Business.
The primary domain is primary.com.
There is an addon domain addon.com.
The primary domain document root is /home1/username/public_html.
The addon's document root is /home1/username/addon.com.
www.addon.com had a WordPress installation which the developer had edited instead of using plugins to achieve his goals. The site also needed a complete redesign so I felt it logical to simply wipe the installation and replace it.
So, I deleted all of the WordPress files and uploaded a new copy of WordPress from wordpress.org/latest.tar.gz
Prior to deleting the old installation, the domain loaded files from it's document root perfectly.
After uploading the new installation instead of resolving to addon.com it is instead resolving to primary.com/addon.com
I've never seen this happen before so I'm lost.
There's no errors in any available logs.
All file permissions are correct.. I've triple-checked.
I've tried deleting all files and creating simple index.php and index.html files to see if it would access them ... it doesn't.
This happens in each browser I use on Windows and Linux.
I don't understand it because all I did was swap out the old WP install for a new one.
I went and re-uploaded the old WordPress installation so everything is 100% how it was but it is still going to primary.com/addon.com instead of addon.com.
Has anyone faced this issue before? I usually use Bluehost but even when I've used Hostgator in the past I've never seen this happen.
I double-checked the addon domain settings as well as anything else I could think of and everything appears normal.
I even deleted the addon domain and re-added it with the document root of /home1/username/addon.com and it still goes to primary.com/addon.com in the browser.
I submitted a ticket with Hostgator but they have not replied yet.
I'm sorry if this is long. This is my first time asking for help on here and I wanted to be sure I included everything I could.
Hostgator finally got back to me.
The previous developer had used the one-click WordPress install.
Apparently once someone uses a one-click install the only way it works is if you keep using the one-click install/you cannot do it manually any more.
From all the servers and sites I've setup this makes no sense and is a problem with Hostgator. Support did not really tell me anything other than "you have to use the one click install since the prior developer did". Great service.
Hope this saves someone some hassle.
From this it sounds like you were moving a WordPress site from the primary domain to an add on domain.
Simply moving the files from the primary to the add on domain will not make it work on the add on domain because in the database and throughout the coding of the WordPress site it would all be configured and coded for the primary domain.
It sounds like you would need to update the site home and site url from the primary to the add on domain url.
http://support.hostgator.com/articles/specialized-help/technical/wordpress/wordpress-home-fix
Also I would be suggest using a search and replace type plugin to go through all the internal coding to update the urls and links to the add on domain.
There is more information here as well http://codex.wordpress.org/Moving_WordPress
I've just finished my first laravel project. Now I want to put it online. When I go to one of my domains and put it online with filezilla it works. But that's the wrong domain.
I've a domain with hosting and today I attached another domain here. So if I want to put something on that domain that I just bought today I've to go to:
/Public_html/mydomain.com
But when I put my laravel project in here it doesn't work! Already found a lot of descriptions on google and they are all telling me I've to change the index.php file.
But what should be the path in index.php now>
I am using laravel forge and it's awesome. However i ran into one problem.
I created a server on digital ocean and referred my domains to that ip. Everything good and well so far.
Than i created a site. Used the deployer and yup everything worked like a charm, however now i added a second site to the server. and well yes it added the site. so /home/forge/website2.com. However now when going to my previous site: website1.com it shows me website2.com.. i rebooted the server, reloaded nginx nothing seems to work als in sites_available the paths look good.
Any idea's?
Are site 1 and site 2 on different domains, or are they just different sub domains?
Have you tried comparing the Nginx configuration (you can get to it from the Forge site) between the two websites?
To me it seems that your Nginx configuration is wrong. Lastly, are either of them stored on the "default" site on forge or did you qualify a url and keep "default" empty?
This issue has been resolved by taylor, He updated forge and this isn't a problem anymore.