Adding another website on your hosting, Godaddy - web

the company i worked in purchased a web hosting from GoDaddy which is a Linux based hosting using Cpanel. I believe it is unlimited websites. Supposed it is already hosting sample.com which I deployed, it is a laravel 5 website. Then I want to add new website sample2.com which a domain the we already purchased.
On the cpanel there's an option of Addon Domains so I tried it out. I was able to add sample2.com and as expected it's root directory will be shared to sample.com
but when I browse to sample2.com I get Internal Server Error 500 plus in the url it is poiting to sample2.com/sample2.com which I believe it is appending the folder on the url? What could be the problem? Is there other configuration I missed? Both my hosting and domain names came from GoDaddy.
public_html/
sample2.com/
(sample.com files)

Found out my problem. It is my Laravel 5 .htaccess on my public_html folder. I just rename it to something else and my second website works then rename it again to its original then all sites works fine.

Related

Valet not working on kali linux. Redirecting to htdocs

I installed valet on Kali Linux, and pinged a test domain to make sure it's working which it is. However, after running valet park in the folder directory that I have my files. It redirects me to xampp dashboard whenever I access the route on the browser. I know very well to type the folder name followed by a .test domain. I've tried almost everything online. I see this is a popular issues and I've gone through every possible solution I see online. It's still not working, I tried to rename the index.php file in the htdocs folder which gets render automatically whenever you access the htdocs folder, now it only list the folder structure for me as a result. I tried to move the project out of htdocs still not working. I stopped apache and tried accessing it again but unfortunately I got, "This site cant be reached"
No response.. Well fortunately i was able to fix it, not sure it's the best way. But hopefully this might help someone, i configured ssl on the domain with valet using valet secure foo.bar and it automatically redirect to https. That way, i was able to escape from xampp

How to add a sub folder to a domain?

I have a domain xyz.com hosted on a hosting platform. I used file manager of cPanel to add all my website content and the site works perfectly when I access www.xyz.com. Now, I want to host a different version of my website which should work with the address www.xyz.com/version2, where "version2" is a new folder which I would be creating into which I would be ftp ing the files of the new version of the website. Please give some pointers on how can I can achieve this, so that I will have both xyz.com and xyz.com/version2 working as I explained.
Just create new folder with version2 name under public_html directory through file manager and upload your all content through FTP to your newly created directory. Update your site setting in configuration file and check your site.
I managed to solve the issue by creating a subdomain. I referred the below article for help,
http://www.inmotionhosting.com/support/edu/cpanel/cpanel-manage-domains/creating-a-subdomain

How can I move my old sites from shared host server to VPS?

I'm sure a lot of you guys used to be in the same situation as I am at right now.
Before
I used to owned shared hosting for about 2 years.
I kind of get used to it, whenever I create a new site.
I just need to upload my entire new folder including : index.html , styles, scripts, and other assets via FTP into the root directory to my shared host server. Then, I go to the url of that folder, I will see the site loaded, that's how I normally do it.
Now
I upgrade the way I host my site. I just recently purchased a VPS on Digital Ocean, and run Laravel application on it. Now, the site is way faster, and I have more control.
Unfortunately, I'm not sure what to do with all my old sites that I used to have.
How do move them into my new VPS ?
How do I go to them ? How is that work ?
Should I create a public_html folder or something ?
How can I achieve something like this ?
Any direction on this will be much appreciated !
Depending on your setup (single domain, multi-domain). If you're dealing with a single domain environment you'll just move everything over like normal. If you're in a multi-domain environment you'll need to point all your domains to the new server and setup different apache sites (config files) that point to their respective locations on disk.
In my experience with multi-domain environments and Apache 2.4 it's best to have /var/www/ be your center where you can store your .htpasswd or any other files like that, and a folder named public which has your outward facing websites in their subfolders.
Example:
web1.com would exist in /var/www/public/web1.com/...
web2.com would exist in /var/www/public/web2.com/...
You could alternatively have another public folder, but if you're specifically asking about laravel you'd want to point the apache config to the public directory as if you go any higher people have access to your .env file.
If you have everything in your single domain environment (public_html) and you now have a laravel site at your root you could alias a specific path to act as your "old site" data that points to a different folder than your laravel install.

Domains & Subdirectories

I set up a WordPress installation for a friend under a subdirectory on my site. I have set up his domain name to point to the subdirectory of the installation (and I have his domain name registered under my GoDaddy account). I can't figure out how to configure my GoDaddy account or the WordPress installation to use his domain name for all his webpage's addresses.
For example, I want his website to display myfriendssite.com/about.php instead of mysite.com/friendswordpress/about.php
I have tried editing the .htaccess files for both my main sites directory and my friend's directory to no avail (I don't know what I'm doing). Please help!
Assuming you are using Apache, you should configure a virtual host with the myfriendssite.com and point it to the correct directory.
Because you haven't provided any example of the config code, I cannot give you specific example but please read through the apache doc for virtual host and you should find what you need. Here's the link
If you can post some sample of the relevant apache config, or specifics like sample domain and directories, I can help you more with a config example.

How do you do A/B switching in a web app? (for deploying updates)

I currently have a mysite.com (A) which points to /public_html/ and a dev.mysite.com (B) which I created a /dev_html/ for that. I cloned the site but now I need a way of switching between them without having to copy all the files from one dir to another and without bringing the site down. I just want to switch the live site to B and then work on A, and when I finish, switch the live site to A and work on B. Is there a simple way? I'm using cPanel X and cPanel 11 (WHM VPS). Also, both can interact with the same database so that's not an issue as I'm not changing any database structure. Only the php/js/img files need to switch.
Not sure if you have options to map domains, sub domains to folders in CPANEL as Im not a huge cpanel fan. The hosting company that I use allows mapping folders to domains and subdomains that I create so I have two folders too.
One of my folders in v1 and other folder is v2.
I point the live domain to v1 when Im working on enhancements on the version in v2 and point the domain to v2 when I have to do enhancements on v1 (but when switch happens I have to copy the files anyway- the advantage is that the beta website throws errors while Im copying over and not the main website)
vhost file
Edit your vhosts file to point to the other directory.
Currently you will have a container that states that the site files are located at public_html
Change that to dev_html and run the following command to see if it all went ok.
apache configtest
If there are no errors, run
apache restart

Resources