Config Apache with domain and subdomain
-
Hello, now I have a strange problem and I need a solution from you! I have tried before according to the Apache documentation to execute but it did not work.
I have a non-standard application in which I want to run soon and I will have it configured like this:
- "website.com" - is the domain where the application will be enabled and running from the CDN.
- Create an "alias" under the subdomain that is "update.website.com" without the CDN and with Cloudron authentication.
I will need this for the purpose of updating the app to bypass conflicts during updates and a decent backup.
Why this? I have the application in the "public" folder, and the maintenance and update message page in the "html" folder.
Then using Apache config, I change the location of the application from the main domain to the sub-domain "update", and on the main domain the update message. In this way, I can safely make a copy and update the application well without losing the CDN configuration.
-
@girish My bad, I didn't write the question.
How to set in app.conf file to handle subdomain to another folder. To have 2 domains hooked up in one LAMP. The main one for the application and a subdomain for updates.
-
Just creating multiple VirtualHost should work. Something like below works for me.
ServerName %{HTTP_HOST} <VirtualHost *:80> ServerName main.smartserver.io DocumentRoot /app/data/public/main LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy CustomLog "|/bin/cat" proxy ErrorLog "|/bin/cat" <Directory /app/data/public/main> Options +FollowSymLinks AllowOverride All Require all granted </Directory> # Do not remove this include. It's required for your app to see the Real IP Include "/app/code/apache/rpaf.conf" </VirtualHost> <VirtualHost *:80> ServerName update.smartserver.io DocumentRoot /app/data/public/update LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy CustomLog "|/bin/cat" proxy ErrorLog "|/bin/cat" <Directory /app/data/public/update> Options +FollowSymLinks AllowOverride All Require all granted </Directory> # Do not remove this include. It's required for your app to see the Real IP Include "/app/code/apache/rpaf.conf" </VirtualHost>
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login
?