Hosted two websites on same bitnami server

Hi @ghina.altal,

You need to configure the domain name to point to the instance’s IP. As you can see in this online tool, the domain name is not configured yet

https://www.whatsmydns.net/#A/www1.testatc.co.ae

If you proceed with the manual approach, don’t know if you find any issue when following the steps I mentioned, you will need to start with moving the folders of your applications to the htdocs folders (apps/testatc/htdocs for example)

Hi @jota , yes the domain name still not register … I want to check if it correct first …

did you checked what I did? is it correct?

Also is there a way ( local way for mapping the domine name o instance IP address and check it locally) ??

Like using /etc/hosts file or smothing like that.

@jota I tried to put the files of one website in following path: /opt/bitnami/apps/testatc

eventhough bitnami user is the owner of the folders:

but I got this message from the browser:

@jota here is the code 5ebf98d6-4fb3-908c-7ada-46b8ead0f682

please I want to fixe this ASAP!

I followed the document by copy the demo folder

Hi @ghina.altal,

I just found this in the error_log file of Apache (/opt/bitnami/apache2/logs/error_log)

[Sun Feb 17 11:23:21.850764 2019] [rewrite:error] [pid 21683:tid 140141418997504] [client 188.247.64.179:64980] AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden due to its similar ability to circumvent directory restrictions : /opt/bitnami/apps/testatc/htdocs/

You will need to add those options to the “Options” parameter in the /opt/bitnami/apps/testatc/conf/httpd-app.conf file.

Options Indexes MultiViews FollowSymLinks SymLinksIfOwnerMatch

and restart Apache.

sudo /opt/bitnami/ctlscript.sh restart apache

If you run into any other issue, please check the error_log file of Apache to ensure that the application is properly configured

@jota … thanx you … it is open,
now how can I access it with the domain name from the browser ???
I want to access it trying for example ww1.testatc.ae …

here are the configuration files content:

httpd.app.conf:

I can’t see the domain name on theses files … which file to edit, and what to amend??
also what permission and owner should be given to this web directory???

Hi @ghina.altal,

In order to access that WordPress installation using the domain name you want, you will need to follow these steps:

  • Add the domain you want to use to the httpd-vhosts.conf file of your testatc application.
  • Ensure that that file is included in the /opt/bitnami/apache2/conf/bitnami/bitnami-apps-vhosts.conf file. If not add it
Include "/opt/bitnami/apps/testatc/conf/httpd-vhosts.conf

https://docs.bitnami.com/aws/infrastructure/lamp/administration/understand-config/

  • Restart Apache
sudo /opt/bitnami/ctlscript.sh restart apache

If you didn’t configure your DNS provider with that domain name, you will need to modify the /etc/hosts file of your local computer to resolve the testatc.com domain with the IP of your instance.

@jota thank toy so much this reply was helpfull and clear…
just one thing please … how to add the domin name in httpd.vhosts.conf for testatc application??
here is the file … what to add to it ?

Hi @ghina.altal,

You will need to set the ServerName or the ServerAlias parameters to the domain you want to use

<VirtualHost *:80>
ServerName testatc.com
ServerAlias ww1.testatc.com
...

You can find more information about these parameters in the official page of Apache

https://httpd.apache.org/docs/2.4/mod/core.html#servername
https://httpd.apache.org/docs/2.4/mod/core.html#serveralias

@jota … about the permission and group owner…

should I run these command on the console:

sudo chown -R bitnami:daemon /opt/bitnami/apps/testatc/htdocs
sudo chmod -R g+w /opt/bitnami/apps/testatc/htdocs
sudo chmod 644 /opt/bitnami/apps/testatc/htdocs/wp-config.php

and for the conf directory and files: is this permission and owner correct? only bitnami user should own them?

I added domain name to the httpd.vhosts as this:

and to test the domin name, I added it to /etc/hosts file as suggested:

but when I brows it, I got following msg:

from where should I braws it? from inside bitnami server? how can I access bitnami browser??

Hi @ghina.altal,

Please remove the ServerName demo.example.com line in the httpd-vhosts.conf file, you don’t need it. You will need to restart Apache after that.

sudo /opt/bitnami/ctlscript.sh restart apache

It’s important to mention that you need to modify the hosts file of your local machine, not the one of the remote machine. I think you are using Windows in your local machine so please edit the Windows’s file

https://support.rackspace.com/how-to/modify-your-hosts-file/

Once you edit your local file, try to access the application again

Thanks

@jota yeah it’s open, that you so much :slight_smile:
what about the other part of the question … the files permission and owners for the folders … is it correct??

and when I should use port 443?? and how to configure ssl ???

@jota
we I try to access the website by the domain name : ww1.testatc.co.ae from the browser … the first page work fine , but when I move to the other pages I got error like

other pages error:

I have change the URL in database to that
image

