installing umbraco on a subdomain that is a subfolder of the root - iis-7.5

I have a similar problem as here Umbraco (4.7) in a subfolder or virtual directory? but not exactly.
I have an umbraco installation running as a subdomain (newmain.mydomain.com). The way we are doing subdomains on my server is to create an application under the main site then let the web.config at the root take care of the url rewriting. This is working fine for all my other subdomains, but umbraco doesn't seem to like it at all. Can someone point me in the right direction in the umbraco web.config (or elsewhere) to help me make this work? Perhaps I need better rewriting on the web.config at the root, but I'm unsure what changes to make.
I'm reluctant to create another root level website for various reasons.

I ended up moving this to a more standard style subdomain. I think it's disappointing that it must be configured this way.

Related

Cpanel is not giving me option to change the root directory for one of my domains

I need to change the root directory for one of my domains,
But in my cpanel i dont find any options, just hard cores of system, but i have very basic knowledge about systems and servers.
How i can change that directory as easy as possible? I just need to change something because im gonna install laravel, and i want to change the public html to the public of laravel.
I was looking for the file that has the apache config, but it says like "the current config doesnt need to be changed or updated, bacause can be overryde", so i tought in Cpanel maybe i got an option for this.
Thanks, By the way i got an VPS, not shared. Using CENTOS 7.9.
Thanks and good night ^^
In cPanel, you can't change main domain directory/document root. If you want to change the document root, just change the main domain to another/random domain. Then add the domain that you want to change the root directory as addon domain
It's not recommended overriding Apache config. It's may break your system. WHM/cPanel exists to manage domains without a system admin knowledge
Do you try change this using console in Centos?
maybe will be better using console and open the file that contain the directory root

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.

.htaccess not working with .cfm pages on Railo

I want to do some very basic .htaccess stuff like block a directory by IP address. I know why this problem is happening, I just don't know how to fix it. I've read every post I can and there doesn't seem to be a consensus on how to fix it. Railo/Tomcat is grabbing control of the page before .htaccess rules are applied.
I am running Centos with Railo / Tomcat / Apache. I believe I am using mod_cfml, at least that's what's under the connector folder.
I have tried putting my .htaccess files in httpd.conf without any luck. I'm not sure I was doing that correctly, but I dropped the code into the virtual domain section of the site I'm working on.
Has anyone got this to work properly?
On iis you can change the order modules run which would solve that issue Asbyou would tell the htaccess module to run before mod_cfml
Can you do that on Apache?

.htaccess Rewriting Tomcat Server

I am writing a website using Railo. My code is to be deployed on a Railo Server running on Tomcat, overlayed on a regular Apache+PHP server.
I need to send all requests to http://subdomain.myserver.co.uk/ and its child files to the directory /public_html/railo/tomcat/webapps/ROOT/subdomain/ directory.
I defined a subdomain in cPanel, with the document root as /public_html/railo/tomcat/webapps/ROOT/subdomain/, but still requests to http://subdomain.myserver.co.uk/ display files in /public_html/railo/tomcat/webapps/ROOT/. I can view my files if I request http://subdomain.myserver.co.uk/subdomain/
I've been fiddling with the .htaccess files for quite some time now, but I'm stuck
Is there any way I can do what I'm trying to achieve, or am I resigned to get those pages using http://subdomain.myserver.co.uk/subdomain/
The Railo documentation on adding a site to a Railo/Tomcat/Apache/Linux install is here:
http://wiki.getrailo.org/wiki/Installation:InstallerDocumentation:LinAddingSites
I would also personally recommend against putting your site files in ROOT/sitedir/ because the ROOT directory is already configured for localhost, and making a subdirectory into another site will cause overlapping host configs in the WEB-INF directories.
Instead, just use whatever the default is for your control panel, and update your Tomcat server.xml file to point to the directory that your control panel naturally puts sites in. This will make your Railo site and your control panel work very smoothly together.
Hope this helps!
If you want your tomcat application to serve at example.com and not at example.com/application then you need to deploy your application at /ROOT and not at /application. This will make it the "default web application" so it'll be able to serve directly from example.com.
Have a look at: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
Cherouvim's answer didn't work for me. Eventually I ended up putting my entire application in the ROOT directory

.htacces rewrite to subdomains without wildcard dns

I've googled around quite a bit and also tried some of the solutions I've found. Unfortunately without success. My problem: For a Wordpress install I couldn't do a subdomain setup since I couldn't activate wildcard DNS on my server. This made me set up my Wordpress network install on the main domain and on two subdirectories as below:
domain.be
domain.be/alpha
domain.be/beta
I can however make set subdomains on my server, so I set up the following:
alpha.domain.be
beta.domain.be
I'm now trying to use .htaccess to rewrite this, so that people who go to domain.be/alpha are automatically redirected to alpha.domain.be - and obviously the same for the second (beta) subdirectory. As far as I can see, I should be able to pull this off without using dns wildcards. Unfortunately, I'm too inexperienced with .htaccess rules to pull this off. Anyone out there who can help me with this?
If you have your doubts about this set-up, I'm also interested in hearing about it.
Yeah, it's not gonna work. Mostly becasue the subfolder address is hardcoded in the blog address.
two things you can try:
make manual subdomains and pint the docroot for it at the wordpress install
use the domain mapping plugin to map subdomains to the subfolders. still gotta add each subdomain as a server alias to the same folder as wordpress.

Resources