I have a question about managing subdomains and how to best configure DNS in an architecture where the subdomains are dispatched on several servers
I don't even know if it's possible so requests for clarification
DNS configuration :
* A 51.51.51.1
# A 51.51.51.1
Domain: example.com
Sub-domain : sub1.example.com
There are 2 servers: 51.51.51.1, 51.51.51.2
How can we configure Apache on the 51.51.51.1 server so that a request like http://sub1.example.com is redirected to the 51.51.51.2 server, of course keeping the same source URL in the browser ?
Do we have to add a registration in the DNS for the sub-domain sub1 or can we do without and only modify the Apache configuration on the server 51.51.51.1 ?
Which is more effective ?
Related
I have the following question that I do not know how to solve it in the most efficient way.
I have two servers, one with Apache where I have a Wordpress instance responding for port 80, and on another server I have a Wildfly with another application listening on port 8080. The Wordpress that I have configured on the Apache server, responds to the URL http://www.somedomain.com What I'm not so clear about is how to do when a request arrives at http://www.somedomain.com/yyyy and redirects me to the Wildfly server where an application is responding to the URL : 8080 / app
How could I do it in the most effective way? Using the rewrite module in the .htaccess file or using the Apache proxy module and configuring it in the Apache virtual host? How would I have to do it?
Thank you very much in advance.
You're mixing a few things that are not related to each other. First of all, a redirect is something different than a proxy. Redirecting means asking the client (browser) to look at another URL. A proxy, on the other hand, retrieves the content of the other URL itself and passes it to the client. Using a proxy, the other URL remains invisible to the client.
Second, mod_rewrite is not limited to htaccess configuration. In fact it's better to configure mod_rewrite in the virtual host configuration, just as you suggested with the proxy configuration.
The htaccess is simply for users who are not allowed to mess with the server configuration itself. Configuration in the htaccess can be limited by the admin for security purposes at the cost of slowing down the server.
That said, if you are looking to map your wildfly server paths into your main server's paths, you might want to use something like this inside your main server's virtual host block:
<Location "/yyyy">
ProxyPass "http://wildfly:8080/app"
</Location>
See http://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass for detailed explanations.
I'm setting up a redirect server where users can input an alternate domain name, point DNS to my server, and configure it to redirect to their servers. My plan is to use the default virtual host in Apache to handle all the requests, route everything to a web application that looks up the place to redirect in a database.
I'd like to support HTTPS, but I can't figure a way to dynamically specify the certificate and key for each site. The only way that I know of configuring HTTPS is by putting directives for SSH certs and keys into a virtual host specific to that domain name. I'd like to store the certificates and keys in the database along with the domain name and have Apache call my web app during the SNI handshake.
Is it possible to have flexible, dynamic SNI under Apache?
I have a server of OVH company and I'm having some problems setting a subdomain for it.
My server configuration is something like this:
Apache service working at port 80 with the website and works only with https (apache config makes a redirection for http request to https).
PostgreSQL service on default port 5432
Gitlab installation working over nginx at port 81.
I'm trying to set the external_url for gitlab to http://git.example.com:81 but when I try to access, i'm being redirected to a OVH default page.
I can access gitlab if I set the external url to something like http://example.com:81 or even if I set a relative path like http://example.com:81/gitlab but I can't make it work with the subdomain http://git.example.com:81
How do you think I can get it working? Maybe I have to change DNS zone or something related to the redirections in the OVH web manager panel??
Thanks in advance! This is a really great community!
(Posted on behalf of the OP).
I just assign in the panel of the web hosting this redirection: git.example.com => example.com and that does the trick.
I am trying to setup a gitlab repository and I am quite new to the web server side of things. My setup is the following:
I have an apache server which is running my main website on port 8080.
I have the gitlab configured with SSL and Nginx and running on port 2443.
At the moment, the gitlab site can be accessed through https://www.example.com:2443.
What I would like to do is setup a redirect through my apache server where if someone comes to http://www.example.com/gitlab or https://www.example.com/gitlab, they get redirected to ``https://www.example.com:2443` (preferably without the web browser text field changing).
Could this be done easily with Apache? Also, since the redirect is to an SSL site, any special things we need to consider?
You can try adding the redirect directive to your Apache VirtualHosts (8080 and 443).
Redirect permanent /gitlab https://www.example.com:2443
Normally I have no problems setting up Apache2 virtual hosts. However, in this case the domain is configured via Akamai rather than the normal DNS record, and apache is displaying the default site rather than the one I have configured for the required subdomain.
In other words, I have configured a virtual host test.domain.com, but Apache is displaying the default one when I go to http://test.domain.com/, and I guessing this is because Apache is not receiving the request from test.domain.com but from something else on the Akamai network.
How do I find out what the correct configuration of the virtual host should be?
Your main domain (in this case test.domain.com) needs to be configured as a CNAME to the akamai network (test.domain.com.edgesuite.net), and then you need an origin hostname such as origin-test.domain.com. Then you need to create an "Edge Hostname" on the akamai network portal and then a configuration on the HTTP network to answer for that digital property (test.domain.com). Akamai can be configured to forward the requesting domain (test.domain.com) or the origin forward domain in the Host header (origin-test.domain.com). either way you should setup your Apache Virtualhost to answer for both by doing
ServerName test.domain.com
ServerAlias origin-test.domain.com