when I check apache error I found this error:
[Thu Feb 21 12:46:35.308900 2019] [proxy_fcgi:error] [pid 9138:tid 140317093152512] [client 188.247.64.179:52053] AH01071: Got error ‘Primary script unknown\n’, referer: https://18.203.138.8/
[Thu Feb 21 12:46:41.808005 2019] [proxy_fcgi:error] [pid 9136:tid 140317118330624] [client 188.247.64.179:52055] AH01071: Got error ‘Primary script unknown\n’, referer: https://18.203.138.8/
[Thu Feb 21 12:46:52.149476 2019] [proxy_fcgi:error] [pid 9472:tid 140317143508736] [client 188.247.64.179:52065] AH01071: Got error ‘Primary script unknown\n’, referer: https://18.203.138.8/
[Thu Feb 21 12:46:58.541940 2019] [proxy_fcgi:error] [pid 9138:tid 140317269399296] [client 188.247.64.179:52068] AH01071: Got error ‘Primary script unknown\n’, referer: http://ww1.testatc.co.ae/
[Thu Feb 21 12:46:59.665046 2019] [proxy_fcgi:error] [pid 9472:tid 140317118330624] [client 188.247.64.179:52077] AH01071: Got error ‘Primary script unknown\n’, referer: http://ww1.testatc.co.ae/
[Thu Feb 21 12:47:25.084762 2019] [proxy_fcgi:error] [pid 9471:tid 140316824585984] [client 188.247.64.179:52108] AH01071: Got error ‘Primary script unknown\n’, referer: http://ww1.testatc.co.ae/
[Thu Feb 21 12:47:31.666344 2019] [proxy_fcgi:error] [pid 9471:tid 140317302970112] [client 188.247.64.179:52117] AH01071: Got error ‘Primary script unknown\n’, referer: http://ww1.testatc.co.ae/
[Thu Feb 21 13:07:09.309660 2019] [proxy_fcgi:error] [pid 9472:tid 140317000832768] [client 188.247.64.179:50622] AH01071: Got error ‘Primary script unknown\n’, referer: http://ww1.testatc.co.ae/
[Thu Feb 21 13:07:12.475357 2019] [proxy_fcgi:error] [pid 9137:tid 140316916905728] [client 188.247.64.179:50592] AH01071: Got error ‘Primary script unknown\n’, referer: http://ww1.testatc.co.ae/

Hi @ghina.altal,

The permissions of the folders and files look correct.

You will need to create a a second VirtualHost block for the HTTPS port. You can add this block under the current one you have in the httpd-vhosts.conf file

<VirtualHost *:443>
    ServerName testatc.com
    ServerAlias ww1.testatc.com
    DocumentRoot "/opt/bitnami/apps/testatc/htdocs"
    SSLEngine on
    SSLCertificateFile "/opt/bitnami/apache2/conf/server.crt"
    SSLCertificateKeyFile "/opt/bitnami/apache2/conf/server.key"

    Include "/opt/bitnami/apps/testatc/conf/httpd-app.conf"
</VirtualHost>

Restart Apache after including these lines

sudo /opt/bitnami/ctlscript.sh restart apache

It’s important to mention that you will use the certificate files that there are in the apache2/conf folder. In case you want to use different certificates, you will need to copy them to the machine and set the path to the files.

Could you please configure the domain in the wp-config.php file of your application?

https://docs.bitnami.com/aws/apps/wordpress/administration/configure-domain/

hello @jota I do exactly what you said, even I buy a new bitnami server to implement this site,

but hosting still not work.

when I access the site with this url : 63.35.185.18/demo/ it works
but when I try to access it using domain name which is: ww1.testatc.co.ae
it’s not work!

here is a shot of my database:

I changed the URLs in database to ww1.testatc.co.ae and tried to change it in wp_congi file but not working.

the apache log have theses errors:

