Multiple domains with multi-apps

Keywords: LAMP/MAMP/WAMP - Microsoft Azure - How to - Domain Name (DNS)
Description:
Hi there,

I have multi domains and multi apps (wordpress)…

I tried many solutions found here in the forum but it didn’t work.

Check here the problem:
http://azzamdaaboul.net/applications.html

So instead of

This redirecting to http://azzamdaaboul.net it’s redirecting to http://azzamdaaboul.net/AzzamDaaboul/

I changed the URL (from config & phpmyadmin)
/opt/bitnami/apps/AzzamXX/conf/httpd-vhosts.conf
sudo /opt/bitnami/apps/AzzamXX/bnconfig --machine_hostname azzamdaaboul.net
and restarted the apache… but not working!

Any help? thanks!!

2f7d1070-7295-b92a-991c-10a39c974d68

I checked this but it didn’t help!
https://httpd.apache.org/docs/current/vhosts/examples.html

Hi @azzamdaaboul,

You edited the httpd-vhosts.conf file but that file is not included by default in the Apache’s configuration file. Can you take a look at this guide and ensure you include it and restart Apache?

https://docs.bitnami.com/azure/apps/wordpress/administration/redirect-custom-domains/

Please note that you will also need to configure the SSL certificates in those virtual hosts (you can use the default ones you have in /opt/bitnami/apache2/conf).

Happy to help!


Was my answer helpful? Click on :heart:

Thanks @jota I tried this and I am missing something not able to find what…

I saw this before but still not able to do it right.

Hi @azzamdaaboul,

As I mentioned, you need to configure the SSL certificates of the new virtual hosts you created. These commands will create a symbolic link in the /opt/bitnami/apps/AzzamDaaboul/conf/certs folders to the mari-sy.org certificates you already have:

sudo ln -sf /opt/bitnami/letsencrypt/certificates/mari-sy.org.crt /opt/bitnami/apps/AzzamDaaboul/conf/certs/server.crt
sudo ln -sf /opt/bitnami/letsencrypt/certificates/mari-sy.org.key /opt/bitnami/apps/AzzamDaaboul/conf/certs/server.key
sudo /opt/bitnami/ctlscript.sh restart apache

Happy to help!


Was my answer helpful? Click on :heart:

1 Like

Many thanks, the results:

AH00526: Syntax error on line 14 of /opt/bitnami/apps/MARI/conf/httpd-vhosts.conf:
SSLCertificateFile: file '/opt/bitnami/apps/MARI/conf/certs/server.crt' does not exist o           r is empty
apache config test fails, aborting
Monitored apache
bitnami@bitnami-lampstack-f7be:~$ sudo /opt/bitnami/ctlscript.sh restart apache
Unmonitored apache
AH00526: Syntax error on line 14 of /opt/bitnami/apps/MARI/conf/httpd-vhosts.conf:
SSLCertificateFile: file '/opt/bitnami/apps/MARI/conf/certs/server.crt' does not exist o           r is empty
apache config test fails, aborting
AH00526: Syntax error on line 14 of /opt/bitnami/apps/MARI/conf/httpd-vhosts.conf:
SSLCertificateFile: file '/opt/bitnami/apps/MARI/conf/certs/server.crt' does not exist o           r is empty
apache config test fails, aborting
Monitored apache
bitnami@bitnami-lampstack-f7be:~$

I created the certificates using:
sudo /opt/bitnami/bncert-tool

I tried to make the certificate again, I got an erros:
Error

An error occurred when applying configurations.

The web server configuration was left unchanged. There was an error in the new
configuration, so it was reverted.

Failed steps:
* Starting web server: Failed to start

Find more details in the log file:

/tmp/bncert-201910221219.log

If you find any issues, please check Bitnami Support forums at:

https://community.bitnami.com

I couldn’t download the file to check the error:
Error: /tmp/bncert-201910221219.log: open for read: permission denied

Results are very bad :smiley:

Check the links please.

https://mari-sy.org/
http://azzamdaaboul.net

I don’t know how to fix that.

Hi @azzamdaaboul,

To solve this error, you need to run similar commands to the ones I shared above

sudo ln -sf /opt/bitnami/letsencrypt/certificates/mari-sy.org.crt /opt/bitnami/apps/MARI/conf/certs/server.crt
sudo ln -sf /opt/bitnami/letsencrypt/certificates/mari-sy.org.key /opt/bitnami/apps/MARI/conf/certs/server.key
sudo /opt/bitnami/ctlscript.sh restart apache

You didn’t provide the whole output message and that’s why I didn’t share these commands.

If you continue running into issues accessing the applications, please share the following information:

  • The Apache’s log file (/opt/bitnami/apache2/logs/error_log)
  • The output of these commands