[Tue Feb 26 08:32:52.579381 2019] [proxy_fcgi:error] [pid 27334:tid 140542461601536] [client 63.35.185.18:35622] AH01071: Got error ‘Primary script unknown\n’, referer: https://63.35.185.18/demo/services/financial-income/
[Tue Feb 26 08:32:52.592895 2019] [proxy_fcgi:error] [pid 27267:tid 140542567548672] [client 63.35.185.18:35624] AH01071: Got error ‘Primary script unknown\n’, referer: https://63.35.185.18/demo/services/investment-plan/
[Tue Feb 26 08:32:52.603523 2019] [proxy_fcgi:error] [pid 27335:tid 140542419638016] [client 63.35.185.18:35626] AH01071: Got error ‘Primary script unknown\n’, referer: https://63.35.185.18/demo/services/business-planning/
[Tue Feb 26 08:32:52.613834 2019] [proxy_fcgi:error] [pid 27335:tid 140542394459904] [client 63.35.185.18:35628] AH01071: Got error ‘Primary script unknown\n’, referer: https://63.35.185.18/demo/services/market-research-2/
[Tue Feb 26 08:32:54.424024 2019] [proxy_fcgi:error] [pid 27001:tid 140542386067200] [client 188.247.64.179:59787] AH01071: Got error ‘Primary script unknown\n’, referer: https://63.35.185.18/demo/
[Tue Feb 26 08:32:55.391629 2019] [proxy_fcgi:error] [pid 27335:tid 140542234998528] [client 188.247.64.179:59786] AH01071: Got error ‘Primary script unknown\n’, referer: https://63.35.185.18/demo/
[Tue Feb 26 08:32:57.856542 2019] [proxy_fcgi:error] [pid 27335:tid 140542201427712] [client 188.247.64.179:59785] AH01071: Got error ‘Primary script unknown\n’, referer: https://63.35.185.18/demo/
[Tue Feb 26 08:39:38.228453 2019] [proxy_fcgi:error] [pid 27335:tid 140542176249600] [client 63.35.185.18:37552] AH01071: Got error ‘Primary script unknown\n’, referer: http://63.35.185.18/demo/cases/big-data-and-ai/
[Tue Feb 26 08:39:38.231226 2019] [proxy_fcgi:error] [pid 27267:tid 140542411245312] [client 63.35.185.18:37554] AH01071: Got error ‘Primary script unknown\n’, referer: http://63.35.185.18/demo/cases/infrastructure/
[Tue Feb 26 08:39:38.233712 2019] [proxy_fcgi:error] [pid 27334:tid 140541991610112] [client 63.35.185.18:37556] AH01071: Got error ‘Primary script unknown\n’, referer: http://63.35.185.18/demo/cases/applications/
[Tue Feb 26 08:39:38.235951 2019] [proxy_fcgi:error] [pid 27335:tid 140542453208832] [client 63.35.185.18:37558] AH01071: Got error ‘Primary script unknown\n’, referer: http://63.35.185.18/demo/cases/system-integrator/
[Tue Feb 26 08:39:38.983744 2019] [proxy_fcgi:error] [pid 27334:tid 140542176249600] [client 172.26.11.1:36626] AH01071: Got error ‘Primary script unknown\n’, referer: http://63.35.185.18/demo/
[Tue Feb 26 08:39:38.985187 2019] [proxy_fcgi:error] [pid 27334:tid 140542461601536] [client 172.26.11.1:36628] AH01071: Got error ‘Primary script unknown\n’, referer: http://63.35.185.18/demo/
[Tue Feb 26 08:39:38.986313 2019] [proxy_fcgi:error] [pid 27001:tid 140542369281792] [client 172.26.11.1:36630] AH01071: Got error ‘Primary script unknown\n’, referer: http://63.35.185.18/demo/
[Tue Feb 26 08:39:39.632249 2019] [proxy_fcgi:error] [pid 27001:tid 140542151071488] [client 188.247.64.179:60162] AH01071: Got error ‘Primary script unknown\n’, referer: http://63.35.185.18/demo/
[Tue Feb 26 08:39:42.399121 2019] [proxy_fcgi:error] [pid 27335:tid 140541983217408] [client 188.247.64.179:60164] AH01071: Got error ‘Primary script unknown\n’, referer: http://63.35.185.18/demo/
[Tue Feb 26 08:40:00.379165 2019] [proxy_fcgi:error] [pid 27267:tid 140542016788224] [client 188.247.64.179:60223] AH01071: Got error ‘Primary script unknown\n’, referer: https://63.35.185.18/demo/wp-admin/
[Tue Feb 26 08:40:01.351952 2019] [proxy_fcgi:error] [pid 27335:tid 140542025180928] [client 188.247.64.179:60196] AH01071: Got error ‘Primary script unknown\n’, referer: https://63.35.185.18/demo/wp-admin/
[Tue Feb 26 08:40:01.352207 2019] [proxy_fcgi:error] [pid 27267:tid 140542335710976] [client 188.247.64.179:60225] AH01071: Got error ‘Primary script unknown\n’, referer: https://63.35.185.18/demo/wp-admin/

Here is the code of bitnami support tool 63c3b592-71d1-2ba6-3837-563a14ffff9b

please your prompt support on that.

Hi @ghina.altal,

I just modified the hosts file of my computer and could access your application without problems.

I noticed that there are some CSS issues, can you update the WP_SITEURL and WP_HOME in the wp-config.php file? You will need to set the domain you want to use when accessing your site.

It’s important to mention that you have not configured your domain in a DNS provider yet, that won’t allow you access the application unless you modify the hosts file in the computers you want to access the application from.

Happy to help!


Was my answer helpful? Click on :heart:

@jota
the first page is not displayed correctly, also when I tried to access the wp-admin page i got this error:

and when navigate to other pages the url of the pages is serverIP/ demo/page name – it should be my domin name/pagename

I have add change host file on my local computer to check the DNS.

@ jota I also update the wp_config file
image

hello @jota any update please?? I need to host the app as soon as possible…

virtual hosting for my website is not working…

please your prompt support … this is the code 1c95ab07-07b4-db0c-fe1c-164a7420caa9