sudo ls -la /opt/bitnami/letsencrypt/certificates/
sudo ls -la /opt/bitnami/apache2/conf
sudo ls -la /opt/bitnami/apps/AzzamDaaboul/conf/certs/
sudo ls -la /opt/bitnami/apps/MARI/conf/certs/

Thanks

  • to all problems I have, now not able to open phpmyadmin I got this:
    2019-10-23 13:12:47 Opening connection to localhost:80 for forwarding from 127.0.0.1:49872

Output:

Using username "bitnami".
Authenticating with public key "bitnami-hosting-key"
Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.15.0-1060-azure x86_64)
   ___ _ _                   _
  | _ |_) |_ _ _  __ _ _ __ (_)
  | _ \ |  _| ' \/ _` | '  \| |
  |___/_|\__|_|_|\__,_|_|_|_|_|

  *** Welcome to the Bitnami LAMP 7.3.10-0 ***
  *** Documentation:  https://docs.bitnami.com/azure/infrastructure/lamp/ ***
  ***                 https://docs.bitnami.com/azure/ ***
  *** Bitnami Forums: https://community.bitnami.com/ ***
Last login: Wed Oct 23 11:12:42 2019 from xxxxxx
bitnami@bitnami-lampstack-f7be:~$ sudo ls -la /opt/bitnami/letsencrypt/certifica                        tes/
total 40
drwxr-xr-x 2 bitnami root 4096 Oct 22 12:46 .
drwxr-xr-x 5 bitnami root 4096 Oct 19 22:57 ..
-rw-r--r-- 1 bitnami root 3356 Oct 22 12:46 azzamdaaboul.net.crt
-rw-r--r-- 1 bitnami root 1648 Oct 22 12:46 azzamdaaboul.net.issuer.crt
-rw-r--r-- 1 bitnami root  237 Oct 22 12:46 azzamdaaboul.net.json
-rw-r--r-- 1 bitnami root  288 Oct 22 12:46 azzamdaaboul.net.key
-rw-r--r-- 1 bitnami root 3311 Oct 19 22:57 mari-sy.org.crt
-rw-r--r-- 1 bitnami root 1648 Oct 19 22:57 mari-sy.org.issuer.crt
-rw-r--r-- 1 bitnami root  232 Oct 19 22:57 mari-sy.org.json
-rw-r--r-- 1 bitnami root  288 Oct 19 22:57 mari-sy.org.key
bitnami@bitnami-lampstack-f7be:~$ sudo ls -la /opt/bitnami/apache2/conf
total 392
drwxr-xr-x  5 bitnami root   4096 Oct 22 12:46 .
drwxr-xr-x 14 root    root   4096 Oct  1 12:39 ..
lrwxrwxrwx  1 root    root     58 Oct 22 12:46 azzamdaaboul.net.crt -> /opt/bitn                        ami/letsencrypt/certificates/azzamdaaboul.net.crt
lrwxrwxrwx  1 root    root     58 Oct 22 12:46 azzamdaaboul.net.key -> /opt/bitn                        ami/letsencrypt/certificates/azzamdaaboul.net.key
drwxr-xr-x  2 bitnami root   4096 Oct 22 12:47 bitnami
-rw-r--r--  1 bitnami root    289 Oct  1 12:39 deflate.conf
drwxr-xr-x  2 bitnami root   4096 Oct  1 12:32 extra
-rw-r--r--  1 root    root  20055 Oct 22 12:46 httpd.conf
-rw-r--r--  1 root    root  20048 Oct  1 12:42 httpd.conf.back.201910192250
-rw-r--r--  1 root    root  20050 Oct 19 22:57 httpd.conf.back.201910221219
-rw-r--r--  1 root    root  20050 Oct 19 22:57 httpd.conf.back.201910221232
-rw-r--r--  1 root    root  20050 Oct 22 12:33 httpd.conf.back.201910221242
-rw-r--r--  1 bitnami root  13064 Sep 29 17:18 magic
lrwxrwxrwx  1 root    root     53 Oct 22 12:33 mari-sy.org.crt -> /opt/bitnami/l                        etsencrypt/certificates/mari-sy.org.crt
lrwxrwxrwx  1 root    root     53 Oct 22 12:33 mari-sy.org.key -> /opt/bitnami/l                        etsencrypt/certificates/mari-sy.org.key
-rw-r--r--  1 bitnami root  60847 Sep 29 17:18 mime.types
-rw-r--r--  1 bitnami root   7413 Aug  2  2012 modsecurity.conf
drwxr-xr-x  3 bitnami root   4096 Oct  1 12:32 original
-rw-r--r--  1 bitnami root  17597 Oct  1 12:39 pagespeed.conf
-rw-r--r--  1 bitnami root 141034 Oct  1 12:32 pagespeed_libraries.conf
-rw-r--r--  1 bitnami root    199 Oct  1 12:33 php-fpm-apache.conf
-rw-------  1 bitnami root   1854 Oct 19 19:31 privkey.pem
-rw-r--r--  1 root    root   1180 Oct 19 19:31 server.crt
-rw-r--r--  1 root    root    985 Oct 19 19:31 server.csr
-rw-------  1 root    root   1679 Oct 19 19:31 server.key
-rw-r--r--  1 bitnami root    203 Oct  1 12:38 ssi.conf
bitnami@bitnami-lampstack-f7be:~$ sudo ls -la /opt/bitnami/apps/AzzamDaaboul/con                        f/certs/
total 8
drwxr-xr-x 2 bitnami root 4096 Oct 22 12:34 .
drwxr-xr-x 4 bitnami root 4096 Oct 19 21:12 ..
lrwxrwxrwx 1 root    root   53 Oct 22 12:34 server.crt -> /opt/bitnami/letsencry                        pt/certificates/mari-sy.org.crt
lrwxrwxrwx 1 root    root   53 Oct 22 12:34 server.key -> /opt/bitnami/letsencry                        pt/certificates/mari-sy.org.key
bitnami@bitnami-lampstack-f7be:~$ sudo ls -la /opt/bitnami/apps/MARI/conf/certs/                        total 8
drwxr-xr-x 2 bitnami root 4096 Oct 23 11:04 .
drwxr-xr-x 4 bitnami root 4096 Oct 19 21:18 ..
lrwxrwxrwx 1 root    root   53 Oct 23 11:04 server.crt -> /opt/bitnami/letsencry                        pt/certificates/mari-sy.org.crt
lrwxrwxrwx 1 root    root   53 Oct 23 11:04 server.key -> /opt/bitnami/letsencry                        pt/certificates/mari-sy.org.key
bitnami@bitnami-lampstack-f7be:~$ sudo ls -la /opt/bitnami/apps/AzzamDaaboul/conf/certs/
total 8
drwxr-xr-x 2 bitnami root 4096 Oct 23 11:15 .
drwxr-xr-x 4 bitnami root 4096 Oct 19 21:12 ..
lrwxrwxrwx 1 root    root   53 Oct 23 11:15 server.crt -> /opt/bitnami/letsencrypt/certificates/mari-sy.org.crt
lrwxrwxrwx 1 root    root   53 Oct 23 11:15 server.key -> /opt/bitnami/letsencrypt/certificates/mari-sy.org.key
bitnami@bitnami-lampstack-f7be:~$

I runned bitnami support tool again:

08ff70ee-addd-28f9-db05-cd895196c3b4

Hi @azzamdaaboul,

You have some rewriteRules and rewriteBase configuration in the httpd-app.conf files that are not needed anymore if you use custom virtual hosts. Could you change those lines to work at / instead of having /MARI or /AzzamDaaboul?

You will also need to set the WP_HOME and WP_SITEURL in the wp-config.php files of each application.

Let us know if that solves the issues.

Thanks

Hi @jota

I started a new fresh LAMP, could you please guide me so I don’t mess up? Thanks

Hi @azzamdaaboul,

  • First of all, install the 2 WordPress’ modules in your site

https://docs.bitnami.com/installer/apps/wordpress/configuration/install-several-wordpress-modules/

  • Then, generate and configure a new certificate (including your 2 domains) in the instance

https://docs.bitnami.com/aws/how-to/understand-bncert/

  • Ensure you can access your both applications using http and https (the virtual hosts won’t be configured at this moment so you will need to use /yourfirstsite or /yoursecondsite to access them)

Once you confirm this, we will let you know about how to configure Apache and the application to work on the different domains.

Thanks

I have a problem with the VM bitnami portal, this is why I didn’t reply to you yet.

Regarding the 3 point. Will I be able to add more WP applications later?

Hi @azzamdaaboul,
If you add more applications in the future you will need to generate a new certificate including that domain too.
Regarding the issue with the bitnami launchpad, I checked it and it seems to be up again.

Thanks @miguelaeh but it’s not up from my side. I cleared the cache.

This is unbelievable… I am really disappointed guys!! @miguelaeh @jota

Hi @azzamdaaboul,

What were you trying to do when getting that error message in the Launchpad? Our team is investigating the error but we need to know if you were deploying a new instance, getting the info of an already running one, … As @miguelaeh mentioned, the Launchpad works properly for us.

Thanks

Nothing… I woke up… Tried to login … I get this message as you see in the screenshot.